11.0.3 • Published 10 months ago

@xwtec/eslint-config v11.0.3

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 @xwtec/eslint-config

Configuration

Add the following code to your eslint.config.mjs.

import xwtecEslintConfig from '@xwtec/eslint-config';

export default [
  xwtecEslintConfig,
  {
    rules: {
      'unicorn/no-array-for-each': 'error',
    },
  },
].flat();

Usage

npx eslint

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

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
27warnunicode-bomRequire or disallow Unicode byte order mark (BOM)
28warnyodaRequire or disallow "Yoda" conditions
29warnsimple-import-sort/exports-
30warnsimple-import-sort/imports-

Related

Links

11.0.3

10 months ago

10.0.0

1 year ago

10.0.1

1 year ago

11.0.2

1 year ago

11.0.0

1 year ago

11.0.1

1 year ago

8.6.0

2 years ago

9.0.1

2 years ago

9.0.0

2 years ago

8.2.1

3 years ago

8.2.0

3 years ago

8.4.0

3 years ago

8.3.0

3 years ago

8.5.0

3 years ago

8.1.2

4 years ago

8.1.1

4 years ago

8.1.3

4 years ago

8.1.0

4 years ago

8.0.0

4 years ago

7.4.0

4 years ago

7.5.0

4 years ago

7.3.1

4 years ago

7.3.0

4 years ago

7.2.0

4 years ago

7.1.1

4 years ago

7.1.0

4 years ago

7.0.4

4 years ago

7.0.3

4 years ago

7.0.2

4 years ago

7.0.0

4 years ago

7.0.1

4 years ago

6.4.2

4 years ago

6.4.1

4 years ago

6.4.0

5 years ago

6.3.2

5 years ago

6.3.1

5 years ago

6.3.0

5 years ago

6.2.0

5 years ago

6.1.2

5 years ago

6.1.1

6 years ago

6.1.0

6 years ago

6.0.21

6 years ago

6.0.20

6 years ago

6.0.19

6 years ago

6.0.18

6 years ago

6.0.17

6 years ago

6.0.16

6 years ago

6.0.15

6 years ago

6.0.14

6 years ago

6.0.13

6 years ago

6.0.12

6 years ago

6.0.11

6 years ago

6.0.10

6 years ago

6.0.9

6 years ago

6.0.8

6 years ago

6.0.7

6 years ago

6.0.6

6 years ago

6.0.5

6 years ago

6.0.4

6 years ago

6.0.3

6 years ago

6.0.2

6 years ago

6.0.1

6 years ago

6.0.0

6 years ago

5.0.5

6 years ago

5.0.4

6 years ago

5.0.3

6 years ago

5.0.2

6 years ago

4.1.3

6 years ago

4.1.2

6 years ago

5.0.1

6 years ago

5.0.0

6 years ago

4.1.1

6 years ago

4.1.0

6 years ago

4.0.2

6 years ago

4.0.1

6 years ago

4.0.0

6 years ago

3.9.4

6 years ago

3.9.3

6 years ago

3.9.2

6 years ago

3.9.1

6 years ago

3.9.0

6 years ago

3.8.1

6 years ago

3.8.0

6 years ago

3.7.0

6 years ago

3.6.0

6 years ago

3.5.13

6 years ago

3.5.12

6 years ago

3.5.11

6 years ago

3.5.10

6 years ago

3.5.9

6 years ago

3.5.8

6 years ago

3.5.7

6 years ago

3.5.6

6 years ago

3.5.5

6 years ago

3.5.4

6 years ago

3.5.3

6 years ago

3.5.2

6 years ago

3.5.1

6 years ago

3.5.0

6 years ago

3.4.4

6 years ago

3.4.3

6 years ago

3.4.2

6 years ago

3.4.1

6 years ago

3.4.0

6 years ago

3.3.1

6 years ago

3.3.0

6 years ago

3.2.1

6 years ago

3.2.0

6 years ago

3.1.2

6 years ago

3.1.1

6 years ago

3.1.0

6 years ago

3.0.5

6 years ago

3.0.4

6 years ago

3.0.3

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.5.4

6 years ago

2.5.3

6 years ago

2.5.2

6 years ago

2.5.1

6 years ago

2.5.0

6 years ago

2.4.1

6 years ago

2.4.0

6 years ago

2.3.0

6 years ago

2.2.0

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.1.0

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago