csstools / stylelint-use-nesting

Enforce nesting when it is possible in CSS
Creative Commons Zero v1.0 Universal
40 stars 8 forks source link

Provided compatibility with stylelint 16 by default #17

Closed tomekpiwowar closed 6 months ago

tomekpiwowar commented 6 months ago

With the release of Stylelint 16.0.0, the CommonJS Node.js API has been deprecated, which could lead to implementation challenges for users of the stylelint-use-nesting plugin. While the plugin currently offers .mjs files, this setup requires users to adopt the stylelint.config.mjs configuration file and ensure that their entire project is compatible with ES modules. This requirement may not be trivial for all users and could limit the plugin's usability.

To enhance compatibility and future-proof the plugin, I propose the following changes:

Remove CommonJS support: By focusing solely on ESM (ECMAScript Modules), we align with the current direction of JavaScript development and tooling. This change simplifies the plugin's structure and reduces potential confusion about which module system to use. Upgrade the minimum version requirement for Stylelint: By specifying Stylelint ^16.0.1 as the minimum version in peerDependencies, we ensure that users of the plugin are on a version that supports ESM. This move also helps prevent issues that may arise from the deprecated CommonJS API. These changes aim to streamline the user experience, reduce potential implementation hurdles, and ensure that the stylelint-use-nesting plugin remains a valuable tool for developers seeking to enforce nesting in CSS with the latest versions of Stylelint.

romainmenke commented 6 months ago

Hi @tomekpiwowar,

Although this change does seem like a fix at the surface it isn't complete. I am going to close this in favor of a more complete fix.

Thank you 🙇