Rule: no-magic-numbers

Disallows the use constant number values outside of variable assignments. When no list of allowed values is specified, -1, 0 and 1 are allowed by default.

Rationale

Magic numbers should be avoided as they often lack documentation, forcing them to be stored in variables gives them implicit documentation.

Config

A list of allowed numbers.

Examples
"no-magic-numbers": true
"no-magic-numbers": [true, 1, 2, 3]
Schema
{
  "type": "array",
  "items": {
    "type": "number"
  },
  "minLength": 1
}