Search code examples
javascripteslintranking

Is there a severity ranking for ESLint errors?


I am currently analyzing different code packages. I am using ESLint to check the code quality.

After analyzing I get an object with ESLint errors and how often they appeared.

"no-multi-assign": 1,
"no-var": 47,
...
"comma-dangle": 133,
"no-shadow": 136,

Now I have lots of errors, but can't really rate how severe the errors are. The single no-multi-assign error is certainly more severe than 133 comma-dangle errors.

Now the question is, if there is some kind of ranking that gives each ESLint error a severity ranking? Maybe somebody has an idea how to rank these errors.

Here is a list with all ESLint rules


Solution

  • ESLint rules have 0 ("off"), 1 ("warn"), or 2("error"), which roughly translates to how 'severe' the rule is.

    You can find people publishing their own eslintrc.json which you can use as a 'ranking'. An example is standard/eslint-config-standard

    But there won't be any meaningful ranking like no-console is more severe than no-empty but less severe than no-labels, since that's really subjective.