0.0.2 • Published 2 years ago
@dimensiondev/eslint-plugin v0.0.2
@dimensiondev/eslint-plugin
Installation
You'll first need to install eslint:
npm install --save-dev eslint
Next, install @dimensiondev/eslint-plugin
:
# for stable version
npm install --save-dev @dimensiondev/eslint-plugin
# for unstable version
npm install --save-dev @dimensiondev/eslint-plugin --registry=https://npm.dimension.im
Usage
Add @dimensiondev
to the plugins section of your .eslintrc
configuration file.
{
"$schema": "https://dimensiondev.github.io/eslint-plugin/src/schema.json",
"plugins": ["@dimensiondev"],
"rules": {
"@dimensiondev/ban-eslint-disable": "error",
"@dimensiondev/no-bidi-characters": "off",
"@dimensiondev/no-bigint": "off",
"@dimensiondev/no-builtin-base64": "error",
"@dimensiondev/no-default-error": "error",
"@dimensiondev/no-implicit-array-sort": "error",
"@dimensiondev/no-invisible-characters": "error",
"@dimensiondev/no-jsx-logical": "off",
"@dimensiondev/no-jsx-template-literal": "error",
"@dimensiondev/no-locale-case": "error",
"@dimensiondev/no-number-constructor": "error",
"@dimensiondev/no-redundant-variable": "error",
"@dimensiondev/no-simple-string-interpolation": "error",
"@dimensiondev/no-simple-template-literal": "error",
"@dimensiondev/no-single-return": "error",
"@dimensiondev/no-then": "error",
"@dimensiondev/no-timer": "off",
"@dimensiondev/no-top-level": "off",
"@dimensiondev/no-unneeded-flat-map": "error",
"@dimensiondev/no-unneeded-to-string": "error",
"@dimensiondev/no-unsafe-date": "error",
"@dimensiondev/prefer-default-export": "off",
"@dimensiondev/prefer-early-return": "error",
"@dimensiondev/prefer-fetch": "error",
"@dimensiondev/prefer-location-assign": "error",
"@dimensiondev/prefer-timer-id": "error",
"@dimensiondev/unicode-specific-set": "off"
}
}
Supported Rules
Key: :white_check_mark: = recommended, :wrench: = fixable, :bulb: = suggestions, :gear: = configurable, :thought_balloon: = requires type information
- ban-eslint-disable :white_check_mark: :gear:\
Ban
eslint-disable
comment directive - no-bidi-characters :wrench:\ Detect and stop Trojan Source attacks
- no-bigint :thought_balloon:\ Disallow use BigInt
- no-builtin-base64 :white_check_mark: :wrench:\ Disallow use built-in base64 function
- no-default-error :white_check_mark: :thought_balloon:\ Restrict the usage of default (unextended) error
- no-implicit-array-sort :white_check_mark: :thought_balloon:\ Enforce Array#sort provide comparator function
- no-invisible-characters :white_check_mark: :wrench:\ Disallow invisible characters
- no-jsx-logical :gear:\ Limit the complexity of JSX logic expression
- no-jsx-template-literal :white_check_mark: :wrench:\ Disallow use template-literal in JSX
- no-locale-case :white_check_mark: :wrench:\
Disallow use
.toLocale{Upper,Lower}Case()
- no-number-constructor :white_check_mark:\
Disallow use
Number
constructor - no-redundant-variable :white_check_mark: :wrench:\ Disallow redundant variable
- no-simple-string-interpolation :white_check_mark:\ Disallow simple string interpolation
- no-simple-template-literal :white_check_mark: :wrench:\ Disallow simple template-literal
- no-single-return :white_check_mark:\ Disallow single-return
- no-then :white_check_mark:\
Disallow
.then(...)
- no-timer \ Disallow use timer function
- no-top-level :gear:\ Disallow side-effect at module top-level
- no-unneeded-flat-map :white_check_mark: :wrench:\
Disallow
.flatMap((x) => x)
when simpler alternatives exist - no-unneeded-to-string :white_check_mark: :wrench: :thought_balloon:\
Disallow
.toString()
when simpler alternatives exist - no-unsafe-date :white_check_mark: :thought_balloon:\ Disallow use unsafe Date methods
- prefer-default-export :gear:\ Enforce default export location at top or bottom
- prefer-early-return :white_check_mark: :wrench: :gear:\ Prefer early returns over full-body conditional wrapping in function declarations
- prefer-fetch :white_check_mark:\ Enforce fetch
- prefer-location-assign :white_check_mark: :wrench:\ Enforce best practice with location
- prefer-timer-id :white_check_mark: :bulb:\ Enforce best practice with timer function
- unicode-specific-set :wrench: :gear:\ Limit the range of literal characters