-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
Disable rules based on Node.js version #423
Conversation
Good idea! This is much better. |
'10.0.0': 'off' | ||
}, | ||
'prefer-named-capture-group': { | ||
'10.0.0': 'off' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed now that this no longer reports when I run XO on https://github.com/avajs/ava (It does with XO 0.26.0)
Its node
version target is: "node": ">=10.18.0 <11 || >=12.14.0 <13 || >=13.5.0"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested that with >=10.18.0 <11 || >=12.14.0 <13 || >=13.5.0
the current code turn off only the following rules:
node/prefer-global/text-encoder
node/prefer-global/text-decoder
unicorn/prefer-flat-map
node/prefer-promises/dns
node/prefer-promises/fs
Maybe you have an outdated version of eslint-config-xo
so the rule is not enabled in the first place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also tried to run xo 0.26.0 on the current codebase of https://github.com/avajs/ava and the rule doesn't report.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, weird. I couldn't reproduce it multiple times earlier. Just tried reinstalling node_modules everywhere and now it of course works... Sorry for wasting your time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem! I'd rather spend more time to make sure it works.
Sometimes weird stuff happens with package-lock.json......
This PR change how the internal logic works regarding the
nodeVersion
. Instead of disabling rules by default and enabling them based on the version we now do the opposite.That allow us to define whatever rules we like regardless of the Node version and then disable some based on the user's node version.
This way we won't have to change anything when we increase the minimum Node version supported by XO !
For XO users it doesn't change anything.
Fix #421