cli
cli copied to clipboard
ESLint plugin not recognising rules matching a folder
trafficstars
What happened?
I received different ESLint results locally and in Code PushUp report.
What would you expect to happen?
I expected the no-magic-numbers rule to be turned off for the perf folder in the utils package.
What steps did you take?
- I added an exception for some ESLint rules in the
perffolder and added it to the root.eslintrc.json.
{
"files": ["perf/**/*.ts"],
"rules": {
"no-magic-numbers": "off",
"sonarjs/no-duplicate-string": "off"
}
}
- I checked that ESLint no longer showed warnings e.g. for
no-magic-numbersin these files. - I ran Code PushUp and displayed the results in portal.
- There I saw these rules being treated as enabled.
What operation system are you on?
Windows
Node version
No response
Relevant log output
No response
I think the culprit is that you have to turn off the @typescript-eslint/no-magic-numbers not the no-magic-numbers as we migrated our preset to use the rule from typescript that supports much more clever assessments of what is and isn't magic number
@Tlacenka could you confirm this is the case please?