ota-meshi / stylelint-config-recommended-vue

The recommended shareable Vue config for Stylelint.
MIT License
100 stars 5 forks source link

Move stylelint-config-recommended to peerDeps #68

Open Ahmed-Alsalim opened 8 months ago

Ahmed-Alsalim commented 8 months ago

stylelint 16 dropped support for node 14 and 16 so it could be helpful to make a version that uses stylelint 15 and another version for stylelint >=16. currently it's possible to use overrides for npm and resolutions for yarn as a workaround to keep versions that supports node 14 & 16 but a separate version of this repo would be more helpful.

ota-meshi commented 8 months ago

I don't see why that would be helpful. Since I have confirmed that stylelint v16 can be used without changing the source code of this package, I think it is a good not to make any breaking changes.

Ahmed-Alsalim commented 8 months ago

existing old projects who have to use node 14 or 16 can't use stylelint 16 as it requires node >= 18. to be specific I meant this one "stylelint-config-recommended": ">=6.0.0" which automatically installs latest version (v14) that uses stylelint 16. without setting overrides or resolutions for that dependency, installing your package in node 16 throws an error

ota-meshi commented 8 months ago

If you are using older Node.js, I think you should just use Stylelint v15 or earlier. Why install Stylelint v16? This incompatibility is also indicated in the documentation. https://stylelint.io/migration-guide/to-16#removed-support-for-nodejs-less-than-18120

Ahmed-Alsalim commented 8 months ago

What I'm trying to say is currently your package installs stylelint-config-recommended 14.0.0 as a dependency even if I'm using node 16 which throws an error. you can replicate the error by simply using node 16 and running yarn add stylelint-config-recommended-vue -D image

ota-meshi commented 8 months ago

Hmm. Perhaps stylelint-config-recommended-vue should list stylelint-config-recommended in peerDeps? I definitely don't want to make breaking changes at least every time a new version of stylelint is released, as stylelint-config-recommended-vue would require a major version release every month.

Ahmed-Alsalim commented 8 months ago

I guess that could work. Don't forget to update readme to tell users to install the proper version of stylelint-config-recommended as peerDeps are not auto-installed by default. BTW about breaking changes and major versions, having 2 major versions will be enough for now. one for node <18 (stylelint-config-recommended: "^13.0.0") and one for node >= 18 (stylelint-config-recommended: ">=14.0.0"). next major version will only be needed when they remove support for node 18 which I don't think is happening any time soon

gmcinalli commented 4 months ago

Hi @ota-meshi, any updates on this?

traceslord commented 3 months ago

package.json

{
  "dependencies": {
    "stylelint-config-recommended-vue": "~1.4.0"
  },
  "resolutions": {
    "stylelint-config-recommended": "^13.0.0"
  }
}