9.0.1 • Published 10 months ago

@xwtec/eslint-config v9.0.1

Weekly downloads
165
License
MIT
Repository
github
Last release
10 months ago

@xwtec/eslint-config

ESLint Configuration for xwtec projects

Install

yarn add --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

#TypeRuleDescription
1errorno-callerDisallow the use of arguments.caller or arguments.callee
2errorno-class-assignDisallow reassigning class members
3errorno-const-assignDisallow reassigning const variables
4errorno-delete-varDisallow deleting variables
5errorno-dupe-argsDisallow duplicate arguments in function definitions
6errorno-dupe-class-membersDisallow duplicate class members
7errorno-dupe-else-ifDisallow duplicate conditions in if-else-if chains
8errorno-dupe-keysDisallow duplicate keys in object literals
9errorno-empty-patternDisallow empty destructuring patterns
10errorno-evalDisallow the use of eval()
11errorno-func-assignDisallow reassigning function declarations
12errorno-implied-evalDisallow the use of eval()-like methods
13errorno-import-assignDisallow assigning to imported bindings
14errorno-irregular-whitespaceDisallow irregular whitespace
15errorno-new-symbolDisallow new operators with the Symbol object
16errorno-obj-callsDisallow calling global object properties as functions
17errorno-redeclareDisallow variable redeclaration
18errorno-restricted-globalsDisallow specified global variables
19errorno-self-compareDisallow comparisons where both sides are exactly the same
20errorno-sequencesDisallow comma operators
21errorno-setter-returnDisallow returning values from setters
22errorno-undefDisallow the use of undeclared variables unless mentioned in /*global */ comments
23errorno-unused-expressionsDisallow unused expressions
24errorradixEnforce the consistent use of the radix argument when using parseInt()
25errorrequire-yieldRequire generator functions to contain yield
26erroruse-isnanRequire calls to isNaN() when checking for NaN
27errorregexp/no-legacy-featuresdisallow legacy RegExp features

Warn

#TypeRuleDescription
1warnconstructor-superRequire super() calls in constructors
2warndefault-case-lastEnforce default clauses in switch statements to be last
3warnfor-directionEnforce "for" loop update clause moving the counter in the right direction
4warngetter-returnEnforce return statements in getters
5warnno-case-declarationsDisallow lexical declarations in case clauses
6warnno-compare-neg-zeroDisallow comparing against -0
7warnno-constant-conditionDisallow constant expressions in conditions
8warnno-duplicate-caseDisallow duplicate case labels
9warnno-emptyDisallow empty block statements
10warnno-empty-character-classDisallow empty character classes in regular expressions
11warnno-ex-assignDisallow reassigning exceptions in catch clauses
12warnno-extend-nativeDisallow extending native types
13warnno-fallthroughDisallow fallthrough of case statements
14warnno-global-assignDisallow assignments to native objects or read-only global variables
15warnno-inner-declarationsDisallow variable or function declarations in nested blocks
16warnno-invalid-regexpDisallow invalid regular expression strings in RegExp constructors
17warnno-iteratorDisallow the use of the __iterator__ property
18warnno-labelsDisallow labeled statements
19warnno-multi-strDisallow multiline strings
20warnno-new-wrappersDisallow new operators with the String, Number, and Boolean objects
21warnno-octalDisallow octal literals
22warnno-octal-escapeDisallow octal escape sequences in string literals
23warnno-protoDisallow the use of the __proto__ property
24warnno-restricted-propertiesDisallow certain properties on certain objects
25warnno-self-assignDisallow assignments where both sides are exactly the same
26warnno-sparse-arraysDisallow sparse arrays
27warnno-this-before-superDisallow this/super before calling super() in constructors
28warnno-throw-literalDisallow throwing literals as exceptions
29warnno-unmodified-loop-conditionDisallow unmodified loop conditions
30warnno-unreachableDisallow unreachable code after return, throw, continue, and break statements
31warnno-unsafe-finallyDisallow control flow statements in finally blocks
32warnno-unsafe-negationDisallow negating the left operand of relational operators
33warnno-unsafe-optional-chainingDisallow use of optional chaining in contexts where the undefined value is not allowed
34warnno-unused-varsDisallow unused variables
35warnno-useless-escapeDisallow unnecessary escape characters
36warnno-voidDisallow void operators
37warnno-withDisallow with statements
38warnvalid-typeofEnforce comparing typeof expressions against valid strings
39warnimport/extensionsEnsure consistent use of file extension within the import path.

Fixable

#TypeRuleDescription
1warncurlyEnforce consistent brace style for all control statements
2warndot-notationEnforce dot notation whenever possible
3erroreqeqeqRequire the use of === and !==
4warnno-div-regexDisallow equal signs explicitly at the beginning of regular expressions
5warnno-else-returnDisallow else blocks after return statements in if statements
6warnno-extra-bindDisallow unnecessary calls to .bind()
7warnno-extra-boolean-castDisallow unnecessary boolean casts
8warnno-extra-labelDisallow unnecessary labels
9warnno-regex-spacesDisallow multiple spaces in regular expressions
10warnno-undef-initDisallow initializing variables to undefined
11warnno-unneeded-ternaryDisallow ternary operators when simpler alternatives exist
12warnno-unused-labelsDisallow unused labels
13warnno-useless-computed-keyDisallow unnecessary computed property keys in objects and classes
14warnno-useless-renameDisallow renaming import, export, and destructured assignments to the same name
15warnno-useless-returnDisallow redundant return statements
16warnno-varRequire let or const instead of var
17warnobject-shorthandRequire or disallow method and property shorthand syntax for object literals
18warnone-varEnforce variables to be declared either together or separately in functions
19warnoperator-assignmentRequire or disallow assignment operator shorthand where possible
20warnprefer-constRequire const declarations for variables that are never reassigned after declared
21warnprefer-destructuringRequire destructuring from arrays and/or objects
22warnprefer-exponentiation-operatorDisallow the use of Math.pow in favor of the ** operator
23warnprefer-numeric-literalsDisallow parseInt() and Number.parseInt() in favor of binary, octal, and hexadecimal literals
24warnprefer-object-spreadDisallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead
25warnprefer-templateRequire template literals instead of string concatenation
26warnspaced-commentEnforce consistent spacing after the // or /* in a comment
27warnyodaRequire or disallow "Yoda" conditions
28warnimport/newline-after-importEnforce a newline after import statements.
29warnimport/orderEnforce a convention in module import order.

Related

Links

8.6.0

10 months ago

9.0.1

10 months ago

9.0.0

10 months ago

8.2.1

2 years ago

8.2.0

2 years ago

8.4.0

2 years ago

8.3.0

2 years ago

8.5.0

2 years ago

8.1.2

2 years ago

8.1.1

2 years ago

8.1.3

2 years ago

8.1.0

3 years ago

8.0.0

3 years ago

7.4.0

3 years ago

7.5.0

3 years ago

7.3.1

3 years ago

7.3.0

3 years ago

7.2.0

3 years ago

7.1.1

3 years ago

7.1.0

3 years ago

7.0.4

3 years ago

7.0.3

3 years ago

7.0.2

3 years ago

7.0.0

3 years ago

7.0.1

3 years ago

6.4.2

3 years ago

6.4.1

3 years ago

6.4.0

4 years ago

6.3.2

4 years ago

6.3.1

4 years ago

6.3.0

4 years ago

6.2.0

4 years ago

6.1.2

4 years ago

6.1.1

4 years ago

6.1.0

4 years ago

6.0.21

4 years ago

6.0.20

4 years ago

6.0.19

4 years ago

6.0.18

5 years ago

6.0.17

5 years ago

6.0.16

5 years ago

6.0.15

5 years ago

6.0.14

5 years ago

6.0.13

5 years ago

6.0.12

5 years ago

6.0.11

5 years ago

6.0.10

5 years ago

6.0.9

5 years ago

6.0.8

5 years ago

6.0.7

5 years ago

6.0.6

5 years ago

6.0.5

5 years ago

6.0.4

5 years ago

6.0.3

5 years ago

6.0.2

5 years ago

6.0.1

5 years ago

6.0.0

5 years ago

5.0.5

5 years ago

5.0.4

5 years ago

5.0.3

5 years ago

5.0.2

5 years ago

4.1.3

5 years ago

4.1.2

5 years ago

5.0.1

5 years ago

5.0.0

5 years ago

4.1.1

5 years ago

4.1.0

5 years ago

4.0.2

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago

3.9.4

5 years ago

3.9.3

5 years ago

3.9.2

5 years ago

3.9.1

5 years ago

3.9.0

5 years ago

3.8.1

5 years ago

3.8.0

5 years ago

3.7.0

5 years ago

3.6.0

5 years ago

3.5.13

5 years ago

3.5.12

5 years ago

3.5.11

5 years ago

3.5.10

5 years ago

3.5.9

5 years ago

3.5.8

5 years ago

3.5.7

5 years ago

3.5.6

5 years ago

3.5.5

5 years ago

3.5.4

5 years ago

3.5.3

5 years ago

3.5.2

5 years ago

3.5.1

5 years ago

3.5.0

5 years ago

3.4.4

5 years ago

3.4.3

5 years ago

3.4.2

5 years ago

3.4.1

5 years ago

3.4.0

5 years ago

3.3.1

5 years ago

3.3.0

5 years ago

3.2.1

5 years ago

3.2.0

5 years ago

3.1.2

5 years ago

3.1.1

5 years ago

3.1.0

5 years ago

3.0.5

5 years ago

3.0.4

5 years ago

3.0.3

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.5.4

5 years ago

2.5.3

5 years ago

2.5.2

5 years ago

2.5.1

5 years ago

2.5.0

5 years ago

2.4.1

5 years ago

2.4.0

5 years ago

2.3.0

5 years ago

2.2.0

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.1.0

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago