# 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.

Latest version **0.0.8** (published 2023-02-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-magic-variables
pnpm add eslint-plugin-magic-variables
yarn add eslint-plugin-magic-variables
bun add eslint-plugin-magic-variables
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2023-02-19 |
| First published | 2023-02-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ^12.22.0 \|\| ^14.17.0 \|\| ^16.0.0 \|\| >= 18.0.0 |
| Dependencies | 4 |
| Unpacked size | 10.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Chris Banks |
| Maintainers | chrisbanks |
| Keywords | eslint, eslintplugin, eslint-plugin, magic-numbers, magic-variables |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-magic-variables
- Repository: https://github.com/christopherbradleybanks/eslint-plugin-magic-variables
- Homepage: https://github.com/christopherbradleybanks/eslint-plugin-magic-variables#readme
- Issues: https://github.com/christopherbradleybanks/eslint-plugin-magic-variables/issues
- npm.io page: https://npm.io/package/eslint-plugin-magic-variables

## Dependencies (4)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [number-name](https://npm.io/package/number-name.md) ^0.1.5
- [requireindex](https://npm.io/package/requireindex.md) ^1.2.0
- [words-to-numbers](https://npm.io/package/words-to-numbers.md) ^1.5.1

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 0.0.8 (latest) — 2023-02-19
- 0.0.7 — 2023-02-19
- 0.0.6 — 2023-02-19
- 0.0.5 — 2023-02-19
- 0.0.4 — 2023-02-19
- 0.0.3 — 2023-02-19
- 0.0.2 — 2023-02-19
- 0.0.1 — 2023-02-17
- 0.0.0 — 2023-02-17

## README

# 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](https://eslint.org/):

```sh
npm i eslint --save-dev
```

Next, install `eslint-plugin-magic-variables`:

```sh
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:

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


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

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

## Rules

<!-- begin auto-generated rules list -->

| Name                                                   | Description                                              |
| :----------------------------------------------------- | :------------------------------------------------------- |
| [no-magic-variables](docs/rules/no-magic-variables.md) | prevent magic numbers from being used as a variable name |

<!-- end auto-generated rules list -->

---
_Source: https://npm.io/package/eslint-plugin-magic-variables · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
