stylelint-config-recommended-vue icon indicating copy to clipboard operation
stylelint-config-recommended-vue copied to clipboard

Move stylelint-config-recommended to peerDeps

Open Ahmed-Alsalim opened this issue 1 year ago • 8 comments

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.

Ahmed-Alsalim avatar Dec 22 '23 07:12 Ahmed-Alsalim

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.

ota-meshi avatar Dec 22 '23 07:12 ota-meshi

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

Ahmed-Alsalim avatar Dec 22 '23 09:12 Ahmed-Alsalim

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

ota-meshi avatar Dec 22 '23 12:12 ota-meshi

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

Ahmed-Alsalim avatar Dec 22 '23 13:12 Ahmed-Alsalim

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.

ota-meshi avatar Dec 27 '23 06:12 ota-meshi

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

Ahmed-Alsalim avatar Dec 27 '23 08:12 Ahmed-Alsalim

Hi @ota-meshi, any updates on this?

gmcinalli avatar Apr 17 '24 13:04 gmcinalli

package.json

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

traceslord avatar May 14 '24 05:05 traceslord