@perfective/eslint-config 0.29.2 → 0.31.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/LICENSE +1 -1
- package/README.adoc +198 -67
- package/README.md +62 -45
- package/config/array-func/array-func-config.d.ts +2 -0
- package/config/array-func/array-func-config.js +16 -0
- package/config/cypress/cypress-config.d.ts +10 -0
- package/config/cypress/cypress-config.js +38 -0
- package/config/cypress/index.d.ts +1 -0
- package/config/cypress/index.js +1 -0
- package/config/eslint/eslint-config.d.ts +2 -0
- package/config/eslint/eslint-config.js +8 -0
- package/config/eslint/layout-formatting-rules.d.ts +2 -0
- package/config/eslint/layout-formatting-rules.js +64 -0
- package/config/eslint/possible-problems-rules.d.ts +2 -0
- package/config/eslint/possible-problems-rules.js +96 -0
- package/config/eslint/suggestions-rules.d.ts +2 -0
- package/config/eslint/suggestions-rules.js +181 -0
- package/config/eslint-comments/best-practices-rules.d.ts +2 -0
- package/config/eslint-comments/best-practices-rules.js +8 -0
- package/config/eslint-comments/eslint-comments-config.d.ts +2 -0
- package/config/eslint-comments/eslint-comments-config.js +11 -0
- package/config/eslint-comments/stylistic-issues-rules.d.ts +2 -0
- package/config/eslint-comments/stylistic-issues-rules.js +9 -0
- package/config/import/helpful-warnings-rules.d.ts +2 -0
- package/config/import/helpful-warnings-rules.js +11 -0
- package/config/import/import-config.d.ts +4 -0
- package/config/import/import-config.js +46 -0
- package/config/import/index.d.ts +1 -0
- package/config/import/index.js +1 -0
- package/config/import/module-systems-rules.d.ts +2 -0
- package/config/import/module-systems-rules.js +10 -0
- package/config/import/rules/no-extraneous-dependencies.d.ts +15 -0
- package/config/import/rules/no-extraneous-dependencies.js +8 -0
- package/config/import/static-analysis-rules.d.ts +2 -0
- package/config/import/static-analysis-rules.js +26 -0
- package/config/import/style-guide-rules.d.ts +2 -0
- package/config/import/style-guide-rules.js +33 -0
- package/config/jest/index.d.ts +1 -0
- package/config/jest/index.js +1 -0
- package/config/jest/jest-config.d.ts +8 -0
- package/config/jest/jest-config.js +128 -0
- package/config/jest/typescript-eslint-jest-rules.d.ts +2 -0
- package/config/jest/typescript-eslint-jest-rules.js +5 -0
- package/config/jest-dom/index.d.ts +1 -0
- package/config/jest-dom/index.js +1 -0
- package/config/jest-dom/jest-dom-config.d.ts +8 -0
- package/config/jest-dom/jest-dom-config.js +23 -0
- package/config/jsdoc/jsdoc-config.d.ts +3 -0
- package/config/jsdoc/jsdoc-config.js +179 -0
- package/config/node/node-config.d.ts +2 -0
- package/config/node/node-config.js +66 -0
- package/config/perfective-eslint-config.d.ts +6 -0
- package/config/perfective-eslint-config.js +45 -0
- package/config/prefer-arrow/prefer-arrow-config.d.ts +2 -0
- package/config/prefer-arrow/prefer-arrow-config.js +16 -0
- package/config/promise/promise-config.d.ts +2 -0
- package/config/promise/promise-config.js +37 -0
- package/config/rxjs/index.d.ts +1 -0
- package/config/rxjs/index.js +1 -0
- package/config/rxjs/rxjs-config.d.ts +8 -0
- package/config/rxjs/rxjs-config.js +67 -0
- package/config/security/security-config.d.ts +2 -0
- package/config/security/security-config.js +24 -0
- package/config/simple-import-sort/index.d.ts +1 -0
- package/config/simple-import-sort/index.js +1 -0
- package/config/simple-import-sort/rules/imports.d.ts +28 -0
- package/config/simple-import-sort/rules/imports.js +32 -0
- package/config/simple-import-sort/simple-import-sort-config.d.ts +2 -0
- package/config/simple-import-sort/simple-import-sort-config.js +13 -0
- package/config/stylistic/js/stylistic-js-config.d.ts +2 -0
- package/config/stylistic/js/stylistic-js-config.js +200 -0
- package/config/stylistic/jsx/stylistic-jsx-config.d.ts +2 -0
- package/config/stylistic/jsx/stylistic-jsx-config.js +87 -0
- package/config/stylistic/plus/stylistic-plus-config.d.ts +2 -0
- package/config/stylistic/plus/stylistic-plus-config.js +16 -0
- package/config/stylistic/ts/stylistic-ts-config.d.ts +2 -0
- package/config/stylistic/ts/stylistic-ts-config.js +141 -0
- package/config/testing-library/index.d.ts +1 -0
- package/config/testing-library/index.js +1 -0
- package/config/testing-library/testing-library-config.d.ts +8 -0
- package/config/testing-library/testing-library-config.js +45 -0
- package/config/typescript-eslint/extension-rules.d.ts +2 -0
- package/config/typescript-eslint/extension-rules.js +113 -0
- package/config/typescript-eslint/index.d.ts +1 -0
- package/config/typescript-eslint/index.js +1 -0
- package/{rules → config}/typescript-eslint/rules/typescript-eslint-naming-convention.d.ts +39 -0
- package/config/typescript-eslint/rules/typescript-eslint-naming-convention.js +26 -0
- package/config/typescript-eslint/supported-rules.d.ts +2 -0
- package/config/typescript-eslint/supported-rules.js +260 -0
- package/config/typescript-eslint/typescript-eslint-config.d.ts +2 -0
- package/config/typescript-eslint/typescript-eslint-config.js +15 -0
- package/config/unicorn/index.d.ts +1 -0
- package/config/unicorn/index.js +1 -0
- package/{rules → config}/unicorn/rules/prevent-abbreviations.d.ts +20 -0
- package/config/unicorn/rules/prevent-abbreviations.js +30 -0
- package/config/unicorn/unicorn-config.d.ts +2 -0
- package/config/unicorn/unicorn-config.js +185 -0
- package/index.d.ts +5 -1732
- package/index.js +5 -146
- package/linter/glob.d.ts +59 -0
- package/linter/glob.js +8 -0
- package/linter/language-options.d.ts +25 -0
- package/linter/language-options.js +45 -0
- package/linter/linter-config.d.ts +13 -0
- package/linter/linter-config.js +6 -0
- package/linter/node.d.ts +10 -0
- package/linter/node.js +7 -0
- package/linter/plugin.d.ts +15 -0
- package/linter/plugin.js +26 -0
- package/package.json +45 -45
- package/config/node.d.ts +0 -1
- package/config/node.js +0 -11
- package/config/plugin.d.ts +0 -2
- package/config/plugin.js +0 -30
- package/config.d.ts +0 -1
- package/config.js +0 -6
- package/cypress.d.ts +0 -1
- package/cypress.js +0 -56
- package/jest-dom.d.ts +0 -1
- package/jest-dom.js +0 -11
- package/jest.d.ts +0 -1
- package/jest.js +0 -24
- package/rules/array-func/index.d.ts +0 -14
- package/rules/array-func/index.js +0 -50
- package/rules/cypress/index.d.ts +0 -21
- package/rules/cypress/index.js +0 -57
- package/rules/eslint/index.d.ts +0 -339
- package/rules/eslint/index.js +0 -9
- package/rules/eslint/layout-formatting.d.ts +0 -64
- package/rules/eslint/layout-formatting.js +0 -67
- package/rules/eslint/possible-problems.d.ts +0 -96
- package/rules/eslint/possible-problems.js +0 -99
- package/rules/eslint/suggestions.d.ts +0 -181
- package/rules/eslint/suggestions.js +0 -182
- package/rules/eslint-comments/best-practices.d.ts +0 -8
- package/rules/eslint-comments/best-practices.js +0 -11
- package/rules/eslint-comments/index.d.ts +0 -21
- package/rules/eslint-comments/index.js +0 -45
- package/rules/eslint-comments/stylistic-issues.d.ts +0 -9
- package/rules/eslint-comments/stylistic-issues.js +0 -18
- package/rules/import/helpful-warnings.d.ts +0 -10
- package/rules/import/helpful-warnings.js +0 -14
- package/rules/import/index.d.ts +0 -78
- package/rules/import/index.js +0 -14
- package/rules/import/module-systems.d.ts +0 -10
- package/rules/import/module-systems.js +0 -13
- package/rules/import/rules/no-extraneous-dependencies.d.ts +0 -11
- package/rules/import/rules/no-extraneous-dependencies.js +0 -24
- package/rules/import/static-analysis.d.ts +0 -26
- package/rules/import/static-analysis.js +0 -29
- package/rules/import/style-guide.d.ts +0 -33
- package/rules/import/style-guide.js +0 -36
- package/rules/jest/index.d.ts +0 -124
- package/rules/jest/index.js +0 -72
- package/rules/jest/typescript-eslint.d.ts +0 -5
- package/rules/jest/typescript-eslint.js +0 -8
- package/rules/jest-dom/index.d.ts +0 -32
- package/rules/jest-dom/index.js +0 -55
- package/rules/jsdoc/index.d.ts +0 -134
- package/rules/jsdoc/index.js +0 -347
- package/rules/n/index.d.ts +0 -66
- package/rules/n/index.js +0 -98
- package/rules/prefer-arrow/index.d.ts +0 -14
- package/rules/prefer-arrow/index.js +0 -50
- package/rules/promise/index.d.ts +0 -35
- package/rules/promise/index.js +0 -73
- package/rules/rxjs/index.d.ts +0 -60
- package/rules/rxjs/index.js +0 -96
- package/rules/security/index.d.ts +0 -22
- package/rules/security/index.js +0 -58
- package/rules/simple-import-sort/index.d.ts +0 -10
- package/rules/simple-import-sort/index.js +0 -48
- package/rules/simple-import-sort/rules/imports.d.ts +0 -8
- package/rules/simple-import-sort/rules/imports.js +0 -46
- package/rules/stylistic/js/index.d.ts +0 -197
- package/rules/stylistic/js/index.js +0 -236
- package/rules/stylistic/jsx/index.d.ts +0 -81
- package/rules/stylistic/jsx/index.js +0 -117
- package/rules/stylistic/plus/index.d.ts +0 -14
- package/rules/stylistic/plus/index.js +0 -50
- package/rules/stylistic/ts/index.d.ts +0 -135
- package/rules/stylistic/ts/index.js +0 -169
- package/rules/testing-library/index.d.ts +0 -62
- package/rules/testing-library/index.js +0 -77
- package/rules/typescript-eslint/extension-rules.d.ts +0 -113
- package/rules/typescript-eslint/extension-rules.js +0 -116
- package/rules/typescript-eslint/index.d.ts +0 -369
- package/rules/typescript-eslint/index.js +0 -45
- package/rules/typescript-eslint/rules/typescript-eslint-naming-convention.js +0 -32
- package/rules/typescript-eslint/supported-rules.d.ts +0 -253
- package/rules/typescript-eslint/supported-rules.js +0 -319
- package/rules/unicorn/index.d.ts +0 -178
- package/rules/unicorn/index.js +0 -209
- package/rules/unicorn/rules/prevent-abbreviations.js +0 -8
- package/rules.d.ts +0 -4
- package/rules.js +0 -14
- package/rxjs.d.ts +0 -1
- package/rxjs.js +0 -58
- package/testing-library.d.ts +0 -1
- package/testing-library.js +0 -11
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export const eslintPossibleProblemsRules = {
|
|
2
|
+
'array-callback-return': ['error', {
|
|
3
|
+
allowImplicit: true,
|
|
4
|
+
checkForEach: false,
|
|
5
|
+
allowVoid: false
|
|
6
|
+
}],
|
|
7
|
+
'constructor-super': 'error',
|
|
8
|
+
'for-direction': 'error',
|
|
9
|
+
'getter-return': 'error',
|
|
10
|
+
'no-async-promise-executor': 'error',
|
|
11
|
+
'no-await-in-loop': 'error',
|
|
12
|
+
'no-class-assign': 'error',
|
|
13
|
+
'no-compare-neg-zero': 'error',
|
|
14
|
+
'no-cond-assign': ['error', 'always'],
|
|
15
|
+
'no-const-assign': 'error',
|
|
16
|
+
'no-constant-binary-expression': 'error',
|
|
17
|
+
'no-constant-condition': 'error',
|
|
18
|
+
'no-constructor-return': 'error',
|
|
19
|
+
'no-control-regex': 'error',
|
|
20
|
+
'no-debugger': 'error',
|
|
21
|
+
'no-dupe-args': 'error',
|
|
22
|
+
'no-dupe-class-members': 'error',
|
|
23
|
+
'no-dupe-else-if': 'error',
|
|
24
|
+
'no-dupe-keys': 'error',
|
|
25
|
+
'no-duplicate-case': 'error',
|
|
26
|
+
'no-duplicate-imports': ['off', {
|
|
27
|
+
includeExports: true
|
|
28
|
+
}],
|
|
29
|
+
'no-empty-character-class': 'error',
|
|
30
|
+
'no-empty-pattern': 'error',
|
|
31
|
+
'no-ex-assign': 'error',
|
|
32
|
+
'no-fallthrough': ['error', {
|
|
33
|
+
allowEmptyCase: false,
|
|
34
|
+
reportUnusedFallthroughComment: true
|
|
35
|
+
}],
|
|
36
|
+
'no-func-assign': 'error',
|
|
37
|
+
'no-import-assign': 'error',
|
|
38
|
+
'no-inner-declarations': 'error',
|
|
39
|
+
'no-invalid-regexp': 'error',
|
|
40
|
+
'no-irregular-whitespace': ['error', {
|
|
41
|
+
skipStrings: false,
|
|
42
|
+
skipComments: false,
|
|
43
|
+
skipRegExps: false,
|
|
44
|
+
skipTemplates: false,
|
|
45
|
+
skipJSXText: false
|
|
46
|
+
}],
|
|
47
|
+
'no-loss-of-precision': 'error',
|
|
48
|
+
'no-misleading-character-class': ['error', {
|
|
49
|
+
allowEscape: false
|
|
50
|
+
}],
|
|
51
|
+
'no-new-native-nonconstructor': 'error',
|
|
52
|
+
'no-new-symbol': 'error',
|
|
53
|
+
'no-obj-calls': 'error',
|
|
54
|
+
'no-promise-executor-return': 'error',
|
|
55
|
+
'no-prototype-builtins': 'error',
|
|
56
|
+
'no-self-assign': 'error',
|
|
57
|
+
'no-self-compare': 'error',
|
|
58
|
+
'no-setter-return': 'error',
|
|
59
|
+
'no-sparse-arrays': 'error',
|
|
60
|
+
'no-template-curly-in-string': 'error',
|
|
61
|
+
'no-this-before-super': 'error',
|
|
62
|
+
'no-undef': 'off',
|
|
63
|
+
'no-unexpected-multiline': 'error',
|
|
64
|
+
'no-unmodified-loop-condition': 'error',
|
|
65
|
+
'no-unreachable': 'error',
|
|
66
|
+
'no-unreachable-loop': 'error',
|
|
67
|
+
'no-unsafe-finally': 'error',
|
|
68
|
+
'no-unsafe-negation': 'error',
|
|
69
|
+
'no-unsafe-optional-chaining': 'error',
|
|
70
|
+
'no-unused-private-class-members': 'error',
|
|
71
|
+
'no-unused-vars': ['error', {
|
|
72
|
+
args: 'after-used',
|
|
73
|
+
argsIgnorePattern: '^_',
|
|
74
|
+
caughtErrors: 'all',
|
|
75
|
+
destructuredArrayIgnorePattern: '^_',
|
|
76
|
+
ignoreClassWithStaticInitBlock: false,
|
|
77
|
+
ignoreRestSiblings: false,
|
|
78
|
+
reportUsedIgnorePattern: false,
|
|
79
|
+
vars: 'all'
|
|
80
|
+
}],
|
|
81
|
+
'no-use-before-define': ['error', {
|
|
82
|
+
functions: false,
|
|
83
|
+
classes: false,
|
|
84
|
+
variables: false,
|
|
85
|
+
allowNamedExports: false
|
|
86
|
+
}],
|
|
87
|
+
'no-useless-backreference': 'error',
|
|
88
|
+
'no-useless-assignment': 'error',
|
|
89
|
+
'require-atomic-updates': ['error', {
|
|
90
|
+
allowProperties: false
|
|
91
|
+
}],
|
|
92
|
+
'use-isnan': 'error',
|
|
93
|
+
'valid-typeof': ['error', {
|
|
94
|
+
requireStringLiterals: true
|
|
95
|
+
}]
|
|
96
|
+
};
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
export const eslintSuggestionsRules = {
|
|
2
|
+
'accessor-pairs': 'error',
|
|
3
|
+
'arrow-body-style': ['warn', 'as-needed'],
|
|
4
|
+
'block-scoped-var': 'error',
|
|
5
|
+
'camelcase': 'off',
|
|
6
|
+
'capitalized-comments': ['warn', 'always', {
|
|
7
|
+
ignorePattern: 'eslint|tslint',
|
|
8
|
+
ignoreConsecutiveComments: true
|
|
9
|
+
}],
|
|
10
|
+
'class-methods-use-this': 'off',
|
|
11
|
+
'complexity': ['error', 3],
|
|
12
|
+
'consistent-return': 'error',
|
|
13
|
+
'consistent-this': ['error', 'self'],
|
|
14
|
+
'curly': ['warn', 'all'],
|
|
15
|
+
'default-case': 'error',
|
|
16
|
+
'default-case-last': 'error',
|
|
17
|
+
'default-param-last': 'error',
|
|
18
|
+
'dot-notation': ['warn', {
|
|
19
|
+
allowKeywords: true
|
|
20
|
+
}],
|
|
21
|
+
'eqeqeq': ['warn', 'always'],
|
|
22
|
+
'func-name-matching': ['error', 'always'],
|
|
23
|
+
'func-names': ['error', 'always'],
|
|
24
|
+
'func-style': ['error', 'declaration'],
|
|
25
|
+
'grouped-accessor-pairs': ['error', 'setBeforeGet'],
|
|
26
|
+
'guard-for-in': 'error',
|
|
27
|
+
'id-denylist': ['error', 'arr', 'ctx', 'el', 'elem', 'err', 'ind', 'ptr'],
|
|
28
|
+
'id-length': 'off',
|
|
29
|
+
'id-match': 'off',
|
|
30
|
+
'init-declarations': ['error', 'always'],
|
|
31
|
+
'logical-assignment-operators': ['warn', 'always', {
|
|
32
|
+
enforceForIfStatements: true
|
|
33
|
+
}],
|
|
34
|
+
'max-classes-per-file': ['error', 1],
|
|
35
|
+
'max-depth': ['error', 4],
|
|
36
|
+
'max-lines': 'off',
|
|
37
|
+
'max-lines-per-function': 'off',
|
|
38
|
+
'max-nested-callbacks': ['error', 2],
|
|
39
|
+
'max-params': ['off', {
|
|
40
|
+
max: 3
|
|
41
|
+
}],
|
|
42
|
+
'max-statements': ['off', {
|
|
43
|
+
max: 10
|
|
44
|
+
}],
|
|
45
|
+
'multiline-comment-style': 'off',
|
|
46
|
+
'new-cap': ['error', {
|
|
47
|
+
newIsCap: true,
|
|
48
|
+
capIsNew: true,
|
|
49
|
+
properties: true
|
|
50
|
+
}],
|
|
51
|
+
'no-alert': 'error',
|
|
52
|
+
'no-array-constructor': 'error',
|
|
53
|
+
'no-bitwise': 'error',
|
|
54
|
+
'no-caller': 'error',
|
|
55
|
+
'no-case-declarations': 'error',
|
|
56
|
+
'no-confusing-arrow': 'off',
|
|
57
|
+
'no-console': 'error',
|
|
58
|
+
'no-continue': 'error',
|
|
59
|
+
'no-delete-var': 'error',
|
|
60
|
+
'no-div-regex': 'warn',
|
|
61
|
+
'no-else-return': ['warn', {
|
|
62
|
+
allowElseIf: false
|
|
63
|
+
}],
|
|
64
|
+
'no-empty': 'error',
|
|
65
|
+
'no-empty-function': 'error',
|
|
66
|
+
'no-empty-static-block': 'error',
|
|
67
|
+
'no-eq-null': 'error',
|
|
68
|
+
'no-eval': 'error',
|
|
69
|
+
'no-extend-native': 'error',
|
|
70
|
+
'no-extra-bind': 'warn',
|
|
71
|
+
'no-extra-boolean-cast': ['warn', {
|
|
72
|
+
enforceForInnerExpressions: true
|
|
73
|
+
}],
|
|
74
|
+
'no-extra-label': 'warn',
|
|
75
|
+
'no-extra-semi': 'off',
|
|
76
|
+
'no-floating-decimal': 'off',
|
|
77
|
+
'no-global-assign': 'error',
|
|
78
|
+
'no-implicit-coercion': 'warn',
|
|
79
|
+
'no-implicit-globals': 'error',
|
|
80
|
+
'no-implied-eval': 'error',
|
|
81
|
+
'no-inline-comments': ['error', {
|
|
82
|
+
ignorePattern: '^ == .+'
|
|
83
|
+
}],
|
|
84
|
+
'no-invalid-this': 'error',
|
|
85
|
+
'no-iterator': 'error',
|
|
86
|
+
'no-label-var': 'error',
|
|
87
|
+
'no-labels': 'error',
|
|
88
|
+
'no-lone-blocks': 'error',
|
|
89
|
+
'no-lonely-if': 'warn',
|
|
90
|
+
'no-loop-func': 'error',
|
|
91
|
+
'no-magic-numbers': 'off',
|
|
92
|
+
'no-mixed-operators': 'off',
|
|
93
|
+
'no-multi-assign': 'error',
|
|
94
|
+
'no-multi-str': 'error',
|
|
95
|
+
'no-negated-condition': 'off',
|
|
96
|
+
'no-nested-ternary': 'error',
|
|
97
|
+
'no-new': 'error',
|
|
98
|
+
'no-new-func': 'error',
|
|
99
|
+
'no-new-object': 'off',
|
|
100
|
+
'no-new-wrappers': 'error',
|
|
101
|
+
'no-nonoctal-decimal-escape': 'error',
|
|
102
|
+
'no-object-constructor': 'error',
|
|
103
|
+
'no-octal': 'error',
|
|
104
|
+
'no-octal-escape': 'error',
|
|
105
|
+
'no-param-reassign': 'error',
|
|
106
|
+
'no-plusplus': ['error', {
|
|
107
|
+
allowForLoopAfterthoughts: true
|
|
108
|
+
}],
|
|
109
|
+
'no-proto': 'error',
|
|
110
|
+
'no-redeclare': 'error',
|
|
111
|
+
'no-regex-spaces': 'warn',
|
|
112
|
+
'no-restricted-exports': 'off',
|
|
113
|
+
'no-restricted-globals': 'error',
|
|
114
|
+
'no-restricted-imports': 'error',
|
|
115
|
+
'no-restricted-properties': 'error',
|
|
116
|
+
'no-restricted-syntax': ['error', 'ForInStatement'],
|
|
117
|
+
'no-return-assign': 'error',
|
|
118
|
+
'no-script-url': 'error',
|
|
119
|
+
'no-sequences': ['error', {
|
|
120
|
+
allowInParentheses: false
|
|
121
|
+
}],
|
|
122
|
+
'no-shadow': 'off',
|
|
123
|
+
'no-shadow-restricted-names': 'error',
|
|
124
|
+
'no-ternary': 'off',
|
|
125
|
+
'no-throw-literal': 'error',
|
|
126
|
+
'no-undef-init': 'warn',
|
|
127
|
+
'no-undefined': 'off',
|
|
128
|
+
'no-underscore-dangle': ['error', {
|
|
129
|
+
allowAfterSuper: false,
|
|
130
|
+
allowAfterThis: true,
|
|
131
|
+
allowAfterThisConstructor: false,
|
|
132
|
+
allowFunctionParams: true,
|
|
133
|
+
enforceInMethodNames: true,
|
|
134
|
+
enforceInClassFields: true
|
|
135
|
+
}],
|
|
136
|
+
'no-unneeded-ternary': 'warn',
|
|
137
|
+
'no-unused-expressions': 'error',
|
|
138
|
+
'no-unused-labels': 'warn',
|
|
139
|
+
'no-useless-call': 'error',
|
|
140
|
+
'no-useless-catch': 'error',
|
|
141
|
+
'no-useless-computed-key': 'warn',
|
|
142
|
+
'no-useless-concat': 'error',
|
|
143
|
+
'no-useless-constructor': 'error',
|
|
144
|
+
'no-useless-escape': 'error',
|
|
145
|
+
'no-useless-rename': 'warn',
|
|
146
|
+
'no-useless-return': 'warn',
|
|
147
|
+
'no-var': 'warn',
|
|
148
|
+
'no-void': 'error',
|
|
149
|
+
'no-warning-comments': 'off',
|
|
150
|
+
'no-with': 'error',
|
|
151
|
+
'object-shorthand': ['warn', 'always'],
|
|
152
|
+
'one-var': ['warn', 'never'],
|
|
153
|
+
'one-var-declaration-per-line': 'off',
|
|
154
|
+
'operator-assignment': ['warn', 'always'],
|
|
155
|
+
'prefer-arrow-callback': 'warn',
|
|
156
|
+
'prefer-const': 'warn',
|
|
157
|
+
'prefer-destructuring': 'off',
|
|
158
|
+
'prefer-exponentiation-operator': 'warn',
|
|
159
|
+
'prefer-named-capture-group': 'off',
|
|
160
|
+
'prefer-numeric-literals': 'warn',
|
|
161
|
+
'prefer-object-has-own': 'off',
|
|
162
|
+
'prefer-object-spread': 'warn',
|
|
163
|
+
'prefer-promise-reject-errors': 'error',
|
|
164
|
+
'prefer-regex-literals': 'off',
|
|
165
|
+
'prefer-rest-params': 'error',
|
|
166
|
+
'prefer-spread': 'error',
|
|
167
|
+
'prefer-template': 'warn',
|
|
168
|
+
'quote-props': 'off',
|
|
169
|
+
'radix': 'error',
|
|
170
|
+
'require-await': 'error',
|
|
171
|
+
'require-unicode-regexp': 'error',
|
|
172
|
+
'require-yield': 'error',
|
|
173
|
+
'sort-imports': 'off',
|
|
174
|
+
'sort-keys': 'off',
|
|
175
|
+
'sort-vars': 'off',
|
|
176
|
+
'spaced-comment': 'off',
|
|
177
|
+
'strict': 'warn',
|
|
178
|
+
'symbol-description': 'error',
|
|
179
|
+
'vars-on-top': 'error',
|
|
180
|
+
'yoda': ['warn', 'never']
|
|
181
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const bestPracticesRules = {
|
|
2
|
+
'eslint-comments/disable-enable-pair': 'error',
|
|
3
|
+
'eslint-comments/no-aggregating-enable': 'error',
|
|
4
|
+
'eslint-comments/no-duplicate-disable': 'error',
|
|
5
|
+
'eslint-comments/no-unlimited-disable': 'error',
|
|
6
|
+
'eslint-comments/no-unused-disable': 'error',
|
|
7
|
+
'eslint-comments/no-unused-enable': 'error'
|
|
8
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import eslintPluginEslintComments from '@eslint-community/eslint-plugin-eslint-comments';
|
|
2
|
+
import { bestPracticesRules } from "./best-practices-rules.js";
|
|
3
|
+
import { stylisticIssuesRules } from "./stylistic-issues-rules.js";
|
|
4
|
+
export function eslintCommentsConfig() {
|
|
5
|
+
return {
|
|
6
|
+
plugins: {
|
|
7
|
+
'eslint-comments': eslintPluginEslintComments
|
|
8
|
+
},
|
|
9
|
+
rules: Object.assign(Object.assign({}, bestPracticesRules), stylisticIssuesRules)
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const stylisticIssuesRules = {
|
|
2
|
+
'eslint-comments/no-restricted-disable': 'off',
|
|
3
|
+
'eslint-comments/no-use': ['error', {
|
|
4
|
+
allow: ['eslint-disable', 'eslint-disable-next-line', 'eslint-enable']
|
|
5
|
+
}],
|
|
6
|
+
'eslint-comments/require-description': ['error', {
|
|
7
|
+
ignore: ['eslint-enable']
|
|
8
|
+
}]
|
|
9
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { importNoExtraneousDependencies } from "./rules/no-extraneous-dependencies.js";
|
|
2
|
+
export const helpfulWarningsRules = {
|
|
3
|
+
'import/export': 'error',
|
|
4
|
+
'import/no-deprecated': 'off',
|
|
5
|
+
'import/no-empty-named-blocks': 'warn',
|
|
6
|
+
'import/no-extraneous-dependencies': ['error', importNoExtraneousDependencies()],
|
|
7
|
+
'import/no-mutable-exports': 'error',
|
|
8
|
+
'import/no-named-as-default': 'error',
|
|
9
|
+
'import/no-named-as-default-member': 'error',
|
|
10
|
+
'import/no-unused-modules': 'error'
|
|
11
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { flatConfigs } from 'eslint-plugin-import';
|
|
2
|
+
import { javascriptFiles, typescriptFiles } from "../../linter/glob.js";
|
|
3
|
+
import { javascriptLanguageOptions, typescriptLanguageOptions } from "../../linter/language-options.js";
|
|
4
|
+
import { helpfulWarningsRules } from "./helpful-warnings-rules.js";
|
|
5
|
+
import { moduleSystemsRules } from "./module-systems-rules.js";
|
|
6
|
+
import { staticAnalysisRules } from "./static-analysis-rules.js";
|
|
7
|
+
import { styleGuideRules } from "./style-guide-rules.js";
|
|
8
|
+
export function importConfig() {
|
|
9
|
+
return {
|
|
10
|
+
plugins: {
|
|
11
|
+
import: flatConfigs.recommended.plugins.import
|
|
12
|
+
},
|
|
13
|
+
rules: Object.assign(Object.assign(Object.assign(Object.assign({}, staticAnalysisRules), helpfulWarningsRules), moduleSystemsRules), styleGuideRules)
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function importJavascriptConfig() {
|
|
17
|
+
return {
|
|
18
|
+
files: javascriptFiles,
|
|
19
|
+
languageOptions: javascriptLanguageOptions(),
|
|
20
|
+
plugins: {},
|
|
21
|
+
settings: {
|
|
22
|
+
'import/extensions': ['.js', '.jsx']
|
|
23
|
+
},
|
|
24
|
+
rules: {
|
|
25
|
+
'import/no-commonjs': 'off',
|
|
26
|
+
'import/unambiguous': 'off'
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export function importTypescriptConfig() {
|
|
31
|
+
return {
|
|
32
|
+
files: typescriptFiles,
|
|
33
|
+
languageOptions: typescriptLanguageOptions(),
|
|
34
|
+
settings: {
|
|
35
|
+
'import/parsers': {
|
|
36
|
+
'@typescript-eslint/parser': ['.ts', '.tsx']
|
|
37
|
+
},
|
|
38
|
+
'import/resolver': {
|
|
39
|
+
typescript: {
|
|
40
|
+
alwaysTryTypes: true,
|
|
41
|
+
project: './tsconfig.json'
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ImportNoExtraneousDependencies, importNoExtraneousDependencies, } from './rules/no-extraneous-dependencies';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { importNoExtraneousDependencies } from "./rules/no-extraneous-dependencies.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const moduleSystemsRules = {
|
|
2
|
+
'import/no-amd': 'error',
|
|
3
|
+
'import/no-commonjs': ['error', {
|
|
4
|
+
allowConditionalRequire: true,
|
|
5
|
+
allowPrimitiveModules: true
|
|
6
|
+
}],
|
|
7
|
+
'import/no-import-module-exports': 'error',
|
|
8
|
+
'import/no-nodejs-modules': 'off',
|
|
9
|
+
'import/unambiguous': 'error'
|
|
10
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Glob } from '../../../linter/glob';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration options for the `import/no-extraneous-dependencies` rule.
|
|
4
|
+
*/
|
|
5
|
+
export interface ImportNoExtraneousDependencies {
|
|
6
|
+
devDependencies: boolean | Glob[];
|
|
7
|
+
optionalDependencies: boolean | Glob[];
|
|
8
|
+
peerDependencies: boolean | Glob[];
|
|
9
|
+
bundledDependencies: boolean | Glob[];
|
|
10
|
+
packageDir?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Returns configuration for the `import/no-extraneous-dependencies` rule.
|
|
14
|
+
*/
|
|
15
|
+
export declare function importNoExtraneousDependencies(overrides?: Partial<ImportNoExtraneousDependencies>): ImportNoExtraneousDependencies;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const staticAnalysisRules = {
|
|
2
|
+
'import/default': 'error',
|
|
3
|
+
'import/named': ['error', {
|
|
4
|
+
commonjs: false
|
|
5
|
+
}],
|
|
6
|
+
'import/namespace': 'error',
|
|
7
|
+
'import/no-absolute-path': 'error',
|
|
8
|
+
'import/no-cycle': ['error', {
|
|
9
|
+
ignoreExternal: true,
|
|
10
|
+
allowUnsafeDynamicCyclicDependency: false
|
|
11
|
+
}],
|
|
12
|
+
'import/no-dynamic-require': ['error', {
|
|
13
|
+
esmodule: true
|
|
14
|
+
}],
|
|
15
|
+
'import/no-internal-modules': 'off',
|
|
16
|
+
'import/no-relative-packages': 'warn',
|
|
17
|
+
'import/no-relative-parent-imports': 'off',
|
|
18
|
+
'import/no-restricted-paths': 'off',
|
|
19
|
+
'import/no-self-import': 'error',
|
|
20
|
+
'import/no-unresolved': ['error', {
|
|
21
|
+
caseSensitive: true,
|
|
22
|
+
caseSensitiveStrict: true
|
|
23
|
+
}],
|
|
24
|
+
'import/no-useless-path-segments': 'warn',
|
|
25
|
+
'import/no-webpack-loader-syntax': 'error'
|
|
26
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const styleGuideRules = {
|
|
2
|
+
'import/consistent-type-specifier-style': ['warn', 'prefer-inline'],
|
|
3
|
+
'import/dynamic-import-chunkname': 'off',
|
|
4
|
+
'import/exports-last': 'off',
|
|
5
|
+
'import/extensions': ['error', 'never', {
|
|
6
|
+
checkTypeImports: true
|
|
7
|
+
}],
|
|
8
|
+
'import/first': 'off',
|
|
9
|
+
'import/group-exports': 'off',
|
|
10
|
+
'import/max-dependencies': 'off',
|
|
11
|
+
'import/newline-after-import': ['warn', {
|
|
12
|
+
considerComments: true
|
|
13
|
+
}],
|
|
14
|
+
'import/no-anonymous-default-export': 'error',
|
|
15
|
+
'import/no-default-export': 'error',
|
|
16
|
+
'import/no-duplicates': ['warn', {
|
|
17
|
+
'considerQueryString': true,
|
|
18
|
+
'prefer-inline': true
|
|
19
|
+
}],
|
|
20
|
+
'import/no-named-default': 'error',
|
|
21
|
+
'import/no-named-export': 'off',
|
|
22
|
+
'import/no-namespace': 'off',
|
|
23
|
+
'import/no-unassigned-import': 'error',
|
|
24
|
+
'import/order': ['off', {
|
|
25
|
+
'groups': ['unknown', 'builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
|
|
26
|
+
'newlines-between': 'always',
|
|
27
|
+
'alphabetize': {
|
|
28
|
+
order: 'asc',
|
|
29
|
+
caseInsensitive: false
|
|
30
|
+
}
|
|
31
|
+
}],
|
|
32
|
+
'import/prefer-default-export': 'off'
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { jestConfig } from './jest-config';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { jestConfig } from "./jest-config.js";
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import eslintPluginJest from 'eslint-plugin-jest';
|
|
2
|
+
import { jestFiles } from "../../linter/glob.js";
|
|
3
|
+
import { importNoExtraneousDependencies } from "../import/index.js";
|
|
4
|
+
import { typescriptEslintJestRules } from "./typescript-eslint-jest-rules.js";
|
|
5
|
+
export function jestConfig(files = jestFiles) {
|
|
6
|
+
return {
|
|
7
|
+
files,
|
|
8
|
+
plugins: {
|
|
9
|
+
jest: eslintPluginJest
|
|
10
|
+
},
|
|
11
|
+
languageOptions: {
|
|
12
|
+
globals: eslintPluginJest.environments.globals.globals
|
|
13
|
+
},
|
|
14
|
+
rules: Object.assign(Object.assign(Object.assign({}, perfectiveRules()), typescriptEslintJestRules), {
|
|
15
|
+
'jest/consistent-test-it': ['warn', {
|
|
16
|
+
fn: 'test',
|
|
17
|
+
withinDescribe: 'it'
|
|
18
|
+
}],
|
|
19
|
+
'jest/expect-expect': ['error', {
|
|
20
|
+
assertFunctionNames: ['expect', 'request.*.expect'],
|
|
21
|
+
additionalTestBlockFunctions: []
|
|
22
|
+
}],
|
|
23
|
+
'jest/max-expects': ['error', {
|
|
24
|
+
max: 5
|
|
25
|
+
}],
|
|
26
|
+
'jest/max-nested-describe': ['error', {
|
|
27
|
+
max: 4
|
|
28
|
+
}],
|
|
29
|
+
'jest/no-alias-methods': 'warn',
|
|
30
|
+
'jest/no-commented-out-tests': 'error',
|
|
31
|
+
'jest/no-conditional-expect': 'error',
|
|
32
|
+
'jest/no-conditional-in-test': 'error',
|
|
33
|
+
'jest/no-confusing-set-timeout': 'error',
|
|
34
|
+
'jest/no-deprecated-functions': 'warn',
|
|
35
|
+
'jest/no-disabled-tests': 'error',
|
|
36
|
+
'jest/no-done-callback': 'error',
|
|
37
|
+
'jest/no-duplicate-hooks': 'error',
|
|
38
|
+
'jest/no-export': 'error',
|
|
39
|
+
'jest/no-focused-tests': 'warn',
|
|
40
|
+
'jest/no-hooks': 'off',
|
|
41
|
+
'jest/no-identical-title': 'error',
|
|
42
|
+
'jest/no-interpolation-in-snapshots': 'error',
|
|
43
|
+
'jest/no-jasmine-globals': 'warn',
|
|
44
|
+
'jest/no-large-snapshots': 'error',
|
|
45
|
+
'jest/no-mocks-import': 'error',
|
|
46
|
+
'jest/no-restricted-jest-methods': 'off',
|
|
47
|
+
'jest/no-restricted-matchers': ['error', {
|
|
48
|
+
toBeFalsy: 'Avoid `toBeFalsy`',
|
|
49
|
+
toBeTruthy: 'Avoid `toBeTruthy`',
|
|
50
|
+
toMatchSnapshot: 'Use `toMatchInlineSnapshot()` instead',
|
|
51
|
+
toThrowErrorMatchingSnapshot: 'Use `toThrowErrorMatchingInlineSnapshot()` instead'
|
|
52
|
+
}],
|
|
53
|
+
'jest/no-standalone-expect': 'error',
|
|
54
|
+
'jest/no-test-prefixes': 'warn',
|
|
55
|
+
'jest/no-test-return-statement': 'error',
|
|
56
|
+
'jest/no-untyped-mock-factory': 'warn',
|
|
57
|
+
'jest/padding-around-after-all-blocks': 'warn',
|
|
58
|
+
'jest/padding-around-after-each-blocks': 'warn',
|
|
59
|
+
'jest/padding-around-all': 'warn',
|
|
60
|
+
'jest/padding-around-before-all-blocks': 'warn',
|
|
61
|
+
'jest/padding-around-before-each-blocks': 'warn',
|
|
62
|
+
'jest/padding-around-describe-blocks': 'warn',
|
|
63
|
+
'jest/padding-around-expect-groups': 'warn',
|
|
64
|
+
'jest/padding-around-test-blocks': 'warn',
|
|
65
|
+
'jest/prefer-called-with': 'error',
|
|
66
|
+
'jest/prefer-comparison-matcher': 'warn',
|
|
67
|
+
'jest/prefer-each': 'error',
|
|
68
|
+
'jest/prefer-equality-matcher': 'error',
|
|
69
|
+
'jest/prefer-expect-assertions': 'off',
|
|
70
|
+
'jest/prefer-expect-resolves': 'warn',
|
|
71
|
+
'jest/prefer-hooks-in-order': 'error',
|
|
72
|
+
'jest/prefer-hooks-on-top': 'error',
|
|
73
|
+
'jest/prefer-importing-jest-globals': 'warn',
|
|
74
|
+
'jest/prefer-jest-mocked': 'warn',
|
|
75
|
+
'jest/prefer-lowercase-title': ['error', {
|
|
76
|
+
allowedPrefixes: [],
|
|
77
|
+
ignore: [],
|
|
78
|
+
ignoreTopLevelDescribe: true
|
|
79
|
+
}],
|
|
80
|
+
'jest/prefer-mock-promise-shorthand': 'warn',
|
|
81
|
+
'jest/prefer-snapshot-hint': ['error', 'always'],
|
|
82
|
+
'jest/prefer-spy-on': 'warn',
|
|
83
|
+
'jest/prefer-strict-equal': 'warn',
|
|
84
|
+
'jest/prefer-to-be': 'warn',
|
|
85
|
+
'jest/prefer-to-contain': 'warn',
|
|
86
|
+
'jest/prefer-to-have-length': 'warn',
|
|
87
|
+
'jest/prefer-todo': 'warn',
|
|
88
|
+
'jest/require-hook': ['error', {
|
|
89
|
+
allowedFunctionCalls: []
|
|
90
|
+
}],
|
|
91
|
+
'jest/require-to-throw-message': 'error',
|
|
92
|
+
'jest/require-top-level-describe': 'error',
|
|
93
|
+
'jest/valid-describe-callback': 'error',
|
|
94
|
+
'jest/valid-expect-in-promise': 'error',
|
|
95
|
+
'jest/valid-expect': 'error',
|
|
96
|
+
'jest/valid-title': ['warn', {
|
|
97
|
+
ignoreTypeOfDescribeName: true,
|
|
98
|
+
ignoreTypeOfTestName: false,
|
|
99
|
+
ignoreSpaces: false
|
|
100
|
+
}]
|
|
101
|
+
})
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function perfectiveRules() {
|
|
105
|
+
return {
|
|
106
|
+
'@typescript-eslint/ban-ts-comment': ['error', {
|
|
107
|
+
'ts-expect-error': 'allow-with-description',
|
|
108
|
+
'ts-ignore': true,
|
|
109
|
+
'ts-nocheck': true,
|
|
110
|
+
'ts-check': false
|
|
111
|
+
}],
|
|
112
|
+
'@typescript-eslint/init-declarations': 'off',
|
|
113
|
+
'@typescript-eslint/unbound-method': 'off',
|
|
114
|
+
'import/no-extraneous-dependencies': ['error', importNoExtraneousDependencies({
|
|
115
|
+
devDependencies: jestFiles
|
|
116
|
+
})],
|
|
117
|
+
'import/no-unassigned-import': ['error', {
|
|
118
|
+
allow: ['@testing-library/jest-dom', '@testing-library/jest-dom/extend-expect']
|
|
119
|
+
}],
|
|
120
|
+
'max-nested-callbacks': ['error', 6],
|
|
121
|
+
'n/no-unpublished-import': ['error', {
|
|
122
|
+
allowModules: ['@jest/globals']
|
|
123
|
+
}],
|
|
124
|
+
'prefer-arrow/prefer-arrow-functions': 'off',
|
|
125
|
+
'promise/always-return': 'off',
|
|
126
|
+
'@smarttools/rxjs/no-topromise': 'off'
|
|
127
|
+
};
|
|
128
|
+
}
|