eslint-config-typed 1.0.3 → 1.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 +4 -2
- package/dist/configs/plugins.mjs +2 -2
- package/dist/custom-rules/no-restricted-syntax2.mjs +2 -2
- package/dist/globals.d.mts +0 -2
- package/dist/plugins/total-functions/rules/no-hidden-type-assertions.mjs +1 -1
- package/dist/rules/eslint-import-rules.d.mts.map +1 -1
- package/dist/rules/eslint-import-rules.mjs +6 -3
- package/dist/rules/eslint-import-rules.mjs.map +1 -1
- package/dist/rules/eslint-jest-rules.mjs +3 -3
- package/dist/rules/eslint-playwright-rules.mjs +2 -2
- package/dist/rules/eslint-promise-rules.mjs +3 -3
- package/dist/rules/eslint-react-rules.d.mts.map +1 -1
- package/dist/rules/eslint-react-rules.mjs +14 -9
- package/dist/rules/eslint-react-rules.mjs.map +1 -1
- package/dist/rules/eslint-rules.d.mts.map +1 -1
- package/dist/rules/eslint-rules.mjs +15 -10
- package/dist/rules/eslint-rules.mjs.map +1 -1
- package/dist/rules/eslint-total-functions-rules.mjs +2 -2
- package/dist/rules/eslint-unicorn-rules.mjs +2 -2
- package/dist/rules/eslint-vitest-rules.mjs +5 -5
- package/dist/rules/typescript-eslint-rules.d.mts.map +1 -1
- package/dist/rules/typescript-eslint-rules.mjs +23 -19
- package/dist/rules/typescript-eslint-rules.mjs.map +1 -1
- package/dist/types/flat-config.d.mts.map +1 -1
- package/package.json +1 -1
- package/src/configs/plugins.mts +2 -2
- package/src/custom-rules/no-restricted-syntax2.mts +2 -2
- package/src/globals.d.mts +0 -2
- package/src/plugins/total-functions/rules/no-hidden-type-assertions.mts +1 -1
- package/src/plugins/total-functions/rules/no-partial-url-constructor.test.mts +1 -1
- package/src/rules/eslint-import-rules.mts +6 -3
- package/src/rules/eslint-jest-rules.mts +3 -3
- package/src/rules/eslint-playwright-rules.mts +2 -2
- package/src/rules/eslint-promise-rules.mts +3 -3
- package/src/rules/eslint-react-rules.mts +15 -9
- package/src/rules/eslint-rules.mts +15 -10
- package/src/rules/eslint-total-functions-rules.mts +2 -2
- package/src/rules/eslint-unicorn-rules.mts +2 -2
- package/src/rules/eslint-vitest-rules.mts +5 -5
- package/src/rules/typescript-eslint-rules.mts +23 -19
- package/src/types/flat-config.mts +2 -0
package/README.md
CHANGED
|
@@ -84,9 +84,11 @@ const defineConfig = () => [
|
|
|
84
84
|
...eslintFlatConfigForTypeScript({
|
|
85
85
|
tsconfigRootDir: thisDir,
|
|
86
86
|
tsconfigFileName: './tsconfig.json',
|
|
87
|
-
packageDirs: [
|
|
87
|
+
packageDirs: [thisDir],
|
|
88
|
+
|
|
89
|
+
// If you are using mono repo and the root package.json is in ../../../ :
|
|
90
|
+
// packageDirs: [path.resolve(thisDir, '../../..'), thisDir],
|
|
88
91
|
}),
|
|
89
|
-
...eslintFlatConfigForReact(),
|
|
90
92
|
eslintFlatConfigForVitest(),
|
|
91
93
|
|
|
92
94
|
// You can override per-rule settings if necessary.
|
package/dist/configs/plugins.mjs
CHANGED
|
@@ -55,11 +55,11 @@ const plugins = {
|
|
|
55
55
|
'prefer-arrow-functions': eslintPluginPreferArrowFunctions,
|
|
56
56
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
57
57
|
promise: eslintPluginPromise,
|
|
58
|
-
// eslint-disable-next-line
|
|
58
|
+
// eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
59
59
|
react: eslintPluginReact,
|
|
60
60
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
61
61
|
'react-hooks': eslintPluginReactHooks,
|
|
62
|
-
// eslint-disable-next-line
|
|
62
|
+
// eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
63
63
|
'react-refresh': eslintPluginReactRefresh,
|
|
64
64
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
65
65
|
'react-perf': eslintPluginReactPerf,
|
|
@@ -32,7 +32,7 @@ const noRestrictedSyntax = {
|
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
34
|
create: (context) => context.options.reduce((result, selectorOrObject) => {
|
|
35
|
-
// eslint-disable-next-line
|
|
35
|
+
// eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
36
36
|
const selectorOrObjectCasted = selectorOrObject;
|
|
37
37
|
const isStringFormat = typeof selectorOrObjectCasted === 'string';
|
|
38
38
|
const hasCustomMessage = !isStringFormat && isNonEmptyString(selectorOrObjectCasted.message);
|
|
@@ -44,7 +44,7 @@ const noRestrictedSyntax = {
|
|
|
44
44
|
: `Using '${selector}' is not allowed.`;
|
|
45
45
|
// eslint-disable-next-line functional/immutable-data
|
|
46
46
|
return Object.assign(result, {
|
|
47
|
-
// eslint-disable-next-line
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
48
48
|
[selector](node) {
|
|
49
49
|
context.report({
|
|
50
50
|
node,
|
package/dist/globals.d.mts
CHANGED
|
@@ -119,7 +119,7 @@ const noHiddenTypeAssertions = createRule({
|
|
|
119
119
|
});
|
|
120
120
|
const hasTypeNode = (typeElement) => {
|
|
121
121
|
try {
|
|
122
|
-
// eslint-disable-next-line
|
|
122
|
+
// eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
123
123
|
const typeAttr = typeElement
|
|
124
124
|
.type;
|
|
125
125
|
return typeAttr !== undefined && isTypeNode(typeAttr);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint-import-rules.d.mts","sourceRoot":"","sources":["../../src/rules/eslint-import-rules.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,eAAO,MAAM,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"eslint-import-rules.d.mts","sourceRoot":"","sources":["../../src/rules/eslint-import-rules.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,eAAO,MAAM,kBAAkB,EAAE,kBA6HvB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const eslintImportsRules = {
|
|
2
|
-
// TypeScript
|
|
2
|
+
// Not needed when using TypeScript.
|
|
3
3
|
'import/no-unresolved': 'off',
|
|
4
4
|
'import/named': 'off',
|
|
5
5
|
'import/default': 'error',
|
|
@@ -97,14 +97,17 @@ const eslintImportsRules = {
|
|
|
97
97
|
},
|
|
98
98
|
],
|
|
99
99
|
'import/no-named-default': 'off',
|
|
100
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* Prohibit default exports as renaming on the definition side is not
|
|
102
|
+
* reflected on the import side
|
|
103
|
+
*/
|
|
101
104
|
'import/no-default-export': 'error',
|
|
102
105
|
'import/no-named-export': 'off',
|
|
103
106
|
'import/no-anonymous-default-export': 'error',
|
|
104
107
|
'import/group-exports': 'off',
|
|
105
108
|
'import/dynamic-import-chunkname': 'error',
|
|
106
109
|
'import/no-empty-named-blocks': 'error',
|
|
107
|
-
'import/enforce-node-protocol-usage': 'error',
|
|
110
|
+
'import/enforce-node-protocol-usage': ['error', 'always'],
|
|
108
111
|
// deprecated rules
|
|
109
112
|
'import/imports-first': 0,
|
|
110
113
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint-import-rules.mjs","sources":["../../src/rules/eslint-import-rules.mts"],"sourcesContent":[null],"names":[],"mappings":"AAEO,MAAM,kBAAkB,GAAuB;;AAEpD,IAAA,sBAAsB,EAAE,KAAK;AAE7B,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,gBAAgB,EAAE,OAAO;AACzB,IAAA,kBAAkB,EAAE,OAAO;IAC3B,4BAA4B,EAAE,KAAK;AACnC,IAAA,yBAAyB,EAAE,OAAO;AAClC,IAAA,2BAA2B,EAAE,OAAO;AACpC,IAAA,4BAA4B,EAAE;QAC5B,OAAO;AACP,QAAA;AACE,YAAA,KAAK,EAAE;gBACL,gBAAgB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AAA;AAED,IAAA,cAAc,EAAE,KAAK;;;;;;;;AASrB,IAAA,6BAA6B,EAAE;QAC7B,OAAO;AACP,QAAA;AACE,YAAA,gBAAgB,EAAE,IAAI;AACtB,YAAA,KAAK,EAAE,CAAC;AACT,SAAA;AACF,KAAA;AACD,IAAA,8BAA8B,EAAE,KAAK;AACrC,IAAA,yBAAyB,EAAE,KAAK;AAChC,IAAA,6BAA6B,EAAE;QAC7B,OAAO;AACP,QAAA;AACE,YAAA,KAAK,EAAE;gBACL,UAAU;gBACV,8BAA8B;gBAC9B,UAAU;gBACV,YAAY;AACb,aAAA;AACF,SAAA;AACF,KAAA;AACD,IAAA,yBAAyB,EAAE,KAAK
|
|
1
|
+
{"version":3,"file":"eslint-import-rules.mjs","sources":["../../src/rules/eslint-import-rules.mts"],"sourcesContent":[null],"names":[],"mappings":"AAEO,MAAM,kBAAkB,GAAuB;;AAEpD,IAAA,sBAAsB,EAAE,KAAK;AAE7B,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,gBAAgB,EAAE,OAAO;AACzB,IAAA,kBAAkB,EAAE,OAAO;IAC3B,4BAA4B,EAAE,KAAK;AACnC,IAAA,yBAAyB,EAAE,OAAO;AAClC,IAAA,2BAA2B,EAAE,OAAO;AACpC,IAAA,4BAA4B,EAAE;QAC5B,OAAO;AACP,QAAA;AACE,YAAA,KAAK,EAAE;gBACL,gBAAgB;gBAChB,cAAc;gBACd,8BAA8B;gBAC9B,kBAAkB;gBAClB,WAAW;gBACX,UAAU;gBACV,YAAY;gBACZ,uBAAuB;gBACvB,gBAAgB;gBAChB,iBAAiB;gBACjB,kBAAkB;gBAClB,gBAAgB;gBAChB,yCAAyC;gBACzC,eAAe;gBACf,aAAa;gBACb,YAAY;gBACZ,YAAY;AACb,aAAA;AACF,SAAA;AACF,KAAA;AACD,IAAA,iCAAiC,EAAE,OAAO;AAC1C,IAAA,uBAAuB,EAAE,OAAO;AAChC,IAAA,iBAAiB,EAAE,OAAO;AAC1B,IAAA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,aAAA;AACF,SAAA;AACF,KAAA;AACD,IAAA,yBAAyB,EAAE,KAAK;AAEhC;;;AAGG;AACH,IAAA,0BAA0B,EAAE,OAAO;AAEnC,IAAA,wBAAwB,EAAE,KAAK;AAC/B,IAAA,oCAAoC,EAAE,OAAO;AAC7C,IAAA,sBAAsB,EAAE,KAAK;AAC7B,IAAA,iCAAiC,EAAE,OAAO;AAC1C,IAAA,8BAA8B,EAAE,OAAO;AACvC,IAAA,oCAAoC,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;;AAGzD,IAAA,sBAAsB,EAAE,CAAC;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const eslintJestRules = {
|
|
2
|
-
/* vitest
|
|
2
|
+
/* Rules common with vitest and playwright (keep settings aligned) */
|
|
3
3
|
'jest/expect-expect': 'error',
|
|
4
4
|
'jest/max-expects': 'off',
|
|
5
5
|
'jest/max-nested-describe': 'error',
|
|
@@ -30,7 +30,7 @@ const eslintJestRules = {
|
|
|
30
30
|
'jest/valid-describe-callback': 'error',
|
|
31
31
|
'jest/valid-expect': 'error',
|
|
32
32
|
'jest/valid-title': 'off',
|
|
33
|
-
/* vitest
|
|
33
|
+
/* Rules common with vitest (keep settings aligned) */
|
|
34
34
|
'jest/consistent-test-it': ['error', { fn: 'test' }],
|
|
35
35
|
'jest/no-alias-methods': 'error',
|
|
36
36
|
'jest/no-disabled-tests': 'error',
|
|
@@ -57,7 +57,7 @@ const eslintJestRules = {
|
|
|
57
57
|
'jest/prefer-snapshot-hint': 'error',
|
|
58
58
|
'jest/prefer-spy-on': 'error',
|
|
59
59
|
'jest/prefer-todo': 'error',
|
|
60
|
-
/* eslint-plugin-jest
|
|
60
|
+
/* eslint-plugin-jest specific rules */
|
|
61
61
|
'jest/no-confusing-set-timeout': 'error',
|
|
62
62
|
'jest/no-deprecated-functions': 'error',
|
|
63
63
|
'jest/no-done-callback': 'error',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const eslintPlaywrightRules = {
|
|
2
|
-
/* vitest
|
|
2
|
+
/* Rules common with vitest (keep settings aligned) */
|
|
3
3
|
'playwright/expect-expect': 'error',
|
|
4
4
|
'playwright/max-expects': 'off',
|
|
5
5
|
'playwright/max-nested-describe': 'error',
|
|
@@ -30,7 +30,7 @@ const eslintPlaywrightRules = {
|
|
|
30
30
|
'playwright/valid-describe-callback': 'error',
|
|
31
31
|
'playwright/valid-expect': 'error',
|
|
32
32
|
'playwright/valid-title': 'off',
|
|
33
|
-
/* eslint-plugin-playwright
|
|
33
|
+
/* eslint-plugin-playwright specific rules */
|
|
34
34
|
'playwright/missing-playwright-await': 'error',
|
|
35
35
|
'playwright/no-element-handle': 'error',
|
|
36
36
|
'playwright/no-eval': 'error',
|
|
@@ -6,9 +6,9 @@ const eslintPromiseRules = {
|
|
|
6
6
|
'promise/no-native': 'off',
|
|
7
7
|
'promise/no-nesting': 'error',
|
|
8
8
|
'promise/no-promise-in-callback': 'error',
|
|
9
|
-
// promise.then(...).catch(...)
|
|
10
|
-
// then
|
|
11
|
-
// then
|
|
9
|
+
// When using promise.then(...).catch(...),
|
|
10
|
+
// this rule points out that errors thrown in callbacks within then() will be caught by the catch().
|
|
11
|
+
// However, this doesn't seem like a valid reason to prohibit writing callbacks inside then(), so we disable it.
|
|
12
12
|
'promise/no-callback-in-promise': 'off',
|
|
13
13
|
'promise/avoid-new': 'off',
|
|
14
14
|
'promise/no-new-statics': 'error',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint-react-rules.d.mts","sourceRoot":"","sources":["../../src/rules/eslint-react-rules.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,eAAO,MAAM,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"eslint-react-rules.d.mts","sourceRoot":"","sources":["../../src/rules/eslint-react-rules.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,eAAO,MAAM,gBAAgB,EAAE,gBAkKrB,CAAC"}
|
|
@@ -22,7 +22,7 @@ const eslintReactRules = {
|
|
|
22
22
|
'react/boolean-prop-naming': 'error',
|
|
23
23
|
'react/button-has-type': 'error',
|
|
24
24
|
'react/default-props-match-prop-types': 'error',
|
|
25
|
-
/**
|
|
25
|
+
/** Enforce consistent usage of props destructuring. */
|
|
26
26
|
'react/destructuring-assignment': 'error',
|
|
27
27
|
'react/display-name': 'error',
|
|
28
28
|
'react/forbid-component-props': ['error', { forbid: ['className'] }],
|
|
@@ -37,21 +37,23 @@ const eslintReactRules = {
|
|
|
37
37
|
'react/hook-use-state': 'off',
|
|
38
38
|
'react/iframe-missing-sandbox': 'error',
|
|
39
39
|
'react/jsx-boolean-value': ['error', 'never'],
|
|
40
|
+
// Enable to avoid rendering differences with characters like \n
|
|
40
41
|
'react/jsx-curly-brace-presence': ['error', 'always'],
|
|
41
|
-
/**
|
|
42
|
+
/** Enforce consistent file naming */
|
|
42
43
|
'react/jsx-filename-extension': ['error', { extensions: ['.tsx'] }],
|
|
43
44
|
'react/jsx-fragments': 'error',
|
|
44
45
|
'react/jsx-handler-names': 'off', // disabled
|
|
45
46
|
'react/jsx-key': 'error',
|
|
46
47
|
'react/jsx-max-depth': 'off', // disabled
|
|
47
|
-
/** JSX
|
|
48
|
+
/** Prohibit inline callback functions in JSX. Fix: Use React.useCallback. */
|
|
48
49
|
'react/jsx-no-bind': 'error',
|
|
49
50
|
'react/jsx-no-comment-textnodes': 'error',
|
|
50
51
|
'react/jsx-no-constructed-context-values': 'error',
|
|
51
52
|
'react/jsx-no-duplicate-props': 'error',
|
|
52
53
|
/**
|
|
53
|
-
* JSX
|
|
54
|
-
*
|
|
54
|
+
* Avoid writing strings directly in JSX, enforce using `<div>{"aaa"}</div>`
|
|
55
|
+
* format. Benefits: Easier to catch missing `{}` around variables, better
|
|
56
|
+
* syntax highlighting for readability.
|
|
55
57
|
*/
|
|
56
58
|
'react/jsx-no-literals': 'error',
|
|
57
59
|
'react/jsx-no-script-url': 'error',
|
|
@@ -59,14 +61,17 @@ const eslintReactRules = {
|
|
|
59
61
|
'react/jsx-no-undef': 'error',
|
|
60
62
|
'react/jsx-no-useless-fragment': ['error', { allowExpressions: true }],
|
|
61
63
|
'react/jsx-pascal-case': 'error',
|
|
62
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* Avoid `{...props}` spread as it weakens type checking for props
|
|
66
|
+
* excess/shortage
|
|
67
|
+
*/
|
|
63
68
|
'react/jsx-props-no-spreading': 'error',
|
|
64
69
|
'react/jsx-sort-props': [
|
|
65
70
|
'error',
|
|
66
71
|
{ callbacksLast: true, reservedFirst: true },
|
|
67
72
|
],
|
|
68
73
|
'react/jsx-uses-react': 'off', // disabled
|
|
69
|
-
/**
|
|
74
|
+
/** Enforce consistent file naming */
|
|
70
75
|
'react/jsx-uses-vars': 'error',
|
|
71
76
|
'react/no-access-state-in-setstate': 'error',
|
|
72
77
|
'react/no-adjacent-inline-elements': 'error',
|
|
@@ -96,7 +101,7 @@ const eslintReactRules = {
|
|
|
96
101
|
'react/no-this-in-sfc': 'error',
|
|
97
102
|
'react/no-typos': 'error',
|
|
98
103
|
'react/no-unescaped-entities': 'error',
|
|
99
|
-
//
|
|
104
|
+
// Allow css prop for @emotion/react
|
|
100
105
|
'react/no-unknown-property': ['error', { ignore: ['css'] }],
|
|
101
106
|
'react/no-unsafe': 'error',
|
|
102
107
|
'react/no-object-type-as-default-prop': 'error',
|
|
@@ -109,7 +114,7 @@ const eslintReactRules = {
|
|
|
109
114
|
'react/prefer-exact-props': 'error',
|
|
110
115
|
'react/prefer-read-only-props': 'error',
|
|
111
116
|
'react/prefer-stateless-function': 'error',
|
|
112
|
-
/** TypeScript
|
|
117
|
+
/** Not needed with TypeScript */
|
|
113
118
|
'react/prop-types': 'off',
|
|
114
119
|
'react/react-in-jsx-scope': 'off', // disabled
|
|
115
120
|
'react/require-default-props': 'error',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint-react-rules.mjs","sources":["../../src/rules/eslint-react-rules.mts"],"sourcesContent":[null],"names":[],"mappings":"AAEO,MAAM,gBAAgB,GAAqB;AAChD;;;;AAIG;AACH,IAAA,iCAAiC,EAAE,KAAK;AACxC,IAAA,oCAAoC,EAAE,KAAK;AAC3C,IAAA,gCAAgC,EAAE,KAAK;AACvC,IAAA,yBAAyB,EAAE,KAAK;AAChC,IAAA,yBAAyB,EAAE,KAAK;AAChC,IAAA,0BAA0B,EAAE,KAAK;AACjC,IAAA,+BAA+B,EAAE,KAAK;AACtC,IAAA,kBAAkB,EAAE,KAAK;AACzB,IAAA,wBAAwB,EAAE,KAAK;AAC/B,IAAA,8BAA8B,EAAE,KAAK;AACrC,IAAA,mBAAmB,EAAE,KAAK;AAC1B,IAAA,mCAAmC,EAAE,KAAK;AAC1C,IAAA,iCAAiC,EAAE,KAAK;AACxC,IAAA,uBAAuB,EAAE,KAAK;AAC9B,IAAA,2BAA2B,EAAE,KAAK;AAElC,IAAA,2BAA2B,EAAE,OAAO;AACpC,IAAA,uBAAuB,EAAE,OAAO;AAChC,IAAA,sCAAsC,EAAE,OAAO;;AAG/C,IAAA,gCAAgC,EAAE,OAAO;AAEzC,IAAA,oBAAoB,EAAE,OAAO;IAC7B,8BAA8B,EAAE,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC;AACpE,IAAA,wBAAwB,EAAE,OAAO;AACjC,IAAA,uBAAuB,EAAE,OAAO;AAChC,IAAA,iCAAiC,EAAE,OAAO;AAC1C,IAAA,yBAAyB,EAAE,OAAO;AAClC,IAAA,qCAAqC,EAAE;QACrC,OAAO;AACP,QAAA,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EAAE;AAC3E,KAAA;AACD,IAAA,sBAAsB,EAAE,KAAK;AAC7B,IAAA,8BAA8B,EAAE,OAAO;AAC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,OAAO;AAC1B,IAAA,0BAA0B,EAAE,OAAO;AACnC,IAAA,uBAAuB,EAAE,OAAO;AAChC,IAAA,4BAA4B,EAAE,OAAO;AACrC,IAAA,iCAAiC,EAAE,OAAO;AAC1C,IAAA,yBAAyB,EAAE,OAAO;AAClC,IAAA,qCAAqC,EAAE,OAAO;AAC9C,IAAA,4BAA4B,EAAE;QAC5B,OAAO;AACP,QAAA;YACE,eAAe,EAAE,CAAC,SAAS,CAAC;AAC7B,SAAA;AACF,KAAA;AACD,IAAA,6CAA6C,EAAE,OAAO;AACtD,IAAA,iCAAiC,EAAE,OAAO;AAC1C,IAAA,4BAA4B,EAAE,OAAO;;AAGrC,IAAA,8BAA8B,EAAE,CAAC;AACjC,IAAA,gCAAgC,EAAE,CAAC;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint-rules.d.mts","sourceRoot":"","sources":["../../src/rules/eslint-rules.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAA0B,MAAM,oBAAoB,CAAC;AAE9E,eAAO,MAAM,gBAAgB;;;GAoC5B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;EA2BiC,CAAC;AAEhE,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBsB,CAAC;AAEhE,0EAA0E;AAC1E,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"eslint-rules.d.mts","sourceRoot":"","sources":["../../src/rules/eslint-rules.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAA0B,MAAM,oBAAoB,CAAC;AAE9E,eAAO,MAAM,gBAAgB;;;GAoC5B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;EA2BiC,CAAC;AAEhE,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBsB,CAAC;AAEhE,0EAA0E;AAC1E,eAAO,MAAM,WAAW,EAAE,WAyXhB,CAAC"}
|
|
@@ -63,17 +63,17 @@ const restrictedGlobals = [
|
|
|
63
63
|
const restrictedGlobalsForFrontend = [
|
|
64
64
|
...restrictedGlobals,
|
|
65
65
|
{
|
|
66
|
-
// react-router
|
|
66
|
+
// Avoid ambiguity with react-router's location
|
|
67
67
|
name: 'location',
|
|
68
68
|
message: "use 'window.location' instead.",
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
|
-
// react-router
|
|
71
|
+
// Avoid ambiguity with react-router's history
|
|
72
72
|
name: 'history',
|
|
73
73
|
message: "use 'window.history' instead.",
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
|
-
// react-router
|
|
76
|
+
// Avoid ambiguity with react-router's navigator
|
|
77
77
|
name: 'navigator',
|
|
78
78
|
message: "use 'window.navigator' instead.",
|
|
79
79
|
},
|
|
@@ -164,7 +164,7 @@ const eslintRules = {
|
|
|
164
164
|
generators: 'never',
|
|
165
165
|
},
|
|
166
166
|
],
|
|
167
|
-
'func-style': 'off', //
|
|
167
|
+
'func-style': 'off', // False positives with function overloads
|
|
168
168
|
'grouped-accessor-pairs': 'error',
|
|
169
169
|
'guard-for-in': 'error',
|
|
170
170
|
'id-denylist': 'error',
|
|
@@ -208,7 +208,7 @@ const eslintRules = {
|
|
|
208
208
|
'no-empty-pattern': 'error',
|
|
209
209
|
'no-empty-static-block': 'error',
|
|
210
210
|
'no-empty': 'error',
|
|
211
|
-
'no-eq-null': 'off', // eqeqeq
|
|
211
|
+
'no-eq-null': 'off', // off since eqeqeq allows null
|
|
212
212
|
'no-eval': 'error',
|
|
213
213
|
'no-ex-assign': 'error',
|
|
214
214
|
'no-extend-native': 'error',
|
|
@@ -256,7 +256,10 @@ const eslintRules = {
|
|
|
256
256
|
'no-octal-escape': 'error',
|
|
257
257
|
'no-octal': 'error',
|
|
258
258
|
'no-param-reassign': 'error',
|
|
259
|
-
/**
|
|
259
|
+
/**
|
|
260
|
+
* Warn against using the value of expressions like `++x` or `x++` as they
|
|
261
|
+
* reduce readability
|
|
262
|
+
*/
|
|
260
263
|
'no-plusplus': [
|
|
261
264
|
'error',
|
|
262
265
|
{
|
|
@@ -271,7 +274,8 @@ const eslintRules = {
|
|
|
271
274
|
'no-restricted-globals': ['error', ...restrictedGlobals],
|
|
272
275
|
'no-restricted-properties': 'error',
|
|
273
276
|
/**
|
|
274
|
-
*
|
|
277
|
+
* Write restricted syntax here that is difficult to achieve with other rules.
|
|
278
|
+
* Use the following AST checker to determine how to write selectors:
|
|
275
279
|
*
|
|
276
280
|
* AST checker:
|
|
277
281
|
* https://typescript-eslint.io/play/#ts=4.7.2&sourceType=module&showAST=es
|
|
@@ -319,9 +323,10 @@ const eslintRules = {
|
|
|
319
323
|
'prefer-object-spread': 'error',
|
|
320
324
|
'prefer-regex-literals': 'error',
|
|
321
325
|
/**
|
|
322
|
-
* `+`
|
|
323
|
-
*
|
|
324
|
-
*
|
|
326
|
+
* Used to avoid ambiguity with `+` operator. restrict-plus-operands limits
|
|
327
|
+
* usage to only bigint, number, string types, and prefer-template prohibits
|
|
328
|
+
* using `+` for string concatenation. Fix: Use template literals or join
|
|
329
|
+
* string arrays with `join("")`.
|
|
325
330
|
*
|
|
326
331
|
* - a + b -> `${a}${b}`
|
|
327
332
|
* - s_1 + s_2 + ... + s_n -> [s_1, ..., s_n].join("")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint-rules.mjs","sources":["../../src/rules/eslint-rules.mts"],"sourcesContent":[null],"names":[],"mappings":"AAEO,MAAM,gBAAgB,GAAG;AAC9B,IAAA;;AAEE,QAAA,QAAQ,EAAE,iCAAiC;AAC3C,QAAA,OAAO,EAAE,8BAA8B;AACxC,KAAA;AACD,IAAA;;AAEE,QAAA,QAAQ,EACN,4JAA4J;AAC9J,QAAA,OAAO,EAAE,8BAA8B;AACxC,KAAA;AACD,IAAA;;AAEE,QAAA,QAAQ,EAAE,oCAAoC;AAC9C,QAAA,OAAO,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C;AACjB,IAAA,eAAe,EAAE,CAAC;AAClB,IAAA,wBAAwB,EAAE,CAAC;AAC3B,IAAA,mBAAmB,EAAE,CAAC;AACtB,IAAA,uBAAuB,EAAE,CAAC;AAC1B,IAAA,uBAAuB,EAAE,CAAC;AAC1B,IAAA,iBAAiB,EAAE,CAAC;AACpB,IAAA,mBAAmB,EAAE,CAAC;AACtB,IAAA,oBAAoB,EAAE,CAAC;AACvB,IAAA,mBAAmB,EAAE,CAAC;AACtB,IAAA,gBAAgB,EAAE,CAAC;AACnB,IAAA,gBAAgB,EAAE,CAAC;AACnB,IAAA,gBAAgB,EAAE,CAAC;AACnB,IAAA,iBAAiB,EAAE,CAAC;AACpB,IAAA,uBAAuB,EAAE,CAAC;AAC1B,IAAA,gBAAgB,EAAE,CAAC;AACnB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,gBAAgB,EAAE,CAAC;IACnB,eAAe,EAAE,CAAC;IAClB,uBAAuB,EAAE,CAAC;IAC1B,yBAAyB,EAAE,CAAC;;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const eslintTotalFunctionsRules = {
|
|
2
2
|
'total-functions/require-strict-mode': 'error',
|
|
3
|
-
// @typescript-eslint/no-unsafe-type-assertion
|
|
3
|
+
// Prioritize this as it can check more strictly than @typescript-eslint/no-unsafe-type-assertion
|
|
4
4
|
'total-functions/no-unsafe-type-assertion': 'error',
|
|
5
|
-
//
|
|
5
|
+
// Off due to performance issues and false positives
|
|
6
6
|
'total-functions/no-unsafe-readonly-mutable-assignment': 'off',
|
|
7
7
|
'total-functions/no-unsafe-mutable-readonly-assignment': 'off',
|
|
8
8
|
'total-functions/no-enums': 'error',
|
|
@@ -9,7 +9,7 @@ const eslintUnicornRules = {
|
|
|
9
9
|
'unicorn/number-literal-case': 'off',
|
|
10
10
|
'unicorn/better-regex': 'error',
|
|
11
11
|
'unicorn/catch-error-name': 'error',
|
|
12
|
-
/**
|
|
12
|
+
/** Enforce consistent usage of destructuring. */
|
|
13
13
|
'unicorn/consistent-destructuring': 'error',
|
|
14
14
|
'unicorn/consistent-function-scoping': 'error',
|
|
15
15
|
'unicorn/custom-error-definition': 'off',
|
|
@@ -17,7 +17,7 @@ const eslintUnicornRules = {
|
|
|
17
17
|
'unicorn/escape-case': 'error',
|
|
18
18
|
'unicorn/expiring-todo-comments': 'error',
|
|
19
19
|
'unicorn/explicit-length-check': 'off',
|
|
20
|
-
/**
|
|
20
|
+
/** Enforce consistent file naming */
|
|
21
21
|
'unicorn/filename-case': [
|
|
22
22
|
'error',
|
|
23
23
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const eslintVitestRules = {
|
|
2
|
-
/* jest
|
|
2
|
+
/* Rules common with jest and playwright (keep settings aligned) */
|
|
3
3
|
'vitest/expect-expect': 'error',
|
|
4
4
|
'vitest/max-expects': 'off',
|
|
5
5
|
'vitest/max-nested-describe': 'error',
|
|
@@ -30,7 +30,7 @@ const eslintVitestRules = {
|
|
|
30
30
|
'vitest/valid-describe-callback': 'error',
|
|
31
31
|
'vitest/valid-expect': 'error',
|
|
32
32
|
'vitest/valid-title': 'off',
|
|
33
|
-
/* jest
|
|
33
|
+
/* Rules common with jest (keep settings aligned) */
|
|
34
34
|
'vitest/consistent-test-it': ['error', { fn: 'test' }],
|
|
35
35
|
'vitest/no-alias-methods': 'error',
|
|
36
36
|
'vitest/no-disabled-tests': 'error',
|
|
@@ -57,12 +57,12 @@ const eslintVitestRules = {
|
|
|
57
57
|
'vitest/prefer-snapshot-hint': 'error',
|
|
58
58
|
'vitest/prefer-spy-on': 'error',
|
|
59
59
|
'vitest/prefer-todo': 'error',
|
|
60
|
-
/* eslint-plugin-vitest
|
|
61
|
-
// inline
|
|
60
|
+
/* eslint-plugin-vitest specific rules */
|
|
61
|
+
// Off to allow writing inline tests
|
|
62
62
|
'vitest/no-conditional-tests': 'off',
|
|
63
63
|
'vitest/consistent-test-filename': 'error',
|
|
64
64
|
'vitest/no-import-node-test': 'error',
|
|
65
|
-
// toBeFalsy()
|
|
65
|
+
// Reject these rules because toBeFalsy() is looser than toBe(false)
|
|
66
66
|
'vitest/prefer-to-be-falsy': 'off',
|
|
67
67
|
'vitest/prefer-to-be-truthy': 'off',
|
|
68
68
|
'vitest/prefer-to-be-object': 'error',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-eslint-rules.d.mts","sourceRoot":"","sources":["../../src/rules/typescript-eslint-rules.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EACjC,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,QAAQ,EAAE,2BAA2B,CAAC,wCAAwC,CAAC,CAAC,OAAO,CAMxF,CAAC;AAGb,eAAO,MAAM,uBAAuB,EAAE,uBAmB5B,CAAC;AAEX,eAAO,MAAM,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"typescript-eslint-rules.d.mts","sourceRoot":"","sources":["../../src/rules/typescript-eslint-rules.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EACjC,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,QAAQ,EAAE,2BAA2B,CAAC,wCAAwC,CAAC,CAAC,OAAO,CAMxF,CAAC;AAGb,eAAO,MAAM,uBAAuB,EAAE,uBAmB5B,CAAC;AAEX,eAAO,MAAM,qBAAqB,EAAE,qBA4X1B,CAAC"}
|
|
@@ -4,7 +4,7 @@ const banTypes = {
|
|
|
4
4
|
fixWith: 'UnknownRecord',
|
|
5
5
|
},
|
|
6
6
|
};
|
|
7
|
-
// Note:
|
|
7
|
+
// Note: If paths with the same name are defined multiple times, later definitions may overwrite earlier ones
|
|
8
8
|
const restrictedImportsOption = {
|
|
9
9
|
paths: [
|
|
10
10
|
{
|
|
@@ -56,12 +56,11 @@ const typescriptEslintRules = {
|
|
|
56
56
|
{ fixMixedExportsWithInlineTypeSpecifier: true },
|
|
57
57
|
],
|
|
58
58
|
'@typescript-eslint/default-param-last': 'error',
|
|
59
|
-
/**
|
|
60
|
-
'@typescript-eslint/dot-notation':
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
// ],
|
|
59
|
+
/** Related to noPropertyAccessFromIndexSignature tsc option */
|
|
60
|
+
'@typescript-eslint/dot-notation': [
|
|
61
|
+
'error',
|
|
62
|
+
{ allowIndexSignaturePropertyAccess: true },
|
|
63
|
+
],
|
|
65
64
|
'@typescript-eslint/explicit-function-return-type': [
|
|
66
65
|
'error',
|
|
67
66
|
{
|
|
@@ -83,7 +82,8 @@ const typescriptEslintRules = {
|
|
|
83
82
|
'@typescript-eslint/init-declarations': 'off', // let is disabled by functional/no-let
|
|
84
83
|
'@typescript-eslint/member-ordering': 'off', // disabled
|
|
85
84
|
/**
|
|
86
|
-
*
|
|
85
|
+
* Function members written in method notation become bivariant, reducing type
|
|
86
|
+
* safety
|
|
87
87
|
* https://github.com/Microsoft/TypeScript/wiki/FAQ#why-are-function-parameters-bivariant
|
|
88
88
|
*/
|
|
89
89
|
'@typescript-eslint/method-signature-style': 'error',
|
|
@@ -102,7 +102,7 @@ const typescriptEslintRules = {
|
|
|
102
102
|
'@typescript-eslint/no-floating-promises': 'error',
|
|
103
103
|
'@typescript-eslint/no-for-in-array': 'error',
|
|
104
104
|
'@typescript-eslint/no-implied-eval': 'error',
|
|
105
|
-
/**
|
|
105
|
+
/** Off to allow explicit type annotations when desired */
|
|
106
106
|
'@typescript-eslint/no-inferrable-types': 'off', // disabled
|
|
107
107
|
'@typescript-eslint/no-invalid-this': 'error',
|
|
108
108
|
'@typescript-eslint/no-invalid-void-type': 'error',
|
|
@@ -113,7 +113,7 @@ const typescriptEslintRules = {
|
|
|
113
113
|
'@typescript-eslint/no-misused-promises': [
|
|
114
114
|
'error',
|
|
115
115
|
{
|
|
116
|
-
checksConditionals: false, // strict-boolean-expression
|
|
116
|
+
checksConditionals: false, // strict-boolean-expression is sufficient
|
|
117
117
|
},
|
|
118
118
|
],
|
|
119
119
|
'@typescript-eslint/no-namespace': 'off', // disabled
|
|
@@ -270,16 +270,20 @@ const typescriptEslintRules = {
|
|
|
270
270
|
'@typescript-eslint/prefer-return-this-type': 'error',
|
|
271
271
|
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
|
|
272
272
|
'@typescript-eslint/promise-function-async': 'off', // disabled
|
|
273
|
-
/**
|
|
273
|
+
/**
|
|
274
|
+
* Prevent forgetting compare function when sorting numbers, as `sort`
|
|
275
|
+
* defaults to string comparison.
|
|
276
|
+
*/
|
|
274
277
|
'@typescript-eslint/require-array-sort-compare': [
|
|
275
278
|
'error',
|
|
276
279
|
{ ignoreStringArrays: true },
|
|
277
280
|
],
|
|
278
281
|
'@typescript-eslint/require-await': 'error',
|
|
279
282
|
/**
|
|
280
|
-
* `+`
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
+
* Used to avoid ambiguity with `+` operator. restrict-plus-operands limits
|
|
284
|
+
* usage to only bigint, number, string types, and prefer-template prohibits
|
|
285
|
+
* using `+` for string concatenation. Fix: Use template literals or join
|
|
286
|
+
* string arrays with `join("")`.
|
|
283
287
|
*
|
|
284
288
|
* - A + b -> `${a}${b}`
|
|
285
289
|
* - S_1 + s_2 + ... + s_n -> [s_1, ..., s_n].join("")
|
|
@@ -309,14 +313,14 @@ const typescriptEslintRules = {
|
|
|
309
313
|
],
|
|
310
314
|
'@typescript-eslint/return-await': 'error',
|
|
311
315
|
/**
|
|
312
|
-
*
|
|
313
|
-
*
|
|
316
|
+
* Used to avoid implicit casting to Boolean. Prevents overlooking that
|
|
317
|
+
* numbers `0`, `NaN` and string `""` are treated as false in conditionals.
|
|
314
318
|
*/
|
|
315
319
|
'@typescript-eslint/strict-boolean-expressions': [
|
|
316
320
|
'error',
|
|
317
321
|
{ allowString: false, allowNumber: false, allowNullableObject: false },
|
|
318
322
|
],
|
|
319
|
-
/**
|
|
323
|
+
/** Prevent missing switch cases (using type information) */
|
|
320
324
|
'@typescript-eslint/switch-exhaustiveness-check': [
|
|
321
325
|
'error',
|
|
322
326
|
{
|
|
@@ -357,12 +361,12 @@ const typescriptEslintRules = {
|
|
|
357
361
|
'@typescript-eslint/no-empty-object-type': 'error',
|
|
358
362
|
'@typescript-eslint/no-unnecessary-parameter-property-assignment': 'error',
|
|
359
363
|
'@typescript-eslint/no-unnecessary-template-expression': 'error',
|
|
360
|
-
//
|
|
364
|
+
// Off temporarily due to bug causing infinite loop with recursive types
|
|
361
365
|
'@typescript-eslint/no-unnecessary-type-parameters': 'off',
|
|
362
366
|
'@typescript-eslint/no-unsafe-function-type': 'error',
|
|
363
367
|
'@typescript-eslint/no-wrapper-object-types': 'error',
|
|
364
368
|
'@typescript-eslint/no-deprecated': 'error',
|
|
365
|
-
// total-functions/no-unsafe-type-assertion
|
|
369
|
+
// Off as total-functions/no-unsafe-type-assertion provides stricter checking
|
|
366
370
|
'@typescript-eslint/no-unsafe-type-assertion': 'off',
|
|
367
371
|
'@typescript-eslint/related-getter-setter-pairs': 'error',
|
|
368
372
|
'@typescript-eslint/no-misused-spread': 'error',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-eslint-rules.mjs","sources":["../../src/rules/typescript-eslint-rules.mts"],"sourcesContent":[null],"names":[],"mappings":"AAMO,MAAM,QAAQ,GACnB;AACE,IAAA,MAAM,EAAE;AACN,QAAA,OAAO,EAAE,8BAA8B;AACvC,QAAA,OAAO,EAAE,eAAe;AACzB,KAAA;;AAGL;AACO,MAAM,uBAAuB,GAA4B;AAC9D,IAAA,KAAK,EAAE;AACL,QAAA;AACE,YAAA,IAAI,EAAE,eAAe;AACrB,YAAA,WAAW,EAAE;gBACX,MAAM;gBACN,UAAU;gBACV,YAAY;gBACZ,SAAS;gBACT,aAAa;gBACb,QAAQ;gBACR,YAAY;gBACZ,WAAW;gBACX,iBAAiB;gBACjB,kBAAkB;AACnB,aAAA;AACD,YAAA,OAAO,EAAE,yCAAyC;AACnD,SAAA;AACF,KAAA;;AAGI,MAAM,qBAAqB,GAA0B;AAC1D,IAAA,iDAAiD,EAAE,OAAO;AAC1D,IAAA,+BAA+B,EAAE;QAC/B,OAAO;AACP,QAAA,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE;AACxC,KAAA;AACD,IAAA,mCAAmC,EAAE,OAAO;AAC5C,IAAA,mCAAmC,EAAE,OAAO;AAC5C,IAAA,uCAAuC,EAAE,OAAO;IAChD,wCAAwC,EAAE,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACxE,IAAA,iDAAiD,EAAE,OAAO;AAC1D,IAAA,oDAAoD,EAAE,OAAO;AAC7D,IAAA,+CAA+C,EAAE;QAC/C,OAAO;AACP,QAAA,EAAE,cAAc,EAAE,IAAI,EAAE,2BAA2B,EAAE,OAAO,EAAE;AAC/D,KAAA;AACD,IAAA,gDAAgD,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;AACnE,IAAA,4CAA4C,EAAE;;QAE5C,OAAO;AACP,QAAA;AACE,YAAA,MAAM,EAAE,cAAc;AACtB,YAAA,QAAQ,EAAE,qBAAqB;AAC/B,YAAA,uBAAuB,EAAE,IAAI;AAC9B,SAAA;AACF,KAAA;AACD,IAAA,4CAA4C,EAAE;QAC5C,KAAK;QACL,EAAE,sCAAsC,EAAE,IAAI,EAAE;AACjD,KAAA;AACD,IAAA,uCAAuC,EAAE,OAAO;;AAGhD,IAAA,iCAAiC,EAAE,
|
|
1
|
+
{"version":3,"file":"typescript-eslint-rules.mjs","sources":["../../src/rules/typescript-eslint-rules.mts"],"sourcesContent":[null],"names":[],"mappings":"AAMO,MAAM,QAAQ,GACnB;AACE,IAAA,MAAM,EAAE;AACN,QAAA,OAAO,EAAE,8BAA8B;AACvC,QAAA,OAAO,EAAE,eAAe;AACzB,KAAA;;AAGL;AACO,MAAM,uBAAuB,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IAAA,0CAA0C,EAAE,OAAO;AAEnD,IAAA,sCAAsC,EAAE,KAAK;AAC7C,IAAA,oCAAoC,EAAE,OAAO;AAC7C,IAAA,gCAAgC,EAAE,OAAO;AAEzC,IAAA,iDAAiD,EAAE,KAAK;;;IAIxD,2DAA2D,EAAE,KAAK;AAClE,IAAA,qCAAqC,EAAE;QACrC,OAAO;AACP,QAAA,EAAE,gBAAgB,EAAE,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE;AACzD,KAAA;AAED,IAAA,yCAAyC,EAAE,OAAO;AAClD,IAAA,iEAAiE,EAAE,OAAO;AAC1E,IAAA,uDAAuD,EAAE,OAAO;;AAGhE,IAAA,mDAAmD,EAAE,KAAK;AAE1D,IAAA,4CAA4C,EAAE,OAAO;AACrD,IAAA,4CAA4C,EAAE,OAAO;AACrD,IAAA,kCAAkC,EAAE,OAAO;;AAG3C,IAAA,6CAA6C,EAAE,KAAK;AAEpD,IAAA,gDAAgD,EAAE,OAAO;AAEzD,IAAA,sCAAsC,EAAE,OAAO;;AAG/C,IAAA,kCAAkC,EAAE,CAAC;AACrC,IAAA,2CAA2C,EAAE,CAAC;AAC9C,IAAA,2CAA2C,EAAE,CAAC;AAC9C,IAAA,oCAAoC,EAAE,CAAC;AACvC,IAAA,uCAAuC,EAAE,CAAC;AAC1C,IAAA,yCAAyC,EAAE,CAAC;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flat-config.d.mts","sourceRoot":"","sources":["../../src/types/flat-config.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"flat-config.d.mts","sourceRoot":"","sources":["../../src/types/flat-config.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAGnD,OAAO,EAAE,KAAK,UAAU,IAAI,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEpF,MAAM,MAAM,UAAU,GAAG,YAAY,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;AAG1D,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;AAE5D,MAAM,MAAM,IAAI,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC;AAIhD,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC"}
|
package/package.json
CHANGED
package/src/configs/plugins.mts
CHANGED
|
@@ -99,11 +99,11 @@ export const plugins: Record<
|
|
|
99
99
|
'prefer-arrow-functions': eslintPluginPreferArrowFunctions,
|
|
100
100
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
101
101
|
promise: eslintPluginPromise,
|
|
102
|
-
// eslint-disable-next-line
|
|
102
|
+
// eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
103
103
|
react: eslintPluginReact as unknown as ESLintPlugin,
|
|
104
104
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
105
105
|
'react-hooks': eslintPluginReactHooks,
|
|
106
|
-
// eslint-disable-next-line
|
|
106
|
+
// eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
107
107
|
'react-refresh': eslintPluginReactRefresh as unknown as ESLintPlugin,
|
|
108
108
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
109
109
|
'react-perf': eslintPluginReactPerf,
|
|
@@ -41,7 +41,7 @@ export const noRestrictedSyntax: Rule.RuleModule = {
|
|
|
41
41
|
create: (context: DeepReadonly<Rule.RuleContext>) =>
|
|
42
42
|
context.options.reduce(
|
|
43
43
|
(result: UnknownRecord, selectorOrObject: unknown) => {
|
|
44
|
-
// eslint-disable-next-line
|
|
44
|
+
// eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
45
45
|
const selectorOrObjectCasted = selectorOrObject as
|
|
46
46
|
| string
|
|
47
47
|
| Readonly<{ selector: string; message?: string }>;
|
|
@@ -61,7 +61,7 @@ export const noRestrictedSyntax: Rule.RuleModule = {
|
|
|
61
61
|
|
|
62
62
|
// eslint-disable-next-line functional/immutable-data
|
|
63
63
|
return Object.assign(result, {
|
|
64
|
-
// eslint-disable-next-line
|
|
64
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
65
65
|
[selector](node: ESTree.Node) {
|
|
66
66
|
context.report({
|
|
67
67
|
node,
|
package/src/globals.d.mts
CHANGED
|
@@ -197,7 +197,7 @@ const hasTypeNode = (
|
|
|
197
197
|
typeElement: TypeElement,
|
|
198
198
|
): typeElement is TypeElement & Readonly<{ type: TypeNode }> => {
|
|
199
199
|
try {
|
|
200
|
-
// eslint-disable-next-line
|
|
200
|
+
// eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
201
201
|
const typeAttr = (typeElement as Partial<Readonly<{ type: TypeNode }>>)
|
|
202
202
|
.type;
|
|
203
203
|
return typeAttr !== undefined && isTypeNode(typeAttr);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type EslintImportsRules } from '../types/index.mjs';
|
|
2
2
|
|
|
3
3
|
export const eslintImportsRules: EslintImportsRules = {
|
|
4
|
-
// TypeScript
|
|
4
|
+
// Not needed when using TypeScript.
|
|
5
5
|
'import/no-unresolved': 'off',
|
|
6
6
|
|
|
7
7
|
'import/named': 'off',
|
|
@@ -110,7 +110,10 @@ export const eslintImportsRules: EslintImportsRules = {
|
|
|
110
110
|
],
|
|
111
111
|
'import/no-named-default': 'off',
|
|
112
112
|
|
|
113
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* Prohibit default exports as renaming on the definition side is not
|
|
115
|
+
* reflected on the import side
|
|
116
|
+
*/
|
|
114
117
|
'import/no-default-export': 'error',
|
|
115
118
|
|
|
116
119
|
'import/no-named-export': 'off',
|
|
@@ -118,7 +121,7 @@ export const eslintImportsRules: EslintImportsRules = {
|
|
|
118
121
|
'import/group-exports': 'off',
|
|
119
122
|
'import/dynamic-import-chunkname': 'error',
|
|
120
123
|
'import/no-empty-named-blocks': 'error',
|
|
121
|
-
'import/enforce-node-protocol-usage': 'error',
|
|
124
|
+
'import/enforce-node-protocol-usage': ['error', 'always'],
|
|
122
125
|
|
|
123
126
|
// deprecated rules
|
|
124
127
|
'import/imports-first': 0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type EslintJestRules } from '../types/index.mjs';
|
|
2
2
|
|
|
3
3
|
export const eslintJestRules: EslintJestRules = {
|
|
4
|
-
/* vitest
|
|
4
|
+
/* Rules common with vitest and playwright (keep settings aligned) */
|
|
5
5
|
'jest/expect-expect': 'error',
|
|
6
6
|
'jest/max-expects': 'off',
|
|
7
7
|
'jest/max-nested-describe': 'error',
|
|
@@ -33,7 +33,7 @@ export const eslintJestRules: EslintJestRules = {
|
|
|
33
33
|
'jest/valid-expect': 'error',
|
|
34
34
|
'jest/valid-title': 'off',
|
|
35
35
|
|
|
36
|
-
/* vitest
|
|
36
|
+
/* Rules common with vitest (keep settings aligned) */
|
|
37
37
|
'jest/consistent-test-it': ['error', { fn: 'test' }],
|
|
38
38
|
'jest/no-alias-methods': 'error',
|
|
39
39
|
'jest/no-disabled-tests': 'error',
|
|
@@ -61,7 +61,7 @@ export const eslintJestRules: EslintJestRules = {
|
|
|
61
61
|
'jest/prefer-spy-on': 'error',
|
|
62
62
|
'jest/prefer-todo': 'error',
|
|
63
63
|
|
|
64
|
-
/* eslint-plugin-jest
|
|
64
|
+
/* eslint-plugin-jest specific rules */
|
|
65
65
|
|
|
66
66
|
'jest/no-confusing-set-timeout': 'error',
|
|
67
67
|
'jest/no-deprecated-functions': 'error',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type EslintPlaywrightRules } from '../types/index.mjs';
|
|
2
2
|
|
|
3
3
|
export const eslintPlaywrightRules: EslintPlaywrightRules = {
|
|
4
|
-
/* vitest
|
|
4
|
+
/* Rules common with vitest (keep settings aligned) */
|
|
5
5
|
'playwright/expect-expect': 'error',
|
|
6
6
|
'playwright/max-expects': 'off',
|
|
7
7
|
'playwright/max-nested-describe': 'error',
|
|
@@ -33,7 +33,7 @@ export const eslintPlaywrightRules: EslintPlaywrightRules = {
|
|
|
33
33
|
'playwright/valid-expect': 'error',
|
|
34
34
|
'playwright/valid-title': 'off',
|
|
35
35
|
|
|
36
|
-
/* eslint-plugin-playwright
|
|
36
|
+
/* eslint-plugin-playwright specific rules */
|
|
37
37
|
|
|
38
38
|
'playwright/missing-playwright-await': 'error',
|
|
39
39
|
'playwright/no-element-handle': 'error',
|
|
@@ -9,9 +9,9 @@ export const eslintPromiseRules: EslintPromiseRules = {
|
|
|
9
9
|
'promise/no-nesting': 'error',
|
|
10
10
|
'promise/no-promise-in-callback': 'error',
|
|
11
11
|
|
|
12
|
-
// promise.then(...).catch(...)
|
|
13
|
-
// then
|
|
14
|
-
// then
|
|
12
|
+
// When using promise.then(...).catch(...),
|
|
13
|
+
// this rule points out that errors thrown in callbacks within then() will be caught by the catch().
|
|
14
|
+
// However, this doesn't seem like a valid reason to prohibit writing callbacks inside then(), so we disable it.
|
|
15
15
|
'promise/no-callback-in-promise': 'off',
|
|
16
16
|
|
|
17
17
|
'promise/avoid-new': 'off',
|
|
@@ -26,7 +26,7 @@ export const eslintReactRules: EslintReactRules = {
|
|
|
26
26
|
'react/button-has-type': 'error',
|
|
27
27
|
'react/default-props-match-prop-types': 'error',
|
|
28
28
|
|
|
29
|
-
/**
|
|
29
|
+
/** Enforce consistent usage of props destructuring. */
|
|
30
30
|
'react/destructuring-assignment': 'error',
|
|
31
31
|
|
|
32
32
|
'react/display-name': 'error',
|
|
@@ -42,9 +42,11 @@ export const eslintReactRules: EslintReactRules = {
|
|
|
42
42
|
'react/hook-use-state': 'off',
|
|
43
43
|
'react/iframe-missing-sandbox': 'error',
|
|
44
44
|
'react/jsx-boolean-value': ['error', 'never'],
|
|
45
|
+
|
|
46
|
+
// Enable to avoid rendering differences with characters like \n
|
|
45
47
|
'react/jsx-curly-brace-presence': ['error', 'always'],
|
|
46
48
|
|
|
47
|
-
/**
|
|
49
|
+
/** Enforce consistent file naming */
|
|
48
50
|
'react/jsx-filename-extension': ['error', { extensions: ['.tsx'] }],
|
|
49
51
|
|
|
50
52
|
'react/jsx-fragments': 'error',
|
|
@@ -52,7 +54,7 @@ export const eslintReactRules: EslintReactRules = {
|
|
|
52
54
|
'react/jsx-key': 'error',
|
|
53
55
|
'react/jsx-max-depth': 'off', // disabled
|
|
54
56
|
|
|
55
|
-
/** JSX
|
|
57
|
+
/** Prohibit inline callback functions in JSX. Fix: Use React.useCallback. */
|
|
56
58
|
'react/jsx-no-bind': 'error',
|
|
57
59
|
|
|
58
60
|
'react/jsx-no-comment-textnodes': 'error',
|
|
@@ -60,8 +62,9 @@ export const eslintReactRules: EslintReactRules = {
|
|
|
60
62
|
'react/jsx-no-duplicate-props': 'error',
|
|
61
63
|
|
|
62
64
|
/**
|
|
63
|
-
* JSX
|
|
64
|
-
*
|
|
65
|
+
* Avoid writing strings directly in JSX, enforce using `<div>{"aaa"}</div>`
|
|
66
|
+
* format. Benefits: Easier to catch missing `{}` around variables, better
|
|
67
|
+
* syntax highlighting for readability.
|
|
65
68
|
*/
|
|
66
69
|
'react/jsx-no-literals': 'error',
|
|
67
70
|
|
|
@@ -71,7 +74,10 @@ export const eslintReactRules: EslintReactRules = {
|
|
|
71
74
|
'react/jsx-no-useless-fragment': ['error', { allowExpressions: true }],
|
|
72
75
|
'react/jsx-pascal-case': 'error',
|
|
73
76
|
|
|
74
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* Avoid `{...props}` spread as it weakens type checking for props
|
|
79
|
+
* excess/shortage
|
|
80
|
+
*/
|
|
75
81
|
'react/jsx-props-no-spreading': 'error',
|
|
76
82
|
|
|
77
83
|
'react/jsx-sort-props': [
|
|
@@ -81,7 +87,7 @@ export const eslintReactRules: EslintReactRules = {
|
|
|
81
87
|
|
|
82
88
|
'react/jsx-uses-react': 'off', // disabled
|
|
83
89
|
|
|
84
|
-
/**
|
|
90
|
+
/** Enforce consistent file naming */
|
|
85
91
|
'react/jsx-uses-vars': 'error',
|
|
86
92
|
|
|
87
93
|
'react/no-access-state-in-setstate': 'error',
|
|
@@ -113,7 +119,7 @@ export const eslintReactRules: EslintReactRules = {
|
|
|
113
119
|
'react/no-typos': 'error',
|
|
114
120
|
'react/no-unescaped-entities': 'error',
|
|
115
121
|
|
|
116
|
-
//
|
|
122
|
+
// Allow css prop for @emotion/react
|
|
117
123
|
'react/no-unknown-property': ['error', { ignore: ['css'] }],
|
|
118
124
|
|
|
119
125
|
'react/no-unsafe': 'error',
|
|
@@ -128,7 +134,7 @@ export const eslintReactRules: EslintReactRules = {
|
|
|
128
134
|
'react/prefer-read-only-props': 'error',
|
|
129
135
|
'react/prefer-stateless-function': 'error',
|
|
130
136
|
|
|
131
|
-
/** TypeScript
|
|
137
|
+
/** Not needed with TypeScript */
|
|
132
138
|
'react/prop-types': 'off',
|
|
133
139
|
|
|
134
140
|
'react/react-in-jsx-scope': 'off', // disabled
|
|
@@ -70,17 +70,17 @@ export const restrictedGlobals = [
|
|
|
70
70
|
export const restrictedGlobalsForFrontend = [
|
|
71
71
|
...restrictedGlobals,
|
|
72
72
|
{
|
|
73
|
-
// react-router
|
|
73
|
+
// Avoid ambiguity with react-router's location
|
|
74
74
|
name: 'location',
|
|
75
75
|
message: "use 'window.location' instead.",
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
|
-
// react-router
|
|
78
|
+
// Avoid ambiguity with react-router's history
|
|
79
79
|
name: 'history',
|
|
80
80
|
message: "use 'window.history' instead.",
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
|
-
// react-router
|
|
83
|
+
// Avoid ambiguity with react-router's navigator
|
|
84
84
|
name: 'navigator',
|
|
85
85
|
message: "use 'window.navigator' instead.",
|
|
86
86
|
},
|
|
@@ -180,7 +180,7 @@ export const eslintRules: EslintRules = {
|
|
|
180
180
|
generators: 'never',
|
|
181
181
|
},
|
|
182
182
|
],
|
|
183
|
-
'func-style': 'off', //
|
|
183
|
+
'func-style': 'off', // False positives with function overloads
|
|
184
184
|
'grouped-accessor-pairs': 'error',
|
|
185
185
|
'guard-for-in': 'error',
|
|
186
186
|
'id-denylist': 'error',
|
|
@@ -224,7 +224,7 @@ export const eslintRules: EslintRules = {
|
|
|
224
224
|
'no-empty-pattern': 'error',
|
|
225
225
|
'no-empty-static-block': 'error',
|
|
226
226
|
'no-empty': 'error',
|
|
227
|
-
'no-eq-null': 'off', // eqeqeq
|
|
227
|
+
'no-eq-null': 'off', // off since eqeqeq allows null
|
|
228
228
|
'no-eval': 'error',
|
|
229
229
|
'no-ex-assign': 'error',
|
|
230
230
|
'no-extend-native': 'error',
|
|
@@ -273,7 +273,10 @@ export const eslintRules: EslintRules = {
|
|
|
273
273
|
'no-octal': 'error',
|
|
274
274
|
'no-param-reassign': 'error',
|
|
275
275
|
|
|
276
|
-
/**
|
|
276
|
+
/**
|
|
277
|
+
* Warn against using the value of expressions like `++x` or `x++` as they
|
|
278
|
+
* reduce readability
|
|
279
|
+
*/
|
|
277
280
|
'no-plusplus': [
|
|
278
281
|
'error',
|
|
279
282
|
{
|
|
@@ -290,7 +293,8 @@ export const eslintRules: EslintRules = {
|
|
|
290
293
|
'no-restricted-properties': 'error',
|
|
291
294
|
|
|
292
295
|
/**
|
|
293
|
-
*
|
|
296
|
+
* Write restricted syntax here that is difficult to achieve with other rules.
|
|
297
|
+
* Use the following AST checker to determine how to write selectors:
|
|
294
298
|
*
|
|
295
299
|
* AST checker:
|
|
296
300
|
* https://typescript-eslint.io/play/#ts=4.7.2&sourceType=module&showAST=es
|
|
@@ -340,9 +344,10 @@ export const eslintRules: EslintRules = {
|
|
|
340
344
|
'prefer-regex-literals': 'error',
|
|
341
345
|
|
|
342
346
|
/**
|
|
343
|
-
* `+`
|
|
344
|
-
*
|
|
345
|
-
*
|
|
347
|
+
* Used to avoid ambiguity with `+` operator. restrict-plus-operands limits
|
|
348
|
+
* usage to only bigint, number, string types, and prefer-template prohibits
|
|
349
|
+
* using `+` for string concatenation. Fix: Use template literals or join
|
|
350
|
+
* string arrays with `join("")`.
|
|
346
351
|
*
|
|
347
352
|
* - a + b -> `${a}${b}`
|
|
348
353
|
* - s_1 + s_2 + ... + s_n -> [s_1, ..., s_n].join("")
|
|
@@ -3,10 +3,10 @@ import { type EslintTotalFunctionsRules } from '../types/index.mjs';
|
|
|
3
3
|
export const eslintTotalFunctionsRules: EslintTotalFunctionsRules = {
|
|
4
4
|
'total-functions/require-strict-mode': 'error',
|
|
5
5
|
|
|
6
|
-
// @typescript-eslint/no-unsafe-type-assertion
|
|
6
|
+
// Prioritize this as it can check more strictly than @typescript-eslint/no-unsafe-type-assertion
|
|
7
7
|
'total-functions/no-unsafe-type-assertion': 'error',
|
|
8
8
|
|
|
9
|
-
//
|
|
9
|
+
// Off due to performance issues and false positives
|
|
10
10
|
'total-functions/no-unsafe-readonly-mutable-assignment': 'off',
|
|
11
11
|
|
|
12
12
|
'total-functions/no-unsafe-mutable-readonly-assignment': 'off',
|
|
@@ -13,7 +13,7 @@ export const eslintUnicornRules: EslintUnicornRules = {
|
|
|
13
13
|
'unicorn/better-regex': 'error',
|
|
14
14
|
'unicorn/catch-error-name': 'error',
|
|
15
15
|
|
|
16
|
-
/**
|
|
16
|
+
/** Enforce consistent usage of destructuring. */
|
|
17
17
|
'unicorn/consistent-destructuring': 'error',
|
|
18
18
|
|
|
19
19
|
'unicorn/consistent-function-scoping': 'error',
|
|
@@ -23,7 +23,7 @@ export const eslintUnicornRules: EslintUnicornRules = {
|
|
|
23
23
|
'unicorn/expiring-todo-comments': 'error',
|
|
24
24
|
'unicorn/explicit-length-check': 'off',
|
|
25
25
|
|
|
26
|
-
/**
|
|
26
|
+
/** Enforce consistent file naming */
|
|
27
27
|
'unicorn/filename-case': [
|
|
28
28
|
'error',
|
|
29
29
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type EslintVitestRules } from '../types/index.mjs';
|
|
2
2
|
|
|
3
3
|
export const eslintVitestRules: EslintVitestRules = {
|
|
4
|
-
/* jest
|
|
4
|
+
/* Rules common with jest and playwright (keep settings aligned) */
|
|
5
5
|
'vitest/expect-expect': 'error',
|
|
6
6
|
'vitest/max-expects': 'off',
|
|
7
7
|
'vitest/max-nested-describe': 'error',
|
|
@@ -33,7 +33,7 @@ export const eslintVitestRules: EslintVitestRules = {
|
|
|
33
33
|
'vitest/valid-expect': 'error',
|
|
34
34
|
'vitest/valid-title': 'off',
|
|
35
35
|
|
|
36
|
-
/* jest
|
|
36
|
+
/* Rules common with jest (keep settings aligned) */
|
|
37
37
|
|
|
38
38
|
'vitest/consistent-test-it': ['error', { fn: 'test' }],
|
|
39
39
|
'vitest/no-alias-methods': 'error',
|
|
@@ -62,15 +62,15 @@ export const eslintVitestRules: EslintVitestRules = {
|
|
|
62
62
|
'vitest/prefer-spy-on': 'error',
|
|
63
63
|
'vitest/prefer-todo': 'error',
|
|
64
64
|
|
|
65
|
-
/* eslint-plugin-vitest
|
|
65
|
+
/* eslint-plugin-vitest specific rules */
|
|
66
66
|
|
|
67
|
-
// inline
|
|
67
|
+
// Off to allow writing inline tests
|
|
68
68
|
'vitest/no-conditional-tests': 'off',
|
|
69
69
|
|
|
70
70
|
'vitest/consistent-test-filename': 'error',
|
|
71
71
|
'vitest/no-import-node-test': 'error',
|
|
72
72
|
|
|
73
|
-
// toBeFalsy()
|
|
73
|
+
// Reject these rules because toBeFalsy() is looser than toBe(false)
|
|
74
74
|
'vitest/prefer-to-be-falsy': 'off',
|
|
75
75
|
'vitest/prefer-to-be-truthy': 'off',
|
|
76
76
|
|
|
@@ -12,7 +12,7 @@ export const banTypes: TypeScriptEslintRulesOption['@typescript-eslint/no-restri
|
|
|
12
12
|
},
|
|
13
13
|
} as const;
|
|
14
14
|
|
|
15
|
-
// Note:
|
|
15
|
+
// Note: If paths with the same name are defined multiple times, later definitions may overwrite earlier ones
|
|
16
16
|
export const restrictedImportsOption: RestrictedImportsOption = {
|
|
17
17
|
paths: [
|
|
18
18
|
{
|
|
@@ -66,12 +66,11 @@ export const typescriptEslintRules: TypeScriptEslintRules = {
|
|
|
66
66
|
],
|
|
67
67
|
'@typescript-eslint/default-param-last': 'error',
|
|
68
68
|
|
|
69
|
-
/**
|
|
70
|
-
'@typescript-eslint/dot-notation':
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
// ],
|
|
69
|
+
/** Related to noPropertyAccessFromIndexSignature tsc option */
|
|
70
|
+
'@typescript-eslint/dot-notation': [
|
|
71
|
+
'error',
|
|
72
|
+
{ allowIndexSignaturePropertyAccess: true },
|
|
73
|
+
],
|
|
75
74
|
|
|
76
75
|
'@typescript-eslint/explicit-function-return-type': [
|
|
77
76
|
'error',
|
|
@@ -95,7 +94,8 @@ export const typescriptEslintRules: TypeScriptEslintRules = {
|
|
|
95
94
|
'@typescript-eslint/member-ordering': 'off', // disabled
|
|
96
95
|
|
|
97
96
|
/**
|
|
98
|
-
*
|
|
97
|
+
* Function members written in method notation become bivariant, reducing type
|
|
98
|
+
* safety
|
|
99
99
|
* https://github.com/Microsoft/TypeScript/wiki/FAQ#why-are-function-parameters-bivariant
|
|
100
100
|
*/
|
|
101
101
|
'@typescript-eslint/method-signature-style': 'error',
|
|
@@ -116,7 +116,7 @@ export const typescriptEslintRules: TypeScriptEslintRules = {
|
|
|
116
116
|
'@typescript-eslint/no-for-in-array': 'error',
|
|
117
117
|
'@typescript-eslint/no-implied-eval': 'error',
|
|
118
118
|
|
|
119
|
-
/**
|
|
119
|
+
/** Off to allow explicit type annotations when desired */
|
|
120
120
|
'@typescript-eslint/no-inferrable-types': 'off', // disabled
|
|
121
121
|
|
|
122
122
|
'@typescript-eslint/no-invalid-this': 'error',
|
|
@@ -128,7 +128,7 @@ export const typescriptEslintRules: TypeScriptEslintRules = {
|
|
|
128
128
|
'@typescript-eslint/no-misused-promises': [
|
|
129
129
|
'error',
|
|
130
130
|
{
|
|
131
|
-
checksConditionals: false, // strict-boolean-expression
|
|
131
|
+
checksConditionals: false, // strict-boolean-expression is sufficient
|
|
132
132
|
},
|
|
133
133
|
],
|
|
134
134
|
'@typescript-eslint/no-namespace': 'off', // disabled
|
|
@@ -287,7 +287,10 @@ export const typescriptEslintRules: TypeScriptEslintRules = {
|
|
|
287
287
|
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
|
|
288
288
|
'@typescript-eslint/promise-function-async': 'off', // disabled
|
|
289
289
|
|
|
290
|
-
/**
|
|
290
|
+
/**
|
|
291
|
+
* Prevent forgetting compare function when sorting numbers, as `sort`
|
|
292
|
+
* defaults to string comparison.
|
|
293
|
+
*/
|
|
291
294
|
'@typescript-eslint/require-array-sort-compare': [
|
|
292
295
|
'error',
|
|
293
296
|
{ ignoreStringArrays: true },
|
|
@@ -295,9 +298,10 @@ export const typescriptEslintRules: TypeScriptEslintRules = {
|
|
|
295
298
|
'@typescript-eslint/require-await': 'error',
|
|
296
299
|
|
|
297
300
|
/**
|
|
298
|
-
* `+`
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
+
* Used to avoid ambiguity with `+` operator. restrict-plus-operands limits
|
|
302
|
+
* usage to only bigint, number, string types, and prefer-template prohibits
|
|
303
|
+
* using `+` for string concatenation. Fix: Use template literals or join
|
|
304
|
+
* string arrays with `join("")`.
|
|
301
305
|
*
|
|
302
306
|
* - A + b -> `${a}${b}`
|
|
303
307
|
* - S_1 + s_2 + ... + s_n -> [s_1, ..., s_n].join("")
|
|
@@ -328,15 +332,15 @@ export const typescriptEslintRules: TypeScriptEslintRules = {
|
|
|
328
332
|
'@typescript-eslint/return-await': 'error',
|
|
329
333
|
|
|
330
334
|
/**
|
|
331
|
-
*
|
|
332
|
-
*
|
|
335
|
+
* Used to avoid implicit casting to Boolean. Prevents overlooking that
|
|
336
|
+
* numbers `0`, `NaN` and string `""` are treated as false in conditionals.
|
|
333
337
|
*/
|
|
334
338
|
'@typescript-eslint/strict-boolean-expressions': [
|
|
335
339
|
'error',
|
|
336
340
|
{ allowString: false, allowNumber: false, allowNullableObject: false },
|
|
337
341
|
],
|
|
338
342
|
|
|
339
|
-
/**
|
|
343
|
+
/** Prevent missing switch cases (using type information) */
|
|
340
344
|
'@typescript-eslint/switch-exhaustiveness-check': [
|
|
341
345
|
'error',
|
|
342
346
|
{
|
|
@@ -389,14 +393,14 @@ export const typescriptEslintRules: TypeScriptEslintRules = {
|
|
|
389
393
|
'@typescript-eslint/no-unnecessary-parameter-property-assignment': 'error',
|
|
390
394
|
'@typescript-eslint/no-unnecessary-template-expression': 'error',
|
|
391
395
|
|
|
392
|
-
//
|
|
396
|
+
// Off temporarily due to bug causing infinite loop with recursive types
|
|
393
397
|
'@typescript-eslint/no-unnecessary-type-parameters': 'off',
|
|
394
398
|
|
|
395
399
|
'@typescript-eslint/no-unsafe-function-type': 'error',
|
|
396
400
|
'@typescript-eslint/no-wrapper-object-types': 'error',
|
|
397
401
|
'@typescript-eslint/no-deprecated': 'error',
|
|
398
402
|
|
|
399
|
-
// total-functions/no-unsafe-type-assertion
|
|
403
|
+
// Off as total-functions/no-unsafe-type-assertion provides stricter checking
|
|
400
404
|
'@typescript-eslint/no-unsafe-type-assertion': 'off',
|
|
401
405
|
|
|
402
406
|
'@typescript-eslint/related-getter-setter-pairs': 'error',
|