@neolution-ch/eslint-config-neolution 1.3.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -28
- package/dist/configs/cypress.d.ts +4 -0
- package/dist/configs/cypress.d.ts.map +1 -0
- package/dist/configs/cypress.js +16 -0
- package/dist/configs/cypress.js.map +1 -0
- package/dist/configs/get-config.d.ts +10 -0
- package/dist/configs/get-config.d.ts.map +1 -0
- package/dist/configs/get-config.js +88 -0
- package/dist/configs/get-config.js.map +1 -0
- package/dist/configs/javascript.d.ts +4 -0
- package/dist/configs/javascript.d.ts.map +1 -0
- package/dist/configs/javascript.js +15 -0
- package/dist/configs/javascript.js.map +1 -0
- package/dist/configs/nextjs.d.ts +4 -0
- package/dist/configs/nextjs.d.ts.map +1 -0
- package/dist/configs/nextjs.js +16 -0
- package/dist/configs/nextjs.js.map +1 -0
- package/dist/configs/providers/default.d.ts +105 -0
- package/dist/configs/providers/default.d.ts.map +1 -0
- package/dist/configs/providers/default.js +41 -0
- package/dist/configs/providers/default.js.map +1 -0
- package/dist/configs/providers/eslint.d.ts +3 -0
- package/dist/configs/providers/eslint.d.ts.map +1 -0
- package/dist/configs/providers/eslint.js +18 -0
- package/dist/configs/providers/eslint.js.map +1 -0
- package/dist/configs/providers/importPlugin.d.ts +3 -0
- package/dist/configs/providers/importPlugin.d.ts.map +1 -0
- package/dist/configs/providers/importPlugin.js +4 -0
- package/dist/configs/providers/importPlugin.js.map +1 -0
- package/dist/configs/providers/jsdoc.d.ts +5 -0
- package/dist/configs/providers/jsdoc.d.ts.map +1 -0
- package/dist/configs/providers/jsdoc.js +49 -0
- package/dist/configs/providers/jsdoc.js.map +1 -0
- package/dist/configs/providers/next.d.ts +3 -0
- package/dist/configs/providers/next.d.ts.map +1 -0
- package/dist/configs/providers/next.js +6 -0
- package/dist/configs/providers/next.js.map +1 -0
- package/dist/configs/providers/react.d.ts +4 -0
- package/dist/configs/providers/react.d.ts.map +1 -0
- package/dist/configs/providers/react.js +28 -0
- package/dist/configs/providers/react.js.map +1 -0
- package/dist/configs/providers/reactHooks.d.ts +3 -0
- package/dist/configs/providers/reactHooks.d.ts.map +1 -0
- package/dist/configs/providers/reactHooks.js +10 -0
- package/dist/configs/providers/reactHooks.js.map +1 -0
- package/dist/configs/providers/typescript.d.ts +3 -0
- package/dist/configs/providers/typescript.d.ts.map +1 -0
- package/dist/configs/providers/typescript.js +37 -0
- package/dist/configs/providers/typescript.js.map +1 -0
- package/dist/configs/providers/unicorn.d.ts +3 -0
- package/dist/configs/providers/unicorn.d.ts.map +1 -0
- package/dist/configs/providers/unicorn.js +32 -0
- package/dist/configs/providers/unicorn.js.map +1 -0
- package/dist/configs/react-library.d.ts +4 -0
- package/dist/configs/react-library.d.ts.map +1 -0
- package/dist/configs/react-library.js +15 -0
- package/dist/configs/react-library.js.map +1 -0
- package/dist/configs/typescript.d.ts +4 -0
- package/dist/configs/typescript.d.ts.map +1 -0
- package/dist/configs/typescript.js +12 -0
- package/dist/configs/typescript.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/types/configuration-type.d.ts +74 -0
- package/dist/types/configuration-type.d.ts.map +1 -0
- package/dist/types/configuration-type.js +2 -0
- package/dist/types/configuration-type.js.map +1 -0
- package/package.json +47 -20
- package/.editorconfig +0 -58
- package/.eslintrc.js +0 -17
- package/.github/workflows/ci.yml +0 -46
- package/.github/workflows/create-release.yml +0 -51
- package/.github/workflows/prepare-release.yml +0 -66
- package/CHANGELOG.md +0 -52
- package/index.js +0 -11
- package/rules/eslint.js +0 -75
- package/rules/import.js +0 -36
- package/rules/jsdoc.js +0 -25
- package/rules/next.js +0 -17
- package/rules/react-hooks.js +0 -10
- package/rules/react.js +0 -32
- package/rules/typescript.js +0 -214
package/CHANGELOG.md
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
## [Unreleased]
|
|
9
|
-
|
|
10
|
-
## [1.3.0] - 2022-12-13
|
|
11
|
-
|
|
12
|
-
### Changed
|
|
13
|
-
|
|
14
|
-
- Disabled "@typescript-eslint/non-nullable-type-assertion-style" rule
|
|
15
|
-
|
|
16
|
-
## [1.2.0] - 2022-10-27
|
|
17
|
-
|
|
18
|
-
### Added
|
|
19
|
-
|
|
20
|
-
- Added typescript to the import/resolver
|
|
21
|
-
- Added deprecated React types to the "ban-types" rule
|
|
22
|
-
- Added "complexity" rule with a maximum of 20
|
|
23
|
-
- Added "max-lines" rule with a maximum of 300 lines
|
|
24
|
-
|
|
25
|
-
### Changed
|
|
26
|
-
|
|
27
|
-
- Updated "no-empty-function" rule to not allow any empty function
|
|
28
|
-
- Updated "quotes" rule by using the typescript version
|
|
29
|
-
- Updated "react/no-unstable-nested-components" rule to allow component creation inside component props
|
|
30
|
-
|
|
31
|
-
## [1.1.0] - 2022-10-17
|
|
32
|
-
|
|
33
|
-
### Added
|
|
34
|
-
|
|
35
|
-
- Added MIT license
|
|
36
|
-
- Enable react-hooks rules
|
|
37
|
-
|
|
38
|
-
## [1.0.0] - 2022-10-06
|
|
39
|
-
|
|
40
|
-
### Added
|
|
41
|
-
|
|
42
|
-
- Initial release
|
|
43
|
-
|
|
44
|
-
[Unreleased]: https://github.com/neolution-ch/eslint-config-neolution/compare/1.3.0...HEAD
|
|
45
|
-
|
|
46
|
-
[1.3.0]: https://github.com/neolution-ch/eslint-config-neolution/compare/1.2.0...1.3.0
|
|
47
|
-
|
|
48
|
-
[1.2.0]: https://github.com/neolution-ch/eslint-config-neolution/compare/1.1.0...1.2.0
|
|
49
|
-
|
|
50
|
-
[1.1.0]: https://github.com/neolution-ch/eslint-config-neolution/compare/1.0.0...1.1.0
|
|
51
|
-
|
|
52
|
-
[1.0.0]: https://github.com/neolution-ch/eslint-config-neolution/compare/5f308ef87fa2a779e56cb6af4510baf6e2deeb23...1.0.0
|
package/index.js
DELETED
package/rules/eslint.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: [
|
|
3
|
-
"eslint-config-airbnb",
|
|
4
|
-
].map(require.resolve),
|
|
5
|
-
|
|
6
|
-
// View link below for eslint rules documentation
|
|
7
|
-
// https://eslint.org/docs/rules/
|
|
8
|
-
rules: {
|
|
9
|
-
// The airbnb config enforce that class methods use "this", but requires changing how you call the method
|
|
10
|
-
// https://eslint.org/docs/rules/class-methods-use-this
|
|
11
|
-
"class-methods-use-this": "off",
|
|
12
|
-
|
|
13
|
-
// The airbnb config disables the complexity, but we want to limit it
|
|
14
|
-
// https://eslint.org/docs/rules/complexity
|
|
15
|
-
complexity: ["error", 20],
|
|
16
|
-
|
|
17
|
-
// The airbnb config enforces consistent return, but we got problems with some external libraries, TypeScript enforces this anyway
|
|
18
|
-
// https://eslint.org/docs/rules/consistent-return
|
|
19
|
-
"consistent-return": "off",
|
|
20
|
-
|
|
21
|
-
// The airbnb config forces unix style, but somebody also works on windows
|
|
22
|
-
// https://eslint.org/docs/rules/linebreak-style
|
|
23
|
-
"linebreak-style": "off",
|
|
24
|
-
|
|
25
|
-
// The airbnb config limits to 100 ignoring some lines, instad we allow 160 but don't ignore lines
|
|
26
|
-
// https://eslint.org/docs/rules/max-len
|
|
27
|
-
"max-len": ["error", 160, 2, {
|
|
28
|
-
ignoreComments: false,
|
|
29
|
-
ignoreTrailingComments: false,
|
|
30
|
-
ignoreUrls: false,
|
|
31
|
-
ignoreStrings: false,
|
|
32
|
-
ignoreTemplateLiterals: false,
|
|
33
|
-
ignoreRegExpLiterals: false,
|
|
34
|
-
}],
|
|
35
|
-
|
|
36
|
-
// The airbnb disables the max lines, but we want to limit it
|
|
37
|
-
// https://eslint.org/docs/rules/max-lines
|
|
38
|
-
"max-lines": ["error", {
|
|
39
|
-
max: 300,
|
|
40
|
-
skipBlankLines: true,
|
|
41
|
-
skipComments: true
|
|
42
|
-
}],
|
|
43
|
-
|
|
44
|
-
// The airbnb config disallow await inside of loops, but it cannot always be avoided
|
|
45
|
-
// https://eslint.org/docs/rules/no-await-in-loop
|
|
46
|
-
"no-await-in-loop": "off",
|
|
47
|
-
|
|
48
|
-
// The airbnb config disallow use of the continue statement, but it's ok to have it
|
|
49
|
-
// https://eslint.org/docs/rules/no-continue
|
|
50
|
-
"no-continue": "off",
|
|
51
|
-
|
|
52
|
-
// The airbnb config disallow use of unary operators (++ and --), but it's ok to have them
|
|
53
|
-
// https://eslint.org/docs/rules/no-plusplus
|
|
54
|
-
"no-plusplus": "off",
|
|
55
|
-
|
|
56
|
-
// The airbnb config also restrict ForOfStatement, but we want to use it
|
|
57
|
-
// https://eslint.org/docs/rules/no-restricted-syntax
|
|
58
|
-
"no-restricted-syntax": [
|
|
59
|
-
"error",
|
|
60
|
-
{
|
|
61
|
-
selector: "ForInStatement",
|
|
62
|
-
message: "for..in loops iterate over the entire prototype chain, which is virtually never what you want. "
|
|
63
|
-
+"Use Object.{keys,values,entries}, and iterate over the resulting array.",
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
selector: "LabeledStatement",
|
|
67
|
-
message: "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.",
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
selector: "WithStatement",
|
|
71
|
-
message: "`with` is disallowed in strict mode because it makes code impossible to predict and optimize.",
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
},
|
|
75
|
-
};
|
package/rules/import.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: [
|
|
3
|
-
"plugin:import/recommended"
|
|
4
|
-
],
|
|
5
|
-
|
|
6
|
-
plugins: [
|
|
7
|
-
"import",
|
|
8
|
-
],
|
|
9
|
-
|
|
10
|
-
settings: {
|
|
11
|
-
"import/resolver": {
|
|
12
|
-
node: {
|
|
13
|
-
extensions: [".js", ".jsx", ".ts", ".tsx"],
|
|
14
|
-
},
|
|
15
|
-
typescript: {
|
|
16
|
-
alwaysTryTypes: true,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
// View link below for import rules documentation
|
|
22
|
-
// https://github.com/import-js/eslint-plugin-import/tree/main/docs/rules
|
|
23
|
-
rules: {
|
|
24
|
-
// same as airbnb but with ts/tsx extensions
|
|
25
|
-
"import/extensions": [
|
|
26
|
-
"error",
|
|
27
|
-
"ignorePackages",
|
|
28
|
-
{
|
|
29
|
-
js: "never",
|
|
30
|
-
jsx: "never",
|
|
31
|
-
ts: "never",
|
|
32
|
-
tsx: "never"
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
},
|
|
36
|
-
};
|
package/rules/jsdoc.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: [
|
|
3
|
-
"plugin:jsdoc/recommended"
|
|
4
|
-
],
|
|
5
|
-
|
|
6
|
-
plugins: [
|
|
7
|
-
"jsdoc"
|
|
8
|
-
],
|
|
9
|
-
|
|
10
|
-
// View link below for jsdoc rules documentation
|
|
11
|
-
// https://github.com/gajus/eslint-plugin-jsdoc#user-content-eslint-plugin-jsdoc-rules
|
|
12
|
-
rules: {
|
|
13
|
-
// Do not enforce the empty line after the description block
|
|
14
|
-
// https://github.com/gajus/eslint-plugin-jsdoc#newline-after-description
|
|
15
|
-
"jsdoc/newline-after-description": "off",
|
|
16
|
-
|
|
17
|
-
// Do not require that each @param tag has a type value
|
|
18
|
-
// https://github.com/gajus/eslint-plugin-jsdoc#require-param-type
|
|
19
|
-
"jsdoc/require-param-type": "off",
|
|
20
|
-
|
|
21
|
-
// Do not require that @returns tag has a type value
|
|
22
|
-
// https://github.com/gajus/eslint-plugin-jsdoc#require-returns-type
|
|
23
|
-
"jsdoc/require-returns-type": "off"
|
|
24
|
-
}
|
|
25
|
-
};
|
package/rules/next.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: [
|
|
3
|
-
"plugin:@next/next/recommended"
|
|
4
|
-
],
|
|
5
|
-
|
|
6
|
-
plugins: [
|
|
7
|
-
"@next/next",
|
|
8
|
-
],
|
|
9
|
-
|
|
10
|
-
// View link below for next.js rules documentation
|
|
11
|
-
// https://nextjs.org/docs/basic-features/eslint#eslint-plugin
|
|
12
|
-
rules: {
|
|
13
|
-
// Disable because of this bug: https://github.com/vercel/next.js/issues/24421
|
|
14
|
-
// https://nextjs.org/docs/messages/no-img-element
|
|
15
|
-
"@next/next/no-img-element": "off",
|
|
16
|
-
},
|
|
17
|
-
};
|
package/rules/react-hooks.js
DELETED
package/rules/react.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
// View link below for react rules documentation
|
|
3
|
-
// https://github.com/jsx-eslint/eslint-plugin-react#list-of-supported-rules
|
|
4
|
-
rules: {
|
|
5
|
-
// The airbnb config forces the destructuring, but it's not always desirable
|
|
6
|
-
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/destructuring-assignment.md
|
|
7
|
-
"react/destructuring-assignment": "off",
|
|
8
|
-
|
|
9
|
-
// The airbnb config forces function-expressions, but we prefer arrow-functions
|
|
10
|
-
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md
|
|
11
|
-
"react/function-component-definition": ["error", {
|
|
12
|
-
namedComponents: "arrow-function",
|
|
13
|
-
unnamedComponents: "arrow-function",
|
|
14
|
-
}],
|
|
15
|
-
|
|
16
|
-
// The airbnb config forces only .jsx, but we support also .tsx
|
|
17
|
-
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
|
|
18
|
-
"react/jsx-filename-extension": ["error", { extensions: [".jsx", ".tsx"] }],
|
|
19
|
-
|
|
20
|
-
// The airbnb config forces one expression per line, but it's not always desirable
|
|
21
|
-
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-one-expression-per-line.md
|
|
22
|
-
"react/jsx-one-expression-per-line": "off",
|
|
23
|
-
|
|
24
|
-
// The airbnb config didn't allow component creation inside component props, but we want to allow it
|
|
25
|
-
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md
|
|
26
|
-
"react/no-unstable-nested-components": ["error", { allowAsProps: true }],
|
|
27
|
-
|
|
28
|
-
// The airbnb config forces a defaultProps definition for every prop, but we don't want it
|
|
29
|
-
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/require-default-props.md
|
|
30
|
-
"react/require-default-props": "off",
|
|
31
|
-
},
|
|
32
|
-
};
|
package/rules/typescript.js
DELETED
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: [
|
|
3
|
-
"plugin:@typescript-eslint/all"
|
|
4
|
-
],
|
|
5
|
-
|
|
6
|
-
plugins: [
|
|
7
|
-
"@typescript-eslint"
|
|
8
|
-
],
|
|
9
|
-
|
|
10
|
-
parser: "@typescript-eslint/parser",
|
|
11
|
-
|
|
12
|
-
parserOptions: {
|
|
13
|
-
project: "tsconfig.json"
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
// View link below for typescript rules documentation
|
|
17
|
-
// https://typescript-eslint.io/rules/
|
|
18
|
-
rules: {
|
|
19
|
-
// Disallow certain types
|
|
20
|
-
// https://typescript-eslint.io/rules/ban-types/
|
|
21
|
-
"@typescript-eslint/ban-types": ["error",{
|
|
22
|
-
types: {
|
|
23
|
-
"React.StatelessComponent": { message: "Deprecated: Do not use.", fixWith: "React.ReactElement" },
|
|
24
|
-
StatelessComponent: { message: "Deprecated: Do not use.", fixWith: "ReactElement" },
|
|
25
|
-
"React.FC": { message: "Please use ReactElement + PropsWithChildren", fixWith: "ReactElement" },
|
|
26
|
-
FC: { message: "Please use ReactElement + PropsWithChildren", fixWith: "ReactElement" },
|
|
27
|
-
},
|
|
28
|
-
extendDefaults: true,
|
|
29
|
-
}],
|
|
30
|
-
|
|
31
|
-
// Enforce one true brace style (same as eslint-config-airbnb-base)
|
|
32
|
-
// https://typescript-eslint.io/rules/brace-style
|
|
33
|
-
"@typescript-eslint/brace-style": ["error", "1tbs", { allowSingleLine: true }],
|
|
34
|
-
|
|
35
|
-
// Require trailing commas in multiline object literals (same as eslint-config-airbnb-base)
|
|
36
|
-
// https://typescript-eslint.io/rules/comma-dangle
|
|
37
|
-
"@typescript-eslint/comma-dangle": ["error", "always-multiline"],
|
|
38
|
-
|
|
39
|
-
// Enforce spacing before and after comma (same as eslint-config-airbnb-base)
|
|
40
|
-
// https://typescript-eslint.io/rules/comma-spacing
|
|
41
|
-
"@typescript-eslint/comma-spacing": ["error", { before: false, after: true }],
|
|
42
|
-
|
|
43
|
-
// Encourages use of dot notation whenever possible (same as eslint-config-airbnb-base)
|
|
44
|
-
// https://typescript-eslint.io/rules/dot-notation
|
|
45
|
-
"@typescript-eslint/dot-notation": ["error", { allowKeywords: true }],
|
|
46
|
-
|
|
47
|
-
// This option sets a specific tab width for your code (same as eslint-config-airbnb-base)
|
|
48
|
-
// https://typescript-eslint.io/rules/indent
|
|
49
|
-
"@typescript-eslint/indent": ["error", 2, {
|
|
50
|
-
SwitchCase: 1,
|
|
51
|
-
VariableDeclarator: 1,
|
|
52
|
-
outerIIFEBody: 1,
|
|
53
|
-
// MemberExpression: null,
|
|
54
|
-
FunctionDeclaration: {
|
|
55
|
-
parameters: 1,
|
|
56
|
-
body: 1
|
|
57
|
-
},
|
|
58
|
-
FunctionExpression: {
|
|
59
|
-
parameters: 1,
|
|
60
|
-
body: 1
|
|
61
|
-
},
|
|
62
|
-
CallExpression: {
|
|
63
|
-
arguments: 1
|
|
64
|
-
},
|
|
65
|
-
ArrayExpression: 1,
|
|
66
|
-
ObjectExpression: 1,
|
|
67
|
-
ImportDeclaration: 1,
|
|
68
|
-
flatTernaryExpressions: false,
|
|
69
|
-
// list derived from https://github.com/benjamn/ast-types/blob/HEAD/def/jsx.js
|
|
70
|
-
ignoredNodes: [
|
|
71
|
-
"JSXElement",
|
|
72
|
-
"JSXElement > *",
|
|
73
|
-
"JSXAttribute",
|
|
74
|
-
"JSXIdentifier",
|
|
75
|
-
"JSXNamespacedName",
|
|
76
|
-
"JSXMemberExpression",
|
|
77
|
-
"JSXSpreadAttribute",
|
|
78
|
-
"JSXExpressionContainer",
|
|
79
|
-
"JSXOpeningElement",
|
|
80
|
-
"JSXClosingElement",
|
|
81
|
-
"JSXFragment",
|
|
82
|
-
"JSXOpeningFragment",
|
|
83
|
-
"JSXClosingFragment",
|
|
84
|
-
"JSXText",
|
|
85
|
-
"JSXEmptyExpression",
|
|
86
|
-
"JSXSpreadChild"
|
|
87
|
-
],
|
|
88
|
-
ignoreComments: false
|
|
89
|
-
}],
|
|
90
|
-
|
|
91
|
-
// Enforce or disallow variable initializations at definition (same as eslint-config-airbnb-base)
|
|
92
|
-
// https://typescript-eslint.io/rules/init-declarations
|
|
93
|
-
"@typescript-eslint/init-declarations": "off",
|
|
94
|
-
|
|
95
|
-
// Require a space before & after certain keywords (same as eslint-config-airbnb-base)
|
|
96
|
-
// https://typescript-eslint.io/rules/keyword-spacing
|
|
97
|
-
"@typescript-eslint/keyword-spacing": ["error", {
|
|
98
|
-
before: true,
|
|
99
|
-
after: true,
|
|
100
|
-
overrides: {
|
|
101
|
-
return: { after: true },
|
|
102
|
-
throw: { after: true },
|
|
103
|
-
case: { after: true }
|
|
104
|
-
}
|
|
105
|
-
}],
|
|
106
|
-
|
|
107
|
-
// Require or disallow an empty line between class members (same as eslint-config-airbnb-base)
|
|
108
|
-
// https://typescript-eslint.io/rules/lines-between-class-members
|
|
109
|
-
"@typescript-eslint/lines-between-class-members": ["error", "always", { exceptAfterSingleLine: false }],
|
|
110
|
-
|
|
111
|
-
// Force camelCase except for some cases
|
|
112
|
-
// https://typescript-eslint.io/rules/naming-convention
|
|
113
|
-
"@typescript-eslint/naming-convention": ["error", {
|
|
114
|
-
selector: "default",
|
|
115
|
-
format: ["camelCase"],
|
|
116
|
-
leadingUnderscore: "allow",
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
selector: ["typeLike", "accessor", "enumMember"],
|
|
120
|
-
format: ["PascalCase"],
|
|
121
|
-
}],
|
|
122
|
-
|
|
123
|
-
// Disallow empty functions
|
|
124
|
-
// https://typescript-eslint.io/rules/no-empty-function
|
|
125
|
-
"@typescript-eslint/no-empty-function": ["error", {
|
|
126
|
-
allow: [],
|
|
127
|
-
}],
|
|
128
|
-
|
|
129
|
-
// Disallow unnecessary parentheses (same as eslint-config-airbnb-base)
|
|
130
|
-
// https://typescript-eslint.io/rules/no-extra-parens
|
|
131
|
-
"@typescript-eslint/no-extra-parens": ["off", "all", {
|
|
132
|
-
conditionalAssign: true,
|
|
133
|
-
nestedBinaryExpressions: false,
|
|
134
|
-
returnAssign: false,
|
|
135
|
-
ignoreJSX: "all", // delegate to eslint-plugin-react
|
|
136
|
-
enforceForArrowConditionals: false,
|
|
137
|
-
}],
|
|
138
|
-
|
|
139
|
-
// Disallow classes used as namespaces
|
|
140
|
-
// https://typescript-eslint.io/rules/no-extraneous-class
|
|
141
|
-
"@typescript-eslint/no-extraneous-class": "off",
|
|
142
|
-
|
|
143
|
-
// Disallow void type outside of generic or return types
|
|
144
|
-
// https://typescript-eslint.io/rules/no-invalid-void-type
|
|
145
|
-
"@typescript-eslint/no-invalid-void-type": "off",
|
|
146
|
-
|
|
147
|
-
// Disallow magic numbers (same as eslint-config-airbnb-base)
|
|
148
|
-
// https://typescript-eslint.io/rules/no-magic-numbers
|
|
149
|
-
"@typescript-eslint/no-magic-numbers": ["off", {
|
|
150
|
-
ignore: [],
|
|
151
|
-
ignoreArrayIndexes: true,
|
|
152
|
-
enforceConst: true,
|
|
153
|
-
detectObjects: false,
|
|
154
|
-
}],
|
|
155
|
-
|
|
156
|
-
// Disallow custom TypeScript modules and namespaces
|
|
157
|
-
// https://typescript-eslint.io/rules/no-namespace
|
|
158
|
-
"@typescript-eslint/no-namespace": ["error", {
|
|
159
|
-
allowDeclarations: true,
|
|
160
|
-
allowDefinitionFiles: true,
|
|
161
|
-
}],
|
|
162
|
-
|
|
163
|
-
// Disallow type aliases
|
|
164
|
-
// https://typescript-eslint.io/rules/no-type-alias
|
|
165
|
-
"@typescript-eslint/no-type-alias": "off",
|
|
166
|
-
|
|
167
|
-
// Disallow declaration of variables that are not used in the code (same as eslint-config-airbnb-base)
|
|
168
|
-
// https://typescript-eslint.io/rules/no-unused-vars
|
|
169
|
-
"@typescript-eslint/no-unused-vars": ["error", { vars: "all", args: "after-used", ignoreRestSiblings: true }],
|
|
170
|
-
|
|
171
|
-
// Disable forcing non-null assertions over explicit type casts
|
|
172
|
-
// https://typescript-eslint.io/rules/non-nullable-type-assertion-style
|
|
173
|
-
"@typescript-eslint/non-nullable-type-assertion-style": "off",
|
|
174
|
-
|
|
175
|
-
// Require padding inside curly braces (same as eslint-config-airbnb-base)
|
|
176
|
-
// https://typescript-eslint.io/rules/object-curly-spacing
|
|
177
|
-
"@typescript-eslint/object-curly-spacing": ["error", "always"],
|
|
178
|
-
|
|
179
|
-
// Require or disallow padding lines between statements (same as eslint-config-airbnb-base)
|
|
180
|
-
// https://typescript-eslint.io/rules/padding-line-between-statements
|
|
181
|
-
"@typescript-eslint/padding-line-between-statements": "off",
|
|
182
|
-
|
|
183
|
-
// Require function parameters to be typed as readonly to prevent accidental mutation of inputs
|
|
184
|
-
// https://typescript-eslint.io/rules/prefer-readonly-parameter-types
|
|
185
|
-
"@typescript-eslint/prefer-readonly-parameter-types": "off",
|
|
186
|
-
|
|
187
|
-
// Enforce the consistent use of double quotes, but allow single quotes so long as the
|
|
188
|
-
// string contains a quote that would have to be escaped otherwise
|
|
189
|
-
// https://typescript-eslint.io/rules/quotes
|
|
190
|
-
"@typescript-eslint/quotes": ["error", "double", { avoidEscape: true }],
|
|
191
|
-
|
|
192
|
-
// Require `await` in `async function` (note: this is a horrible rule that should never be used) (same as eslint-config-airbnb-base)
|
|
193
|
-
// https://typescript-eslint.io/rules/require-await
|
|
194
|
-
"@typescript-eslint/require-await": "off",
|
|
195
|
-
|
|
196
|
-
// Enforce template literal expressions to be of string type, but allow numbers and booleans
|
|
197
|
-
// https://typescript-eslint.io/rules/restrict-template-expressions
|
|
198
|
-
"@typescript-eslint/restrict-template-expressions": ["error", {
|
|
199
|
-
allowNumber: true,
|
|
200
|
-
allowBoolean: true,
|
|
201
|
-
allowAny: false,
|
|
202
|
-
allowNullish: false,
|
|
203
|
-
allowRegExp: false,
|
|
204
|
-
}],
|
|
205
|
-
|
|
206
|
-
// Require or disallow space before function opening parenthesis (same as eslint-config-airbnb-base)
|
|
207
|
-
// https://typescript-eslint.io/rules/space-before-function-paren
|
|
208
|
-
"@typescript-eslint/space-before-function-paren": ["error", {
|
|
209
|
-
anonymous: "always",
|
|
210
|
-
named: "never",
|
|
211
|
-
asyncArrow: "always"
|
|
212
|
-
}],
|
|
213
|
-
},
|
|
214
|
-
};
|