prettier / stylelint-config-prettier-scss

Turns off all CSS and SCSS rules that are unnecessary or might conflict with prettier.
MIT License
25 stars 4 forks source link

DeprecationWarning: The CommonJS Node.js API is deprecated. #12

Open ajiho opened 2 months ago

ajiho commented 2 months ago

package.json

{
"scripts": {
    "stylelint-scss-check": "stylelint-config-prettier-scss-check",
 }
}

run : npm run stylelint-scss-check

(node:5692) [stylelint:002] DeprecationWarning: The CommonJS Node.js API is deprecated.
See https://stylelint.io/migration-guide/to-16
(Use `node --trace-deprecation ...` to show where the warning was created)

my stylelint version: "stylelint": "^16.9.0",

I think stylelint-config-prettier did not take into account some special situations, such as when I use stylelint-config-twbs-bootstrap, it still needs to handle conflicts

This bag is very necessary to exist, thank you very much for your work

However, there will still be some conflicting issues that need to be resolved, and I will continue to report later

elwayman02 commented 1 month ago

Thanks for reporting! It looks like stylelint v16 did away with CommonJS require and we must use imports now instead.

The change likely needs to happen here:

https://github.com/prettier/stylelint-config-prettier-scss/blob/main/src/checker.js#L3-L5 https://github.com/prettier/stylelint-config-prettier-scss/blob/main/bin/check.js#L3

I'm not sure when exactly I'll have time to make the change and test it out, but I'd be happy to review a PR and get a release out if anyone wants to take a stab at it!