@xwtec/eslint-config
ESLint Configuration for xwtec projects
Last updated 2 months ago by fisker .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @xwtec/eslint-config 
SYNC missed versions from official npm registry.

@xwtec/eslint-config

devDependencies Issues Issues GitHub last commit GitHub Release Date

npm npm Snyk Vulnerabilities for npm package version

styled with prettier MIT license

ESLint Configuration for xwtec projects

Install

# with yarn
yarn add --dev eslint prettier @xwtec/eslint-config @xwtec/prettier-config

# with npm
npm install --save-dev eslint prettier @xwtec/eslint-config @xwtec/prettier-config

Configuration

Add following code

module.exports = {
  extends: ['@xwtec'],
};

to .eslintrc.js in your project.

You may also want config prettier with @xwtec/prettier-config.

Usage

npx eslint "**/*.js"

Rules

Error

# Type Rule Description
1 error no-caller disallow the use of arguments.caller or arguments.callee
2 error no-class-assign disallow reassigning class members
3 error no-const-assign disallow reassigning const variables
4 error no-delete-var disallow deleting variables
5 error no-dupe-args disallow duplicate arguments in function definitions
6 error no-dupe-class-members disallow duplicate class members
7 error no-dupe-else-if disallow duplicate conditions in if-else-if chains
8 error no-dupe-keys disallow duplicate keys in object literals
9 error no-empty-pattern disallow empty destructuring patterns
10 error no-eval disallow the use of eval()
11 error no-func-assign disallow reassigning function declarations
12 error no-implied-eval disallow the use of eval()-like methods
13 error no-import-assign disallow assigning to imported bindings
14 error no-irregular-whitespace disallow irregular whitespace
15 error no-new-symbol disallow new operators with the Symbol object
16 error no-obj-calls disallow calling global object properties as functions
17 error no-redeclare disallow variable redeclaration
18 error no-self-compare disallow comparisons where both sides are exactly the same
19 error no-sequences disallow comma operators
20 error no-setter-return disallow returning values from setters
21 error no-undef disallow the use of undeclared variables unless mentioned in /*global */ comments
22 error require-yield require generator functions to contain yield
23 error use-isnan require calls to isNaN() when checking for NaN

Warn

# Type Rule Description
1 warn constructor-super require super() calls in constructors
2 warn for-direction enforce "for" loop update clause moving the counter in the right direction.
3 warn getter-return enforce return statements in getters
4 warn no-case-declarations disallow lexical declarations in case clauses
5 warn no-compare-neg-zero disallow comparing against -0
6 warn no-constant-condition disallow constant expressions in conditions
7 warn no-duplicate-case disallow duplicate case labels
8 warn no-empty disallow empty block statements
9 warn no-empty-character-class disallow empty character classes in regular expressions
10 warn no-ex-assign disallow reassigning exceptions in catch clauses
11 warn no-extend-native disallow extending native types
12 warn no-fallthrough disallow fallthrough of case statements
13 warn no-global-assign disallow assignments to native objects or read-only global variables
14 warn no-inner-declarations disallow variable or function declarations in nested blocks
15 warn no-invalid-regexp disallow invalid regular expression strings in RegExp constructors
16 warn no-iterator disallow the use of the __iterator__ property
17 warn no-labels disallow labeled statements
18 warn no-multi-str disallow multiline strings
19 warn no-new-wrappers disallow new operators with the String, Number, and Boolean objects
20 warn no-octal disallow octal literals
21 warn no-octal-escape disallow octal escape sequences in string literals
22 warn no-proto disallow the use of the __proto__ property
23 warn no-restricted-properties disallow certain properties on certain objects
24 warn no-self-assign disallow assignments where both sides are exactly the same
25 warn no-sparse-arrays disallow sparse arrays
26 warn no-this-before-super disallow this/super before calling super() in constructors
27 warn no-throw-literal disallow throwing literals as exceptions
28 warn no-unmodified-loop-condition disallow unmodified loop conditions
29 warn no-unreachable disallow unreachable code after return, throw, continue, and break statements
30 warn no-unsafe-finally disallow control flow statements in finally blocks
31 warn no-unsafe-negation disallow negating the left operand of relational operators
32 warn no-unused-vars disallow unused variables
33 warn no-useless-escape disallow unnecessary escape characters
34 warn no-void disallow void operators
35 warn no-with disallow with statements
36 warn radix enforce the consistent use of the radix argument when using parseInt()
37 warn valid-typeof enforce comparing typeof expressions against valid strings

Fixable

# Type Rule Description
1 warn dot-notation enforce dot notation whenever possible
2 error eqeqeq require the use of === and !==
3 warn no-div-regex disallow division operators explicitly at the beginning of regular expressions
4 warn no-else-return disallow else blocks after return statements in if statements
5 warn no-extra-bind disallow unnecessary calls to .bind()
6 warn no-extra-boolean-cast disallow unnecessary boolean casts
7 warn no-extra-label disallow unnecessary labels
8 warn no-regex-spaces disallow multiple spaces in regular expressions
9 warn no-undef-init disallow initializing variables to undefined
10 warn no-unneeded-ternary disallow ternary operators when simpler alternatives exist
11 warn no-unused-labels disallow unused labels
12 warn no-useless-computed-key disallow unnecessary computed property keys in objects and classes
13 warn no-useless-rename disallow renaming import, export, and destructured assignments to the same name
14 warn no-useless-return disallow redundant return statements
15 warn no-var require let or const instead of var
16 warn object-shorthand require or disallow method and property shorthand syntax for object literals
17 warn one-var enforce variables to be declared either together or separately in functions
18 warn operator-assignment require or disallow assignment operator shorthand where possible
19 warn prefer-const require const declarations for variables that are never reassigned after declared
20 warn prefer-destructuring require destructuring from arrays and/or objects
21 warn prefer-exponentiation-operator disallow the use of Math.pow in favor of the ** operator
22 warn prefer-numeric-literals disallow parseInt() and Number.parseInt() in favor of binary, octal, and hexadecimal literals
23 warn prefer-object-spread disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead.
24 warn prefer-template require template literals instead of string concatenation
25 warn spaced-comment enforce consistent spacing after the // or /* in a comment
26 warn yoda require or disallow "Yoda" conditions
27 warn prettier/prettier

Related

Links

Current Tags

  • 6.3.1                                ...           latest (2 months ago)

116 Versions

  • 6.3.1                                ...           2 months ago
  • 6.3.0                                ...           4 months ago
  • 6.2.0                                ...           5 months ago
  • 6.1.2                                ...           6 months ago
  • 6.1.1                                ...           8 months ago
  • 6.1.0                                ...           8 months ago
  • 6.0.21                                ...           8 months ago
  • 6.0.20                                ...           9 months ago
  • 6.0.19                                ...           9 months ago
  • 6.0.18                                ...           a year ago
  • 6.0.17                                ...           a year ago
  • 6.0.16                                ...           a year ago
  • 6.0.15                                ...           a year ago
  • 6.0.14                                ...           a year ago
  • 6.0.13                                ...           a year ago
  • 6.0.12                                ...           a year ago
  • 6.0.11                                ...           a year ago
  • 6.0.10                                ...           a year ago
  • 6.0.9                                ...           a year ago
  • 6.0.8                                ...           a year ago
  • 6.0.7                                ...           a year ago
  • 6.0.6                                ...           a year ago
  • 6.0.5                                ...           a year ago
  • 6.0.4                                ...           a year ago
  • 6.0.3                                ...           a year ago
  • 6.0.2                                ...           a year ago
  • 6.0.1                                ...           a year ago
  • 6.0.0                                ...           a year ago
  • 5.0.5                                ...           a year ago
  • 5.0.4                                ...           a year ago
  • 5.0.3                                ...           a year ago
  • 5.0.2                                ...           a year ago
  • 4.1.3                                ...           a year ago
  • 4.1.2                                ...           a year ago
  • 5.0.1                                ...           a year ago
  • 5.0.0                                ...           a year ago
  • 4.1.1                                ...           a year ago
  • 4.1.0                                ...           a year ago
  • 4.0.2                                ...           a year ago
  • 4.0.1                                ...           a year ago
  • 4.0.0                                ...           a year ago
  • 3.9.4                                ...           a year ago
  • 3.9.3                                ...           a year ago
  • 3.9.2                                ...           a year ago
  • 3.9.1                                ...           a year ago
  • 3.9.0                                ...           a year ago
  • 3.8.1                                ...           a year ago
  • 3.8.0                                ...           a year ago
  • 3.7.0                                ...           a year ago
  • 3.6.0                                ...           a year ago
  • 3.5.13                                ...           a year ago
  • 3.5.12                                ...           a year ago
  • 3.5.11                                ...           a year ago
  • 3.5.10                                ...           a year ago
  • 3.5.9                                ...           a year ago
  • 3.5.8                                ...           a year ago
  • 3.5.7                                ...           a year ago
  • 3.5.6                                ...           a year ago
  • 3.5.5                                ...           a year ago
  • 3.5.4                                ...           a year ago
  • 3.5.3                                ...           a year ago
  • 3.5.2                                ...           a year ago
  • 3.5.1                                ...           a year ago
  • 3.5.0                                ...           a year ago
  • 3.4.4                                ...           a year ago
  • 3.4.3                                ...           a year ago
  • 3.4.2                                ...           a year ago
  • 3.4.1                                ...           a year ago
  • 3.4.0                                ...           a year ago
  • 3.3.1                                ...           2 years ago
  • 3.3.0                                ...           2 years ago
  • 3.2.1                                ...           2 years ago
  • 3.2.0                                ...           2 years ago
  • 3.1.2                                ...           2 years ago
  • 3.1.1                                ...           2 years ago
  • 3.1.0                                ...           2 years ago
  • 3.0.5                                ...           2 years ago
  • 3.0.4                                ...           2 years ago
  • 3.0.3                                ...           2 years ago
  • 3.0.1                                ...           2 years ago
  • 3.0.0                                ...           2 years ago
  • 2.5.4                                ...           2 years ago
  • 2.5.3                                ...           2 years ago
  • 2.5.2                                ...           2 years ago
  • 2.5.1                                ...           2 years ago
  • 2.5.0                                ...           2 years ago
  • 2.4.1                                ...           2 years ago
  • 2.4.0                                ...           2 years ago
  • 2.3.0                                ...           2 years ago
  • 2.2.0                                ...           2 years ago
  • 2.1.2                                ...           2 years ago
  • 2.1.1                                ...           2 years ago
  • 2.1.0                                ...           2 years ago
  • 2.0.3                                ...           2 years ago
  • 2.0.2                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.18                                ...           2 years ago
  • 1.0.17                                ...           2 years ago
  • 1.0.16                                ...           2 years ago
  • 1.0.15                                ...           2 years ago
  • 1.0.14                                ...           2 years ago
  • 1.0.13                                ...           2 years ago
  • 1.0.12                                ...           2 years ago
  • 1.0.11                                ...           2 years ago
  • 1.0.9                                ...           2 years ago
  • 1.0.8                                ...           2 years ago
  • 1.0.7                                ...           2 years ago
  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 125
This Month 133
Last Day 0
Last Week 8
Last Month 376
Dependencies (3)

Copyright 2014 - 2016 © taobao.org |