Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow installing together with Stylelint v15 #273

Closed
FloEdelmann opened this issue Feb 20, 2023 · 5 comments · Fixed by #276
Closed

Allow installing together with Stylelint v15 #273

FloEdelmann opened this issue Feb 20, 2023 · 5 comments · Fixed by #276

Comments

@FloEdelmann
Copy link

FloEdelmann commented Feb 20, 2023

Stylelint v15 has deprecated many rules (see also #272), but all of them are still included. However, the strict peer dependency check in npm doesn't allow installing the latest stylelint-config-sass-guidelines with Stylelint v15:

$ npm install -D stylelint@15
npm ERR! While resolving: stylelint-config-sass-guidelines@9.0.1
npm ERR! Found: stylelint@15.2.0
npm ERR! node_modules/stylelint
npm ERR!   peer stylelint@">=14.0.0" from stylelint-config-html@1.1.0
npm ERR!   node_modules/stylelint-config-html
npm ERR!     dev stylelint-config-html@"^1.1.0" from the root project
npm ERR!   peer stylelint@"^14.5.1 || ^15.0.0" from stylelint-scss@4.4.0
npm ERR!   node_modules/stylelint-scss
npm ERR!     stylelint-scss@"^4.0.0" from stylelint-config-sass-guidelines@9.0.1
npm ERR!     node_modules/stylelint-config-sass-guidelines
npm ERR!       dev stylelint-config-sass-guidelines@"^9.0.1" from the root project
npm ERR!   2 more (the root project, stylelint-config-standard)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer stylelint@"^14.0.1" from stylelint-config-sass-guidelines@9.0.1
npm ERR! node_modules/stylelint-config-sass-guidelines
npm ERR!   dev stylelint-config-sass-guidelines@"^9.0.1" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: stylelint@14.16.1
npm ERR! node_modules/stylelint
npm ERR!   peer stylelint@"^14.0.1" from stylelint-config-sass-guidelines@9.0.1
npm ERR!   node_modules/stylelint-config-sass-guidelines
npm ERR!     dev stylelint-config-sass-guidelines@"^9.0.1" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

To at least allow upgrading Stylelint to start using the new rules/fixes, and slowly migrate away from the deprecated rules, could the peer dependency version be changed from ^14.0.1 to ^14.0.1 || ^15.0.0?

This could be released as a minor or patch version, while removing deprecated rules like suggested in #272 would be a breaking change.

@rubiesonthesky
Copy link

For those who do not want to wait and can take the risk of things not working together, the version can be overridden in package.json. It seems to be working but there are deprecation warnings as mentioned in linked issue.

  "overrides": {
    "stylelint-config-sass-guidelines": {
      "stylelint": "^15.0.0"
    }
  },

@echoix
Copy link

echoix commented Mar 7, 2023

The megalinter project, https://GitHub.com/oxsecurity/megalinter that aggregates many linters is affected by this limitation. A npm install --force is used, but seems to break more things than it fixes. Could this be addressed soon ?

@AbdealiLoKo
Copy link

I seem to have the same issue, For some reason the overrides approach recommended by @rubiesonthesky does not work for me - On adding the to my package.json and using npm i still gives me the error.

@bjankord
Copy link
Owner

@echoix
Copy link

echoix commented Mar 14, 2023

Great work! We'll work on reenabling this tool in the next Megalinter release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants