eslint-plugin
/
0.0.2-20220124044028-ac8c1ac
eslint-plugin 0.0.2-20220124044028-ac8c1ac
Install from the command line:
Learn more about npm packages
$ npm install @dimensiondev/eslint-plugin@0.0.2-20220124044028-ac8c1ac
Install via package.json:
"@dimensiondev/eslint-plugin": "0.0.2-20220124044028-ac8c1ac"
About this version
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
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/browser/prefer-event-target": "error",
"@dimensiondev/browser/prefer-keyboard-event-key": "error",
"@dimensiondev/browser/prefer-location-assign": "error",
"@dimensiondev/browser/prefer-modern-dom-apis": "error",
"@dimensiondev/jsx/no-logical": "off",
"@dimensiondev/jsx/no-template-literal": "error",
"@dimensiondev/jsx/prefer-test-id": "off",
"@dimensiondev/string/no-interpolation": "error",
"@dimensiondev/string/no-locale-case": "error",
"@dimensiondev/string/no-simple-template-literal": "error",
"@dimensiondev/string/no-unneeded-to-string": "error",
"@dimensiondev/type/no-bigint": "off",
"@dimensiondev/type/no-force-cast-via-top-type": "error",
"@dimensiondev/type/no-instanceof-wrapper": "error",
"@dimensiondev/type/no-wrapper-type-reference": "error",
"@dimensiondev/type/prefer-return-type-annotation": "error",
"@dimensiondev/unicode/no-bidi": "off",
"@dimensiondev/unicode/no-invisible": "error",
"@dimensiondev/unicode/specific-set": "off",
"@dimensiondev/ban-eslint-disable": "error",
"@dimensiondev/no-builtin-base64": "error",
"@dimensiondev/no-default-error": "error",
"@dimensiondev/no-implicit-array-sort": "error",
"@dimensiondev/no-number-constructor": "error",
"@dimensiondev/no-redundant-variable": "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-unsafe-date": "error",
"@dimensiondev/no-vue": "error",
"@dimensiondev/prefer-default-export": "off",
"@dimensiondev/prefer-early-return": "error",
"@dimensiondev/prefer-fetch": "error",
"@dimensiondev/prefer-timer-id": "error"
}
}
Key: :white_check_mark: = recommended, :wrench: = fixable, :bulb: = suggestions, :gear: = configurable, :thought_balloon: = requires type information
-
browser/prefer-event-target β
π§ π
Prefer.{add,remove}EventListener()
overon
-functions -
browser/prefer-keyboard-event-key β
π§ π
PreferKeyboardEvent#key
overKeyboardEvent#{keyCode,charCode,which}
-
browser/prefer-location-assign β
π§
Preferlocation.assign(...)
overlocation.*
-
browser/prefer-modern-dom-apis β
π§ π‘ π
Prefer Modern DOM APIs -
jsx/no-logical βοΈ
Limit the complexity of JSX logic expression -
jsx/no-template-literal β
π§
Disallow use template-literal in JSX -
jsx/prefer-test-id βοΈ
Enforcesdata-test-id
attribute is present on interactive DOM elements to help with UI testing -
string/no-interpolation β
Disallow simple string interpolation -
string/no-locale-case β
π§
Disallow use.toLocale{Upper,Lower}Case()
-
string/no-simple-template-literal β
π§
Disallow simple template-literal -
string/no-unneeded-to-string β
π§ π
Disallow.toString()
when simpler alternatives exist -
type/no-bigint π
Disallow use BigInt -
type/no-force-cast-via-top-type β
Disallowing cast a typeT
to unrelated or incompatible typeQ
viaT as any as Q
-
type/no-instanceof-wrapper β
π§
Disallowinstanceof
for wrapper objects -
type/no-wrapper-type-reference β
π§
Disallow wrapper type for type reference -
type/prefer-return-type-annotation β
π§
Enforce Move return type annotation to function return type -
unicode/no-bidi π§
Detect and stop Trojan Source attacks -
unicode/no-invisible β
π§
Disallow invisible characters -
unicode/specific-set π§ βοΈ
Limit the range of literal characters -
ban-eslint-disable β
βοΈ
Baneslint-disable
comment directive -
no-builtin-base64 β
π§
Disallow use built-in base64 function -
no-default-error β
π
Restrict the usage of default (unextended) error -
no-implicit-array-sort β
π
EnforceArray#sort
provide comparator function -
no-number-constructor β
Disallow useNumber
constructor -
no-redundant-variable β
π§
Disallow redundant variable -
no-single-return β
Disallow single-return -
no-then β
Disallow.then(...)
-
no-timer
Disallow use timer function -
no-top-level βοΈ
Disallow side-effect at module top-level -
no-unneeded-flat-map β
π§
Disallow.flatMap((x) => x)
when simpler alternatives exist -
no-unsafe-date β
π
Disallow use unsafe Date methods -
no-vue β
Disallow Vue.js in this project -
prefer-default-export βοΈ
Enforce default export location at top or bottom -
prefer-early-return β
π§ βοΈ
Prefer early returns over full-body conditional wrapping in function declarations -
prefer-fetch β
Enforce fetch -
prefer-timer-id β
π‘
Enforce best practice with timer function
Details
- eslint-plugin
- DimensionDev
- almost 3 years ago
- MIT
- 24 dependencies
Assets
- eslint-plugin-0.0.2-20220124044028-ac8c1ac-npm.tgz
Download activity
- Total downloads 0
- Last 30 days 0
- Last week 0
- Today 0