0.0.8 • Published 1 year ago

eslint-plugin-magic-variables v0.0.8

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

eslint-plugin-magic-variables

Prevent variable names that are numeric, or are the word form of a number from being used. i.e. FIFTY_TWO is not a valid variable name.

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-magic-variables:

npm install eslint-plugin-magic-variables --save-dev

Usage

Add magic-variables to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "magic-variables"
    ]
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "magic-variables/rule-name": 2
    }
}

Rules

NameDescription
no-magic-variablesprevent magic numbers from being used as a variable name
0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

0.0.0

1 year ago