Possible Errors

Best Practices

Strict Mode

Variables

Node.js and CommonJS

Stylistic Issues

ECMAScript 6

no-magic-numbers

- Disallow magic numbers

The no-magic-numbers rule aims to make code more readable and refactoring easier by ensuring that special numbers are declared as constants to make their meaning explicit.

What ESLint should do when it catches the rule break

Show a warning

Options

detectObjects

Detects numbers when setting object properties.

enforceConst

Checks for the const keyword in variable declaration of numbers.

ignoreArrayIndexes

Ignores numbers used as array indexes.

Rule examples

You can check them out here.