@perfective/eslint-config 0.29.1 → 0.30.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 +24 -19
- package/README.md +20 -17
- package/config/node.d.ts +7 -0
- package/config/node.js +7 -11
- package/config/plugin.d.ts +9 -0
- package/config/plugin.js +22 -26
- package/config.js +1 -6
- package/cypress.d.ts +5 -0
- package/cypress.js +31 -58
- package/index.d.ts +58 -26
- package/index.js +100 -145
- package/jest-dom.js +8 -11
- package/jest.d.ts +6 -0
- package/jest.js +29 -24
- package/package.json +18 -18
- package/rules/array-func/index.d.ts +1 -2
- package/rules/array-func/index.js +14 -50
- package/rules/cypress/index.d.ts +11 -3
- package/rules/cypress/index.js +23 -57
- package/rules/eslint/index.js +6 -9
- package/rules/eslint/layout-formatting.js +64 -67
- package/rules/eslint/possible-problems.js +96 -99
- package/rules/eslint/suggestions.js +181 -182
- package/rules/eslint-comments/best-practices.js +8 -11
- package/rules/eslint-comments/index.d.ts +1 -2
- package/rules/eslint-comments/index.js +9 -45
- package/rules/eslint-comments/stylistic-issues.js +9 -18
- package/rules/import/helpful-warnings.js +11 -14
- package/rules/import/index.js +11 -14
- package/rules/import/module-systems.js +10 -13
- package/rules/import/rules/no-extraneous-dependencies.d.ts +3 -0
- package/rules/import/rules/no-extraneous-dependencies.js +20 -21
- package/rules/import/static-analysis.js +26 -29
- package/rules/import/style-guide.js +33 -36
- package/rules/jest/index.js +98 -72
- package/rules/jest/typescript-eslint.js +5 -8
- package/rules/jest-dom/index.js +19 -55
- package/rules/jsdoc/index.d.ts +1 -1
- package/rules/jsdoc/index.js +158 -344
- package/rules/n/index.d.ts +1 -1
- package/rules/n/index.js +64 -98
- package/rules/prefer-arrow/index.d.ts +1 -2
- package/rules/prefer-arrow/index.js +14 -50
- package/rules/promise/index.d.ts +1 -2
- package/rules/promise/index.js +35 -73
- package/rules/rxjs/index.d.ts +1 -1
- package/rules/rxjs/index.js +60 -96
- package/rules/security/index.d.ts +1 -2
- package/rules/security/index.js +22 -58
- package/rules/simple-import-sort/index.js +12 -48
- package/rules/simple-import-sort/rules/imports.d.ts +11 -0
- package/rules/simple-import-sort/rules/imports.js +18 -32
- package/rules/stylistic/js/index.d.ts +9 -2
- package/rules/stylistic/js/index.js +198 -236
- package/rules/stylistic/jsx/index.d.ts +8 -2
- package/rules/stylistic/jsx/index.js +81 -117
- package/rules/stylistic/plus/index.d.ts +6 -2
- package/rules/stylistic/plus/index.js +14 -50
- package/rules/stylistic/ts/index.d.ts +8 -2
- package/rules/stylistic/ts/index.js +135 -169
- package/rules/testing-library/index.js +41 -77
- package/rules/typescript-eslint/extension-rules.js +113 -116
- package/rules/typescript-eslint/index.d.ts +2 -0
- package/rules/typescript-eslint/index.js +9 -45
- package/rules/typescript-eslint/rules/typescript-eslint-naming-convention.d.ts +5 -0
- package/rules/typescript-eslint/rules/typescript-eslint-naming-convention.js +24 -30
- package/rules/typescript-eslint/supported-rules.d.ts +2 -0
- package/rules/typescript-eslint/supported-rules.js +256 -319
- package/rules/unicorn/index.d.ts +7 -2
- package/rules/unicorn/index.js +178 -209
- package/rules/unicorn/rules/prevent-abbreviations.d.ts +8 -0
- package/rules/unicorn/rules/prevent-abbreviations.js +30 -8
- package/rules.js +4 -14
- package/rxjs.d.ts +5 -0
- package/rxjs.js +21 -57
- package/testing-library.js +8 -11
package/index.js
CHANGED
|
@@ -1,147 +1,102 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { parser } from 'typescript-eslint';
|
|
2
|
+
import { arrayFuncConfig } from "./rules/array-func/index.js";
|
|
3
|
+
import { eslintConfig } from "./rules/eslint/index.js";
|
|
4
|
+
import { eslintCommentsConfig } from "./rules/eslint-comments/index.js";
|
|
5
|
+
import { importConfig } from "./rules/import/index.js";
|
|
6
|
+
import { jsImportNoExtraneousDependencies } from "./rules/import/rules/no-extraneous-dependencies.js";
|
|
7
|
+
import { jsdocConfig } from "./rules/jsdoc/index.js";
|
|
8
|
+
import { nConfig } from "./rules/n/index.js";
|
|
9
|
+
import { preferArrowConfig } from "./rules/prefer-arrow/index.js";
|
|
10
|
+
import { promiseConfig } from "./rules/promise/index.js";
|
|
11
|
+
import { securityConfig } from "./rules/security/index.js";
|
|
12
|
+
import { simpleImportSortConfig } from "./rules/simple-import-sort/index.js";
|
|
13
|
+
import { stylisticJsConfig } from "./rules/stylistic/js/index.js";
|
|
14
|
+
import { stylisticJsxConfig } from "./rules/stylistic/jsx/index.js";
|
|
15
|
+
import { stylisticPlusConfig } from "./rules/stylistic/plus/index.js";
|
|
16
|
+
import { stylisticTsConfig } from "./rules/stylistic/ts/index.js";
|
|
17
|
+
import { typescriptEslintConfig } from "./rules/typescript-eslint/index.js";
|
|
18
|
+
import { unicornConfig } from "./rules/unicorn/index.js";
|
|
19
|
+
export default [{
|
|
20
|
+
ignores: ['**/*.d.ts', '**/dist']
|
|
21
|
+
}, {
|
|
22
|
+
files: ['**/*.[jt]s?(x)'],
|
|
23
|
+
languageOptions: {
|
|
24
|
+
sourceType: 'module',
|
|
25
|
+
ecmaVersion: 'latest',
|
|
26
|
+
parser,
|
|
27
|
+
parserOptions: {
|
|
28
|
+
ecmaFeatures: {
|
|
29
|
+
globalReturn: false,
|
|
30
|
+
impliedStrict: true
|
|
31
|
+
},
|
|
32
|
+
projectService: {
|
|
33
|
+
allowDefaultProject: ['?(.)*.?(m|c)js']
|
|
34
|
+
},
|
|
35
|
+
warnOnUnsupportedTypeScriptVersion: true
|
|
7
36
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
files: ['**/*.[jt]s?(x)'],
|
|
61
|
-
languageOptions: {
|
|
62
|
-
parser: tsEslint.parser,
|
|
63
|
-
parserOptions: {
|
|
64
|
-
ecmaVersion: 6,
|
|
65
|
-
ecmaFeatures: {
|
|
66
|
-
globalReturn: false,
|
|
67
|
-
impliedStrict: true,
|
|
68
|
-
},
|
|
69
|
-
sourceType: 'module',
|
|
70
|
-
project: './tsconfig.json',
|
|
71
|
-
warnOnUnsupportedTypeScriptVersion: true,
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
plugins: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, array_func_1.arrayFuncConfig.plugins), eslint_comments_1.eslintCommentsConfig.plugins), import_1.importConfig.plugins), jsdoc_1.jsdocConfig.plugins), n_1.nConfig.plugins), prefer_arrow_1.preferArrowConfig.plugins), promise_1.promiseConfig.plugins), security_1.securityConfig.plugins), simple_import_sort_1.simpleImportSortConfig.plugins), js_1.stylisticJsConfig.plugins), plus_1.stylisticPlusConfig.plugins), unicorn_1.unicornConfig.plugins),
|
|
75
|
-
settings: {
|
|
76
|
-
jsdoc: jsdoc_1.jsdocConfig.settings,
|
|
77
|
-
},
|
|
78
|
-
rules: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, array_func_1.arrayFuncConfig.rules), eslint_1.eslintConfig.rules), eslint_comments_1.eslintCommentsConfig.rules), import_1.importConfig.rules), jsdoc_1.jsdocConfig.rules), n_1.nConfig.rules), prefer_arrow_1.preferArrowConfig.rules), promise_1.promiseConfig.rules), security_1.securityConfig.rules), simple_import_sort_1.simpleImportSortConfig.rules), js_1.stylisticJsConfig.rules), plus_1.stylisticPlusConfig.rules), unicorn_1.unicornConfig.rules),
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
files: ['**/*.js?(x)'],
|
|
82
|
-
languageOptions: {
|
|
83
|
-
parser: babelParser,
|
|
84
|
-
parserOptions: {
|
|
85
|
-
ecmaVersion: 6,
|
|
86
|
-
ecmaFeatures: {
|
|
87
|
-
globalReturn: false,
|
|
88
|
-
impliedStrict: true,
|
|
89
|
-
},
|
|
90
|
-
sourceType: 'module',
|
|
91
|
-
requireConfigFile: false,
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
plugins: {},
|
|
95
|
-
settings: {
|
|
96
|
-
'import/extensions': ['.js', '.jsx'],
|
|
97
|
-
},
|
|
98
|
-
rules: {
|
|
99
|
-
'import/no-commonjs': 'off',
|
|
100
|
-
'import/no-extraneous-dependencies': ['error', (0, no_extraneous_dependencies_1.jsImportNoExtraneousDependencies)()],
|
|
101
|
-
'import/unambiguous': 'off',
|
|
102
|
-
'jsdoc/no-types': 'off',
|
|
103
|
-
'jsdoc/no-undefined-types': 'off',
|
|
104
|
-
'jsdoc/require-param': 'error',
|
|
105
|
-
'jsdoc/require-param-type': 'error',
|
|
106
|
-
'jsdoc/require-returns': 'error',
|
|
107
|
-
'jsdoc/require-returns-type': 'error',
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
files: ['**/*.ts?(x)'],
|
|
112
|
-
languageOptions: {
|
|
113
|
-
parser: tsEslint.parser,
|
|
114
|
-
parserOptions: {
|
|
115
|
-
ecmaVersion: 6,
|
|
116
|
-
ecmaFeatures: {
|
|
117
|
-
globalReturn: false,
|
|
118
|
-
impliedStrict: true,
|
|
119
|
-
},
|
|
120
|
-
sourceType: 'module',
|
|
121
|
-
project: './tsconfig.json',
|
|
122
|
-
warnOnUnsupportedTypeScriptVersion: true,
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
plugins: Object.assign(Object.assign({}, typescript_eslint_1.typescriptEslintConfig.plugins), ts_1.stylisticTsConfig.plugins),
|
|
126
|
-
settings: {
|
|
127
|
-
'import/parsers': {
|
|
128
|
-
'@typescript-eslint/parser': [
|
|
129
|
-
'.ts',
|
|
130
|
-
'.tsx',
|
|
131
|
-
],
|
|
132
|
-
},
|
|
133
|
-
'import/resolver': {
|
|
134
|
-
typescript: {
|
|
135
|
-
alwaysTryTypes: true,
|
|
136
|
-
project: './tsconfig.json',
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
rules: Object.assign(Object.assign({}, typescript_eslint_1.typescriptEslintConfig.rules), ts_1.stylisticTsConfig.rules),
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
files: ['**/*.js?(x)'],
|
|
144
|
-
plugins: Object.assign({}, jsx_1.stylisticJsxConfig.plugins),
|
|
145
|
-
rules: Object.assign({}, jsx_1.stylisticJsxConfig.rules),
|
|
37
|
+
},
|
|
38
|
+
plugins: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, arrayFuncConfig.plugins), eslintCommentsConfig.plugins), importConfig.plugins), jsdocConfig.plugins), nConfig.plugins), preferArrowConfig.plugins), promiseConfig.plugins), securityConfig.plugins), simpleImportSortConfig.plugins), stylisticJsConfig.plugins), stylisticPlusConfig.plugins), unicornConfig.plugins),
|
|
39
|
+
settings: {
|
|
40
|
+
jsdoc: jsdocConfig.settings
|
|
41
|
+
},
|
|
42
|
+
rules: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, arrayFuncConfig.rules), eslintConfig.rules), eslintCommentsConfig.rules), importConfig.rules), jsdocConfig.rules), nConfig.rules), preferArrowConfig.rules), promiseConfig.rules), securityConfig.rules), simpleImportSortConfig.rules), stylisticJsConfig.rules), stylisticPlusConfig.rules), unicornConfig.rules)
|
|
43
|
+
}, {
|
|
44
|
+
files: ['**/*.js?(x)'],
|
|
45
|
+
languageOptions: {
|
|
46
|
+
sourceType: 'module',
|
|
47
|
+
ecmaVersion: 'latest',
|
|
48
|
+
parserOptions: {
|
|
49
|
+
ecmaFeatures: {
|
|
50
|
+
globalReturn: false,
|
|
51
|
+
impliedStrict: true
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
plugins: {},
|
|
56
|
+
settings: {
|
|
57
|
+
'import/extensions': ['.js', '.jsx']
|
|
58
|
+
},
|
|
59
|
+
rules: {
|
|
60
|
+
'import/no-commonjs': 'off',
|
|
61
|
+
'import/no-extraneous-dependencies': ['error', jsImportNoExtraneousDependencies()],
|
|
62
|
+
'import/unambiguous': 'off',
|
|
63
|
+
'jsdoc/no-types': 'off',
|
|
64
|
+
'jsdoc/no-undefined-types': 'off',
|
|
65
|
+
'jsdoc/require-param': 'error',
|
|
66
|
+
'jsdoc/require-param-type': 'error',
|
|
67
|
+
'jsdoc/require-returns': 'error',
|
|
68
|
+
'jsdoc/require-returns-type': 'error'
|
|
69
|
+
}
|
|
70
|
+
}, {
|
|
71
|
+
files: ['**/*.ts?(x)'],
|
|
72
|
+
languageOptions: {
|
|
73
|
+
sourceType: 'module',
|
|
74
|
+
ecmaVersion: 'latest',
|
|
75
|
+
parser,
|
|
76
|
+
parserOptions: {
|
|
77
|
+
ecmaFeatures: {
|
|
78
|
+
globalReturn: false,
|
|
79
|
+
impliedStrict: true
|
|
80
|
+
},
|
|
81
|
+
projectService: true,
|
|
82
|
+
warnOnUnsupportedTypeScriptVersion: true
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
plugins: Object.assign(Object.assign({}, typescriptEslintConfig.plugins), stylisticTsConfig.plugins),
|
|
86
|
+
settings: {
|
|
87
|
+
'import/parsers': {
|
|
88
|
+
'@typescript-eslint/parser': ['.ts', '.tsx']
|
|
146
89
|
},
|
|
147
|
-
|
|
90
|
+
'import/resolver': {
|
|
91
|
+
typescript: {
|
|
92
|
+
alwaysTryTypes: true,
|
|
93
|
+
project: './tsconfig.json'
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
rules: Object.assign(Object.assign({}, typescriptEslintConfig.rules), stylisticTsConfig.rules)
|
|
98
|
+
}, {
|
|
99
|
+
files: ['**/*.[jt]sx'],
|
|
100
|
+
plugins: Object.assign({}, stylisticJsxConfig.plugins),
|
|
101
|
+
rules: Object.assign({}, stylisticJsxConfig.rules)
|
|
102
|
+
}].filter(Boolean);
|
package/jest-dom.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
rules: jest_dom_1.jestDomConfig.rules,
|
|
10
|
-
};
|
|
11
|
-
}
|
|
1
|
+
import { jestDomConfig as jestDomPluginConfig } from "./rules/jest-dom/index.js";
|
|
2
|
+
export function jestDomConfig(files = ['**/*.@(spec|test).[jt]s?(x)']) {
|
|
3
|
+
return {
|
|
4
|
+
files,
|
|
5
|
+
plugins: jestDomPluginConfig.plugins,
|
|
6
|
+
rules: jestDomPluginConfig.rules
|
|
7
|
+
};
|
|
8
|
+
}
|
package/jest.d.ts
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for the Jest plugin.
|
|
3
|
+
*
|
|
4
|
+
* @param files - A list of globs with the Jest test files.
|
|
5
|
+
* Default value is extensions supported by Jest (/\.(spec|test)\.[jt]sx?$/).
|
|
6
|
+
*/
|
|
1
7
|
export declare function jestConfig(files?: string[]): Record<string, unknown>;
|
package/jest.js
CHANGED
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { jestImportNoExtraneousDependencies } from "./rules/import/rules/no-extraneous-dependencies.js";
|
|
2
|
+
import { jestConfig as jestPluginConfig } from "./rules/jest/index.js";
|
|
3
|
+
export function jestConfig(files = ['**/*.@(spec|test).[jt]s?(x)']) {
|
|
4
|
+
return {
|
|
5
|
+
files,
|
|
6
|
+
plugins: jestPluginConfig.plugins,
|
|
7
|
+
rules: Object.assign(Object.assign({}, jestPluginConfig.rules), {
|
|
8
|
+
'@typescript-eslint/ban-ts-comment': ['error', {
|
|
9
|
+
'ts-expect-error': 'allow-with-description',
|
|
10
|
+
'ts-ignore': true,
|
|
11
|
+
'ts-nocheck': true,
|
|
12
|
+
'ts-check': false
|
|
13
|
+
}],
|
|
14
|
+
'@typescript-eslint/init-declarations': 'off',
|
|
15
|
+
'@typescript-eslint/unbound-method': 'off',
|
|
16
|
+
'import/no-extraneous-dependencies': ['error', jestImportNoExtraneousDependencies()],
|
|
17
|
+
'import/no-unassigned-import': ['error', {
|
|
18
|
+
allow: ['@testing-library/jest-dom', '@testing-library/jest-dom/extend-expect']
|
|
19
|
+
}],
|
|
20
|
+
'max-nested-callbacks': ['error', 6],
|
|
21
|
+
'n/no-unpublished-import': ['error', {
|
|
22
|
+
allowModules: ['@jest/globals']
|
|
23
|
+
}],
|
|
24
|
+
'prefer-arrow/prefer-arrow-functions': 'off',
|
|
25
|
+
'promise/always-return': 'off',
|
|
26
|
+
'@smarttools/rxjs/no-topromise': 'off'
|
|
27
|
+
})
|
|
28
|
+
};
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perfective/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "ESLint shareable rules configuration",
|
|
5
5
|
"keywords": ["code quality", "code standard", "code style", "eslint", "eslint config", "lint", "perfective", "tslint", "tslint config", "typescript"],
|
|
6
6
|
"author": "Andrey Mikheychik <a.mikheychik@gmail.com>",
|
|
@@ -9,33 +9,33 @@
|
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git+https://github.com/perfective/eslint-config.git"
|
|
11
11
|
},
|
|
12
|
+
"type": "module",
|
|
12
13
|
"license": "MIT",
|
|
13
14
|
"peerDependencies": {
|
|
14
|
-
"@
|
|
15
|
-
"@
|
|
16
|
-
"@stylistic/eslint-plugin": "^2.
|
|
17
|
-
"@stylistic/eslint-plugin-
|
|
18
|
-
"@stylistic/eslint-plugin-
|
|
19
|
-
"@stylistic/eslint-plugin-
|
|
20
|
-
"@
|
|
21
|
-
"
|
|
22
|
-
"eslint": "^
|
|
23
|
-
"eslint-
|
|
24
|
-
"eslint-plugin-
|
|
25
|
-
"eslint-plugin-cypress": "^4.1.0",
|
|
15
|
+
"@smarttools/eslint-plugin-rxjs": "1.0.14",
|
|
16
|
+
"@stylistic/eslint-plugin": "^4.2.0",
|
|
17
|
+
"@stylistic/eslint-plugin-js": "^4.2.0",
|
|
18
|
+
"@stylistic/eslint-plugin-jsx": "^4.2.0",
|
|
19
|
+
"@stylistic/eslint-plugin-plus": "^4.2.0",
|
|
20
|
+
"@stylistic/eslint-plugin-ts": "^4.2.0",
|
|
21
|
+
"@typescript-eslint/utils": "^8.25.0",
|
|
22
|
+
"eslint": "^9.22.0",
|
|
23
|
+
"eslint-import-resolver-typescript": "^3.8.3",
|
|
24
|
+
"eslint-plugin-array-func": "^5.0.2",
|
|
25
|
+
"eslint-plugin-cypress": "^4.2.0",
|
|
26
26
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
27
27
|
"eslint-plugin-import": "^2.31.0",
|
|
28
|
-
"eslint-plugin-jest": "^28.
|
|
28
|
+
"eslint-plugin-jest": "^28.11.0",
|
|
29
29
|
"eslint-plugin-jest-dom": "^5.5.0",
|
|
30
|
-
"eslint-plugin-jsdoc": "^50.6.
|
|
31
|
-
"eslint-plugin-n": "^17.
|
|
30
|
+
"eslint-plugin-jsdoc": "^50.6.3",
|
|
31
|
+
"eslint-plugin-n": "^17.16.2",
|
|
32
32
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
33
33
|
"eslint-plugin-promise": "^7.2.1",
|
|
34
34
|
"eslint-plugin-security": "^3.0.1",
|
|
35
35
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
36
36
|
"eslint-plugin-testing-library": "^7.1.1",
|
|
37
|
-
"eslint-plugin-unicorn": "^
|
|
38
|
-
"typescript-eslint": "^8.
|
|
37
|
+
"eslint-plugin-unicorn": "^57.0.0",
|
|
38
|
+
"typescript-eslint": "^8.26.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependenciesMeta": {
|
|
41
41
|
"eslint-plugin-cypress": {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import * as eslintPluginArrayFunc from 'eslint-plugin-array-func';
|
|
2
1
|
export declare const arrayFuncConfig: {
|
|
3
2
|
plugins: {
|
|
4
|
-
'array-func':
|
|
3
|
+
'array-func': import("@typescript-eslint/utils/dist/ts-eslint").FlatConfig.Plugin;
|
|
5
4
|
};
|
|
6
5
|
rules: {
|
|
7
6
|
'array-func/from-map': string;
|
|
@@ -1,50 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.arrayFuncConfig = void 0;
|
|
37
|
-
const eslintPluginArrayFunc = __importStar(require("eslint-plugin-array-func"));
|
|
38
|
-
exports.arrayFuncConfig = {
|
|
39
|
-
plugins: {
|
|
40
|
-
'array-func': eslintPluginArrayFunc,
|
|
41
|
-
},
|
|
42
|
-
rules: {
|
|
43
|
-
'array-func/from-map': 'warn',
|
|
44
|
-
'array-func/no-unnecessary-this-arg': 'error',
|
|
45
|
-
'array-func/prefer-array-from': 'warn',
|
|
46
|
-
'array-func/avoid-reverse': 'warn',
|
|
47
|
-
'array-func/prefer-flat-map': 'off',
|
|
48
|
-
'array-func/prefer-flat': 'off',
|
|
49
|
-
},
|
|
50
|
-
};
|
|
1
|
+
import eslintPluginArrayFunc from 'eslint-plugin-array-func';
|
|
2
|
+
export const arrayFuncConfig = {
|
|
3
|
+
plugins: {
|
|
4
|
+
'array-func': eslintPluginArrayFunc
|
|
5
|
+
},
|
|
6
|
+
rules: {
|
|
7
|
+
'array-func/from-map': 'warn',
|
|
8
|
+
'array-func/no-unnecessary-this-arg': 'error',
|
|
9
|
+
'array-func/prefer-array-from': 'warn',
|
|
10
|
+
'array-func/avoid-reverse': 'warn',
|
|
11
|
+
'array-func/prefer-flat-map': 'off',
|
|
12
|
+
'array-func/prefer-flat': 'off'
|
|
13
|
+
}
|
|
14
|
+
};
|
package/rules/cypress/index.d.ts
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import * as eslintPluginCypress from 'eslint-plugin-cypress/flat';
|
|
2
1
|
export declare const cypressOptionalConfig: {
|
|
3
2
|
plugins: {
|
|
4
|
-
cypress:
|
|
3
|
+
cypress: import("@typescript-eslint/utils/dist/ts-eslint").FlatConfig.Plugin & {
|
|
4
|
+
configs: {
|
|
5
|
+
globals: {
|
|
6
|
+
languageOptions: {
|
|
7
|
+
globals: import("@typescript-eslint/utils/dist/ts-eslint").TSESLint.FlatConfig.GlobalsConfig;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
5
12
|
};
|
|
6
13
|
languageOptions: {
|
|
7
|
-
globals:
|
|
14
|
+
globals: import("@typescript-eslint/utils/dist/ts-eslint").SharedConfig.GlobalsConfig;
|
|
8
15
|
};
|
|
9
16
|
rules: {
|
|
10
17
|
'cypress/assertion-before-screenshot': string;
|
|
@@ -15,6 +22,7 @@ export declare const cypressOptionalConfig: {
|
|
|
15
22
|
'cypress/no-force': string;
|
|
16
23
|
'cypress/no-pause': string;
|
|
17
24
|
'cypress/no-unnecessary-waiting': string;
|
|
25
|
+
'cypress/no-xpath': string;
|
|
18
26
|
'cypress/require-data-selectors': string;
|
|
19
27
|
'cypress/unsafe-to-chain-command': string;
|
|
20
28
|
};
|
package/rules/cypress/index.js
CHANGED
|
@@ -1,57 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.cypressOptionalConfig = void 0;
|
|
37
|
-
const eslintPluginCypress = __importStar(require("eslint-plugin-cypress/flat"));
|
|
38
|
-
exports.cypressOptionalConfig = {
|
|
39
|
-
plugins: {
|
|
40
|
-
cypress: eslintPluginCypress,
|
|
41
|
-
},
|
|
42
|
-
languageOptions: {
|
|
43
|
-
globals: eslintPluginCypress.configs.globals.languageOptions.globals,
|
|
44
|
-
},
|
|
45
|
-
rules: {
|
|
46
|
-
'cypress/assertion-before-screenshot': 'error',
|
|
47
|
-
'cypress/no-assigning-return-values': 'error',
|
|
48
|
-
'cypress/no-async-before': 'error',
|
|
49
|
-
'cypress/no-async-tests': 'error',
|
|
50
|
-
'cypress/no-debug': 'error',
|
|
51
|
-
'cypress/no-force': 'error',
|
|
52
|
-
'cypress/no-pause': 'error',
|
|
53
|
-
'cypress/no-unnecessary-waiting': 'error',
|
|
54
|
-
'cypress/require-data-selectors': 'error',
|
|
55
|
-
'cypress/unsafe-to-chain-command': 'error',
|
|
56
|
-
},
|
|
57
|
-
};
|
|
1
|
+
var _a;
|
|
2
|
+
import eslintPluginCypress from 'eslint-plugin-cypress/flat';
|
|
3
|
+
export const cypressOptionalConfig = {
|
|
4
|
+
plugins: {
|
|
5
|
+
cypress: eslintPluginCypress
|
|
6
|
+
},
|
|
7
|
+
languageOptions: {
|
|
8
|
+
globals: (_a = eslintPluginCypress.configs.globals.languageOptions) === null || _a === void 0 ? void 0 : _a.globals
|
|
9
|
+
},
|
|
10
|
+
rules: {
|
|
11
|
+
'cypress/assertion-before-screenshot': 'error',
|
|
12
|
+
'cypress/no-assigning-return-values': 'error',
|
|
13
|
+
'cypress/no-async-before': 'error',
|
|
14
|
+
'cypress/no-async-tests': 'error',
|
|
15
|
+
'cypress/no-debug': 'error',
|
|
16
|
+
'cypress/no-force': 'error',
|
|
17
|
+
'cypress/no-pause': 'error',
|
|
18
|
+
'cypress/no-unnecessary-waiting': 'error',
|
|
19
|
+
'cypress/no-xpath': 'error',
|
|
20
|
+
'cypress/require-data-selectors': 'error',
|
|
21
|
+
'cypress/unsafe-to-chain-command': 'error'
|
|
22
|
+
}
|
|
23
|
+
};
|
package/rules/eslint/index.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.eslintConfig = {
|
|
8
|
-
rules: Object.assign(Object.assign(Object.assign({}, possible_problems_1.eslintPossibleProblemsRules), suggestions_1.eslintSuggestionsRules), layout_formatting_1.eslintLayoutFormattingRules),
|
|
9
|
-
};
|
|
1
|
+
import { eslintLayoutFormattingRules } from "./layout-formatting.js";
|
|
2
|
+
import { eslintPossibleProblemsRules } from "./possible-problems.js";
|
|
3
|
+
import { eslintSuggestionsRules } from "./suggestions.js";
|
|
4
|
+
export const eslintConfig = {
|
|
5
|
+
rules: Object.assign(Object.assign(Object.assign({}, eslintPossibleProblemsRules), eslintSuggestionsRules), eslintLayoutFormattingRules)
|
|
6
|
+
};
|