Skip to content

Wrong Stylelint version, not respecting peer dependency (using Yarn) #106

@alexilyaev

Description

@alexilyaev

This might be a Yarn issue...

In package.json:

"stylelint": "7.12.0",
"stylelint-webpack-plugin": "0.8.0",

Installing using Yarn v0.27.5

Running npm ls stylelint:

├── stylelint@7.12.0 
└─┬ stylelint-webpack-plugin@0.8.0
  └── stylelint@7.11.0 

Error:

Error: Undefined rule selector-max-id
    at module.exports (/Users/alex/www/Node/Personal/dynamo-builder/node_modules/stylelint-webpack-plugin/node_modules/stylelint/lib/utils/configurationError.js:8:27)
    at Object.keys.forEach.ruleName (/Users/alex/www/Node/Personal/dynamo-builder/node_modules/stylelint-webpack-plugin/node_modules/stylelint/lib/augmentConfig.js:279:13)
    at Array.forEach (native)
    at normalizeAllRuleSettings (/Users/alex/www/Node/Personal/dynamo-builder/node_modules/stylelint-webpack-plugin/node_modules/stylelint/lib/augmentConfig.js:275:29)
    at augmentConfigBasic.then.then.then.then.augmentedConfig (/Users/alex/www/Node/Personal/dynamo-builder/node_modules/stylelint-webpack-plugin/node_modules/stylelint/lib/augmentConfig.js:84:12)

selector-max-id was added only in 7.12.0.
I'd expect stylelint-webpack-plugin to use the peer instead of installing it's own version of Stylelint.

Installing using npm v5.0.3

Works as expected.

Running npm ls stylelint:

├── stylelint@7.12.0 
└─┬ stylelint-webpack-plugin@0.8.0
  └── stylelint@7.12.0  deduped

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions