Closed jdlrobson closed 1 year ago
This should already be disabled by our language rules...
We use the https://github.com/eslint-community/eslint-plugin-es-x fork as eslint-plugin-es is unmaintained, but this rule (https://eslint-community.github.io/eslint-plugin-es-x/rules/no-nullish-coalescing-operators.html) is included in our language/es6.json rules via plugin:es/restrict-to-es2015. Not sure why it isn't triggering in the example given.
With most of the syntactic fetaures, you should also get a parsing error before you get an ESLint error.
The errors aren't triggering because you added the files to .eslintignore
: https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/967991/9/.eslintignore
Thanks for the detective work! That was very helpful!
Either I've been writing too much PHP code or my IDE is playing up but I was surprised to see code make it through our linters into production that caused the following bug: https://phabricator.wikimedia.org/T350519 (see fix https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/971997)
I am not too familiar with existing plugins we load, and available rules but it seems like something like this rule would be helpful: https://eslint-plugin-es.mysticatea.dev/rules/no-nullish-coalescing-operators.html