@automattic/eslint-plugin-wpvip 0.13.1 → 1.0.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/configs/cli.js +14 -11
- package/configs/formatting.js +69 -66
- package/configs/index.js +4 -1
- package/configs/javascript.js +235 -217
- package/configs/jsdoc.js +66 -62
- package/configs/prettier.js +10 -6
- package/configs/react.js +47 -45
- package/configs/recommended.js +7 -13
- package/configs/testing.js +19 -18
- package/configs/typescript.js +84 -65
- package/configs/weak-javascript.js +41 -59
- package/configs/weak-testing.js +14 -13
- package/configs/weak-typescript.js +25 -27
- package/eslint.config.js +13 -0
- package/index.js +6 -4
- package/package.json +28 -29
- package/plugin.js +12 -0
- package/rules/nestjs-route-prefix.js +15 -2
- package/rules/no-async-foreach.js +12 -1
- package/rules/no-unguarded-get-range-at.js +1 -0
- package/init.js +0 -1
package/configs/react.js
CHANGED
|
@@ -3,67 +3,69 @@
|
|
|
3
3
|
* https://github.com/WordPress/gutenberg/blob/%40wordpress/eslint-plugin%4014.1.0/packages/eslint-plugin/configs/react.js
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
const JsxA11yPlugin = require( 'eslint-plugin-jsx-a11y' );
|
|
7
|
+
const ReactPlugin = require( 'eslint-plugin-react' );
|
|
8
|
+
const ReactHooksPlugin = require( 'eslint-plugin-react-hooks' );
|
|
9
|
+
|
|
10
|
+
/** @type import('eslint').Linter.Config[] */
|
|
11
|
+
module.exports = [
|
|
12
|
+
ReactPlugin.configs.flat.recommended,
|
|
13
|
+
ReactHooksPlugin.configs.recommended,
|
|
14
|
+
JsxA11yPlugin.flatConfigs.recommended,
|
|
15
|
+
{
|
|
16
|
+
parserOptions: {
|
|
17
|
+
ecmaFeatures: {
|
|
18
|
+
jsx: true,
|
|
19
|
+
},
|
|
16
20
|
},
|
|
17
|
-
},
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
settings: {
|
|
23
|
+
react: {
|
|
24
|
+
version: 'detect',
|
|
25
|
+
},
|
|
22
26
|
},
|
|
23
|
-
},
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
rules: {
|
|
29
|
+
'jsx-a11y/label-has-associated-control': [
|
|
30
|
+
'error',
|
|
31
|
+
{
|
|
32
|
+
assert: 'htmlFor',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
26
35
|
|
|
27
|
-
|
|
28
|
-
'jsx-a11y/label-has-associated-control': [
|
|
29
|
-
'error',
|
|
30
|
-
{
|
|
31
|
-
assert: 'htmlFor',
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
|
|
35
|
-
'jsx-a11y/media-has-caption': 'off',
|
|
36
|
+
'jsx-a11y/media-has-caption': 'off',
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
'jsx-a11y/no-noninteractive-tabindex': 'off',
|
|
38
39
|
|
|
39
|
-
|
|
40
|
+
'jsx-a11y/role-has-required-aria-props': 'off',
|
|
40
41
|
|
|
41
|
-
|
|
42
|
+
'jsx-quotes': 'error',
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
'react/display-name': 'off',
|
|
44
45
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
'react/jsx-curly-spacing': [
|
|
47
|
+
'error',
|
|
48
|
+
{
|
|
49
|
+
when: 'always',
|
|
50
|
+
children: true,
|
|
51
|
+
},
|
|
52
|
+
],
|
|
52
53
|
|
|
53
|
-
|
|
54
|
+
'react/jsx-equals-spacing': 'error',
|
|
54
55
|
|
|
55
|
-
|
|
56
|
+
'react/jsx-indent': [ 'error', 'tab' ],
|
|
56
57
|
|
|
57
|
-
|
|
58
|
+
'react/jsx-indent-props': [ 'error', 'tab' ],
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
'react/jsx-key': 'error',
|
|
60
61
|
|
|
61
|
-
|
|
62
|
+
'react/jsx-tag-spacing': 'error',
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
'react/no-children-prop': 'off',
|
|
64
65
|
|
|
65
|
-
|
|
66
|
+
'react/prop-types': 'off',
|
|
66
67
|
|
|
67
|
-
|
|
68
|
+
'react/react-in-jsx-scope': 'off',
|
|
69
|
+
},
|
|
68
70
|
},
|
|
69
|
-
|
|
71
|
+
];
|
package/configs/recommended.js
CHANGED
|
@@ -1,28 +1,22 @@
|
|
|
1
|
-
const debugLog = require( '../utils/debug-log' );
|
|
2
1
|
const isPackageInstalled = require( '../utils/is-package-installed' );
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
config.extends.push( require.resolve( './formatting' ) );
|
|
3
|
+
/** @type import('eslint').Linter.Config[] */
|
|
4
|
+
const configs = [ ...require( './javascript' ), ...require( './formatting' ) ];
|
|
9
5
|
|
|
10
6
|
if ( isPackageInstalled( 'typescript' ) ) {
|
|
11
|
-
|
|
7
|
+
configs.push( ...require( './typescript' ) );
|
|
12
8
|
}
|
|
13
9
|
|
|
14
10
|
if ( isPackageInstalled( 'jest' ) ) {
|
|
15
|
-
|
|
11
|
+
configs.push( ...require( './testing' ) );
|
|
16
12
|
}
|
|
17
13
|
|
|
18
14
|
if ( isPackageInstalled( 'react' ) ) {
|
|
19
|
-
|
|
15
|
+
configs.push( ...require( './react' ) );
|
|
20
16
|
}
|
|
21
17
|
|
|
22
18
|
if ( isPackageInstalled( 'prettier' ) ) {
|
|
23
|
-
|
|
19
|
+
configs.push( ...require( './prettier' ) );
|
|
24
20
|
}
|
|
25
21
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
module.exports = config;
|
|
22
|
+
module.exports = configs;
|
package/configs/testing.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
const JestPlugin = require( 'eslint-plugin-jest' );
|
|
2
|
+
const globals = require( 'globals' );
|
|
3
|
+
|
|
1
4
|
const isPackageInstalled = require( '../utils/is-package-installed' );
|
|
2
5
|
|
|
3
6
|
/**
|
|
@@ -6,28 +9,26 @@ const isPackageInstalled = require( '../utils/is-package-installed' );
|
|
|
6
9
|
* - https://github.com/WordPress/gutenberg/blob/%40wordpress/eslint-plugin%4014.1.0/packages/eslint-plugin/configs/test-e2e.js
|
|
7
10
|
*/
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
/** @type import('eslint').Linter.Config[] */
|
|
13
|
+
const config = [
|
|
14
|
+
JestPlugin.configs[ 'flat/recommended' ],
|
|
15
|
+
{
|
|
16
|
+
languageOptions: {
|
|
17
|
+
globals: {
|
|
18
|
+
...globals.jest,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
14
21
|
},
|
|
15
|
-
|
|
16
|
-
plugins: [ 'jest' ],
|
|
17
|
-
};
|
|
22
|
+
];
|
|
18
23
|
|
|
19
24
|
if ( isPackageInstalled( 'typescript' ) ) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
rules: {
|
|
26
|
-
'@typescript-eslint/unbound-method': 'off',
|
|
27
|
-
'jest/unbound-method': 'error',
|
|
28
|
-
},
|
|
25
|
+
config.push( {
|
|
26
|
+
files: [ '__tests__/**/*.ts', '**/*.test.ts', '**/*.spec.ts' ],
|
|
27
|
+
rules: {
|
|
28
|
+
'@typescript-eslint/unbound-method': 'off',
|
|
29
|
+
'jest/unbound-method': 'error',
|
|
29
30
|
},
|
|
30
|
-
|
|
31
|
+
} );
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
module.exports = config;
|
package/configs/typescript.js
CHANGED
|
@@ -3,84 +3,103 @@
|
|
|
3
3
|
* https://github.com/WordPress/gutenberg/blob/%40wordpress/eslint-plugin%4014.1.0/packages/eslint-plugin/configs/recommended.js
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const TsEsLintParser = require( '@typescript-eslint/parser' );
|
|
7
|
+
const JsDoc = require( 'eslint-plugin-jsdoc' );
|
|
8
|
+
const tseslint = require( 'typescript-eslint' );
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
{
|
|
11
|
-
extends: [
|
|
12
|
-
'plugin:@typescript-eslint/eslint-recommended',
|
|
13
|
-
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
14
|
-
'plugin:@typescript-eslint/strict',
|
|
15
|
-
],
|
|
10
|
+
const files = [ '**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts' ];
|
|
16
11
|
|
|
17
|
-
|
|
12
|
+
/**
|
|
13
|
+
* @param {import('eslint').Linter.Config} config
|
|
14
|
+
* @returns {import('eslint').Linter.Config}
|
|
15
|
+
*/
|
|
16
|
+
const addFiles = config => ( config.files ? config : { ...config, files } );
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
const tsEslintTypeChecked = tseslint.configs.recommendedTypeChecked.map( addFiles );
|
|
19
|
+
const tsEslintStrict = tseslint.configs.strict.map( addFiles ); // Already includes `recommended`
|
|
20
20
|
|
|
21
|
+
/** @type import('eslint').Linter.Config[] */
|
|
22
|
+
module.exports = [
|
|
23
|
+
...tsEslintTypeChecked,
|
|
24
|
+
...tsEslintStrict,
|
|
25
|
+
{
|
|
26
|
+
ignores: [ '**/*.d.ts', '**/*.d.cts', '**/*.d.mts' ],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
files,
|
|
30
|
+
languageOptions: {
|
|
31
|
+
parser: TsEsLintParser,
|
|
21
32
|
parserOptions: {
|
|
22
|
-
|
|
33
|
+
projectService: true,
|
|
23
34
|
},
|
|
35
|
+
},
|
|
36
|
+
plugins: {
|
|
37
|
+
'@typescript-eslint': tseslint.plugin,
|
|
38
|
+
'@automattic/wpvip': require( '../plugin' ),
|
|
39
|
+
jsdoc: JsDoc,
|
|
40
|
+
},
|
|
41
|
+
rules: {
|
|
42
|
+
// Ensures NestJS route prefixes are correctly formatted.
|
|
43
|
+
'@automattic/wpvip/nestjs-route-prefix': 'error',
|
|
24
44
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
'error',
|
|
33
|
-
{
|
|
34
|
-
overrides: {
|
|
35
|
-
constructors: 'off',
|
|
36
|
-
},
|
|
45
|
+
// Require explicit visibility for class methods and properties to avoid
|
|
46
|
+
// implicit public access. Allow constructors to be implicitly public.
|
|
47
|
+
'@typescript-eslint/explicit-member-accessibility': [
|
|
48
|
+
'error',
|
|
49
|
+
{
|
|
50
|
+
overrides: {
|
|
51
|
+
constructors: 'off',
|
|
37
52
|
},
|
|
38
|
-
|
|
53
|
+
},
|
|
54
|
+
],
|
|
39
55
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
56
|
+
// TypeScript `any` type must not be used. This is a warning in the base
|
|
57
|
+
// config, and is elevated to an error here.
|
|
58
|
+
'@typescript-eslint/no-explicit-any': 'error',
|
|
43
59
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
60
|
+
// Provide escape hatches around destructuring and arguments.
|
|
61
|
+
'no-unused-vars': 'off',
|
|
62
|
+
'@typescript-eslint/no-unused-vars': [
|
|
63
|
+
'error',
|
|
64
|
+
{
|
|
65
|
+
argsIgnorePattern: '^_',
|
|
66
|
+
destructuredArrayIgnorePattern: '^_',
|
|
67
|
+
ignoreRestSiblings: true,
|
|
68
|
+
},
|
|
69
|
+
],
|
|
53
70
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
71
|
+
// Disable some rules that TypeScript handles and are also a Performance
|
|
72
|
+
// issue. See:
|
|
73
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/main/docs/linting/troubleshooting/Performance.md#eslint-plugin-import
|
|
74
|
+
'import/default': 'off',
|
|
75
|
+
'import/named': 'off',
|
|
59
76
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
77
|
+
// Don't require redundant JSDoc types in TypeScript files.
|
|
78
|
+
'jsdoc/require-param-type': 'off',
|
|
79
|
+
'jsdoc/require-returns-type': 'off',
|
|
63
80
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
81
|
+
// Use TypeScript-specific rules.
|
|
82
|
+
'no-duplicate-imports': 'off',
|
|
83
|
+
'no-shadow': 'off',
|
|
84
|
+
'@typescript-eslint/no-shadow': 'error',
|
|
85
|
+
'import/no-duplicates': 'error',
|
|
69
86
|
|
|
70
|
-
|
|
71
|
-
|
|
87
|
+
'dot-notation': 'off',
|
|
88
|
+
'@typescript-eslint/dot-notation': [ 'error', { allowKeywords: true } ],
|
|
72
89
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
],
|
|
90
|
+
// Empty classes are allowed if they are accompanied by a decorator.
|
|
91
|
+
// This is common in frameworks such as Angular / nest.js.
|
|
92
|
+
'@typescript-eslint/no-extraneous-class': [
|
|
93
|
+
'warn',
|
|
94
|
+
{
|
|
95
|
+
allowWithDecorator: true,
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
|
|
99
|
+
'class-methods-use-this': 'off',
|
|
84
100
|
|
|
85
|
-
|
|
86
|
-
|
|
101
|
+
'default-param-last': 'off',
|
|
102
|
+
'@typescript-eslint/default-param-last': 'error',
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
];
|
|
@@ -6,64 +6,46 @@
|
|
|
6
6
|
* They do not provide good protection or standardization, but can useful on a
|
|
7
7
|
* temporary basis.
|
|
8
8
|
*/
|
|
9
|
-
module.exports = {
|
|
10
|
-
overrides: [
|
|
11
|
-
{
|
|
12
|
-
// Don't apply weak rules to TypeScript files.
|
|
13
|
-
files: [ '**/*.js', '**/*.jsx' ],
|
|
14
9
|
|
|
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
|
-
radix: 'warn',
|
|
55
|
-
|
|
56
|
-
'promise/no-new-statics': 'warn',
|
|
57
|
-
'promise/no-return-in-finally': 'warn',
|
|
58
|
-
'promise/no-return-wrap': 'warn',
|
|
59
|
-
'promise/param-names': 'warn',
|
|
60
|
-
'promise/valid-params': 'warn',
|
|
61
|
-
|
|
62
|
-
// This rule has been disabled because it is extremely slow:
|
|
63
|
-
// https://github.com/Automattic/vip-cli/pull/1534
|
|
64
|
-
//
|
|
65
|
-
// 'promise/no-multiple-resolved': 'warn',
|
|
66
|
-
},
|
|
10
|
+
/** @type import('eslint').Linter.Config[] */
|
|
11
|
+
module.exports = [
|
|
12
|
+
{
|
|
13
|
+
// Don't apply weak rules to TypeScript files.
|
|
14
|
+
files: [ '**/*.js', '**/*.jsx' ],
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Downgrade rules from the base preset to "warn". Do not disable rules (set
|
|
18
|
+
* to "off"). If a rule is already set to a warning, do not disable it.
|
|
19
|
+
*/
|
|
20
|
+
rules: {
|
|
21
|
+
complexity: 'warn',
|
|
22
|
+
eqeqeq: 'warn',
|
|
23
|
+
'object-shorthand': 'warn',
|
|
24
|
+
'no-async-promise-executor': 'warn',
|
|
25
|
+
'no-await-in-loop': 'warn',
|
|
26
|
+
'no-case-declarations': 'warn',
|
|
27
|
+
'no-dupe-else-if': 'warn',
|
|
28
|
+
'no-else-return': 'warn',
|
|
29
|
+
'no-eq-null': 'warn',
|
|
30
|
+
'no-lonely-if': 'warn',
|
|
31
|
+
'no-mixed-operators': 'warn',
|
|
32
|
+
'no-prototype-builtins': 'warn',
|
|
33
|
+
'no-shadow': 'warn',
|
|
34
|
+
'no-unused-vars': 'warn',
|
|
35
|
+
'no-useless-escape': 'warn',
|
|
36
|
+
'no-var': 'warn',
|
|
37
|
+
'one-var': 'warn',
|
|
38
|
+
radix: 'warn',
|
|
39
|
+
'promise/no-new-statics': 'warn',
|
|
40
|
+
'promise/no-return-in-finally': 'warn',
|
|
41
|
+
'promise/no-return-wrap': 'warn',
|
|
42
|
+
'promise/param-names': 'warn',
|
|
43
|
+
'promise/valid-params': 'warn',
|
|
44
|
+
|
|
45
|
+
// This rule has been disabled because it is extremely slow:
|
|
46
|
+
// https://github.com/Automattic/vip-cli/pull/1534
|
|
47
|
+
//
|
|
48
|
+
// 'promise/no-multiple-resolved': 'warn',
|
|
67
49
|
},
|
|
68
|
-
|
|
69
|
-
|
|
50
|
+
},
|
|
51
|
+
];
|
package/configs/weak-testing.js
CHANGED
|
@@ -6,18 +6,19 @@
|
|
|
6
6
|
* They do not provide good protection or standardization, but can useful on a
|
|
7
7
|
* temporary basis.
|
|
8
8
|
*/
|
|
9
|
-
module.exports = {
|
|
10
|
-
/**
|
|
11
|
-
* Downgrade rules from the testing preset to "warn". Do not disable rules
|
|
12
|
-
* (set to "off"). If a rule is already set to a warning, do not disable it.
|
|
13
|
-
*/
|
|
14
|
-
rules: {
|
|
15
|
-
'jest/no-alias-methods': 'warn',
|
|
16
9
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
/** @type import('eslint').Linter.Config[] */
|
|
11
|
+
module.exports = [
|
|
12
|
+
{
|
|
13
|
+
/**
|
|
14
|
+
* Downgrade rules from the testing preset to "warn". Do not disable rules
|
|
15
|
+
* (set to "off"). If a rule is already set to a warning, do not disable it.
|
|
16
|
+
*/
|
|
17
|
+
rules: {
|
|
18
|
+
'jest/no-alias-methods': 'warn',
|
|
19
|
+
'jest/no-done-callback': 'warn',
|
|
20
|
+
'jest/no-conditional-expect': 'warn',
|
|
21
|
+
'jest/no-standalone-expect': 'warn',
|
|
22
|
+
},
|
|
22
23
|
},
|
|
23
|
-
|
|
24
|
+
];
|
|
@@ -5,32 +5,30 @@
|
|
|
5
5
|
* you migrate an existing project to TypeScript. They are primarily focused on
|
|
6
6
|
* allowing relaxed or omitted types.
|
|
7
7
|
*/
|
|
8
|
-
module.exports = {
|
|
9
|
-
overrides: [
|
|
10
|
-
{
|
|
11
|
-
files: [ '**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts' ],
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
9
|
+
/** @type import('eslint').Linter.Config[] */
|
|
10
|
+
module.exports = [
|
|
11
|
+
{
|
|
12
|
+
files: [ '**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts' ],
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Downgrade rules from the base preset to "warn". Do not disable rules (set
|
|
16
|
+
* to "off"). If a rule is already set to a warning, do not disable it.
|
|
17
|
+
*/
|
|
18
|
+
rules: {
|
|
19
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
20
|
+
'@typescript-eslint/no-floating-promises': 'warn',
|
|
21
|
+
'@typescript-eslint/no-misused-promises': 'warn',
|
|
22
|
+
'@typescript-eslint/no-unsafe-argument': 'warn',
|
|
23
|
+
'@typescript-eslint/no-unsafe-assignment': 'warn',
|
|
24
|
+
'@typescript-eslint/no-unsafe-call': 'warn',
|
|
25
|
+
'@typescript-eslint/no-unsafe-member-access': 'warn',
|
|
26
|
+
'@typescript-eslint/no-unsafe-return': 'warn',
|
|
27
|
+
'@typescript-eslint/require-await': 'warn',
|
|
28
|
+
'@typescript-eslint/restrict-plus-operands': 'warn',
|
|
29
|
+
'@typescript-eslint/restrict-template-expressions': 'warn',
|
|
30
|
+
'@typescript-eslint/unbound-method': 'warn',
|
|
31
|
+
'import/no-duplicates': 'warn',
|
|
34
32
|
},
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
},
|
|
34
|
+
];
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not copy this eslint.config.js for your project. See the README for instructions.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const AutomatticPlugin = require( '.' );
|
|
6
|
+
|
|
7
|
+
/** @type import('eslint').Linter.Config[] */
|
|
8
|
+
module.exports = [
|
|
9
|
+
{
|
|
10
|
+
ignores: [ '__fixtures__/**/*' ],
|
|
11
|
+
},
|
|
12
|
+
...AutomatticPlugin.configs.recommended,
|
|
13
|
+
];
|
package/index.js
CHANGED