0.0.20 • Published 1 year ago

eslint-plugin-turisap v0.0.20

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

eslint-plugin-turisap

A set of customized ESLint and @typescript/eslint rules

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-turisap:

npm install eslint-plugin-turisap --save-dev

Usage

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

{
    "plugins": [
        "turisap"
    ]
}

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

{
  "rules": {
    "turisap/no-magic-numbers": [
      "error",
      {
        "allowRGBa": true,
        "allowedCalls": ["setTimeout"]
      }
    ]
  }
}

Supported Rules

turisap/no-magic-numbers: the same as original ESLint rule, but allows to use a few extra settings, namely

  • rgb(a) arrays with numbers:
const rgbColor = [255, 255, 255];
const rgbaColor = [0, 0, 0, 0.5];
  • numeric function params in specified functions. For example, it is pretty obvious what the following parameter means
const id = setTimeout(fn, 300);

By the same token, it does not report the space param on JSON.stringify

const body = JSON.stringify(user, null, 2) 
0.0.20

1 year ago

0.0.17

1 year ago

0.0.18

1 year ago

0.0.16

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago