@perfective/eslint-config 0.20.0-alpha.1 → 0.20.0-alpha.3
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/index.js +1 -1
- package/package.json +11 -11
- package/rules/eslint/layout-formatting.js +1 -1
- package/rules/import/helpful-warnings.js +3 -2
- package/rules/import/module-systems.js +3 -3
- package/rules/import/static-analysis.js +12 -11
- package/rules/import/style-guide.js +16 -12
- package/rules/jest/index.js +0 -1
- package/rules/simple-import-sort/rules/imports.d.ts +2 -2
- package/rules/typescript-eslint/extension-rules.js +6 -0
- package/rules/typescript-eslint/rules/typescript-eslint-naming-convention.d.ts +5 -5
- package/rules/typescript-eslint/rules/typescript-eslint-tslint-config.d.ts +2 -2
- package/rules/unicorn/rules/prevent-abbreviations.d.ts +1 -1
package/index.js
CHANGED
|
@@ -107,7 +107,7 @@ module.exports = {
|
|
|
107
107
|
'@testing-library/jest-dom/extend-expect',
|
|
108
108
|
],
|
|
109
109
|
}],
|
|
110
|
-
'max-nested-callbacks': ['error',
|
|
110
|
+
'max-nested-callbacks': ['error', 5],
|
|
111
111
|
'prefer-arrow/prefer-arrow-functions': 'off',
|
|
112
112
|
'promise/always-return': 'off',
|
|
113
113
|
'rxjs/no-topromise': 'off',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perfective/eslint-config",
|
|
3
|
-
"version": "0.20.0-alpha.
|
|
3
|
+
"version": "0.20.0-alpha.3",
|
|
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>",
|
|
@@ -12,27 +12,27 @@
|
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"@babel/eslint-parser": "^7.19.1",
|
|
15
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
16
|
-
"@typescript-eslint/eslint-plugin-tslint": "^5.
|
|
17
|
-
"@typescript-eslint/parser": "^5.
|
|
18
|
-
"eslint": "^8.
|
|
19
|
-
"eslint-import-resolver-typescript": "^3.5.
|
|
15
|
+
"@typescript-eslint/eslint-plugin": "^5.50.0",
|
|
16
|
+
"@typescript-eslint/eslint-plugin-tslint": "^5.50.0",
|
|
17
|
+
"@typescript-eslint/parser": "^5.50.0",
|
|
18
|
+
"eslint": "^8.33.0",
|
|
19
|
+
"eslint-import-resolver-typescript": "^3.5.3",
|
|
20
20
|
"eslint-plugin-array-func": "^3.1.8",
|
|
21
21
|
"eslint-plugin-cypress": "^2.12.1",
|
|
22
22
|
"eslint-plugin-deprecation": "^1.3.3",
|
|
23
23
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
24
|
-
"eslint-plugin-import": "^2.
|
|
24
|
+
"eslint-plugin-import": "^2.27.5",
|
|
25
25
|
"eslint-plugin-jest": "^27.2.1",
|
|
26
26
|
"eslint-plugin-jest-dom": "^4.0.3",
|
|
27
27
|
"eslint-plugin-jest-formatting": "^3.1.0",
|
|
28
|
-
"eslint-plugin-jsdoc": "^39.
|
|
28
|
+
"eslint-plugin-jsdoc": "^39.7.4",
|
|
29
29
|
"eslint-plugin-node": "^11.1.0",
|
|
30
30
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
31
31
|
"eslint-plugin-promise": "^6.1.1",
|
|
32
32
|
"eslint-plugin-rxjs": "^5.0.2",
|
|
33
|
-
"eslint-plugin-simple-import-sort": "^
|
|
34
|
-
"eslint-plugin-sonarjs": "^0.
|
|
35
|
-
"eslint-plugin-testing-library": "^5.
|
|
33
|
+
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
34
|
+
"eslint-plugin-sonarjs": "^0.18.0",
|
|
35
|
+
"eslint-plugin-testing-library": "^5.10.0",
|
|
36
36
|
"eslint-plugin-unicorn": "^45.0.2",
|
|
37
37
|
"tslint": "^6.1.3"
|
|
38
38
|
},
|
|
@@ -3,11 +3,12 @@ const no_extraneous_dependencies_1 = require("./rules/no-extraneous-dependencies
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
rules: {
|
|
5
5
|
'import/export': 'error',
|
|
6
|
-
'import/no-named-as-default': 'error',
|
|
7
|
-
'import/no-named-as-default-member': 'error',
|
|
8
6
|
'import/no-deprecated': 'off',
|
|
7
|
+
'import/no-empty-named-blocks': 'warn',
|
|
9
8
|
'import/no-extraneous-dependencies': ['error', (0, no_extraneous_dependencies_1.importNoExtraneousDependencies)()],
|
|
10
9
|
'import/no-mutable-exports': 'error',
|
|
10
|
+
'import/no-named-as-default': 'error',
|
|
11
|
+
'import/no-named-as-default-member': 'error',
|
|
11
12
|
'import/no-unused-modules': 'error',
|
|
12
13
|
},
|
|
13
14
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
module.exports = {
|
|
3
3
|
rules: {
|
|
4
|
-
'import/
|
|
4
|
+
'import/no-amd': 'error',
|
|
5
5
|
'import/no-commonjs': ['error', {
|
|
6
6
|
allowConditionalRequire: true,
|
|
7
7
|
allowPrimitiveModules: true,
|
|
8
8
|
}],
|
|
9
|
-
'import/no-amd': 'error',
|
|
10
|
-
'import/no-nodejs-modules': 'off',
|
|
11
9
|
'import/no-import-module-exports': 'error',
|
|
10
|
+
'import/no-nodejs-modules': 'off',
|
|
11
|
+
'import/unambiguous': 'error',
|
|
12
12
|
},
|
|
13
13
|
};
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
module.exports = {
|
|
3
3
|
rules: {
|
|
4
|
-
'import/
|
|
5
|
-
caseSensitive: true,
|
|
6
|
-
caseSensitiveStrict: true,
|
|
7
|
-
}],
|
|
4
|
+
'import/default': 'error',
|
|
8
5
|
'import/named': ['error', {
|
|
9
6
|
commonjs: false,
|
|
10
7
|
}],
|
|
11
|
-
'import/default': 'error',
|
|
12
8
|
'import/namespace': 'error',
|
|
13
|
-
'import/no-restricted-paths': 'off',
|
|
14
9
|
'import/no-absolute-path': 'error',
|
|
10
|
+
'import/no-cycle': ['error', {
|
|
11
|
+
ignoreExternal: true,
|
|
12
|
+
allowUnsafeDynamicCyclicDependency: false,
|
|
13
|
+
}],
|
|
15
14
|
'import/no-dynamic-require': ['error', {
|
|
16
15
|
esmodule: true,
|
|
17
16
|
}],
|
|
18
17
|
'import/no-internal-modules': 'off',
|
|
19
|
-
'import/no-
|
|
18
|
+
'import/no-relative-packages': 'warn',
|
|
19
|
+
'import/no-relative-parent-imports': 'off',
|
|
20
|
+
'import/no-restricted-paths': 'off',
|
|
20
21
|
'import/no-self-import': 'error',
|
|
21
|
-
'import/no-
|
|
22
|
-
|
|
22
|
+
'import/no-unresolved': ['error', {
|
|
23
|
+
caseSensitive: true,
|
|
24
|
+
caseSensitiveStrict: true,
|
|
23
25
|
}],
|
|
24
26
|
'import/no-useless-path-segments': 'warn',
|
|
25
|
-
'import/no-
|
|
26
|
-
'import/no-relative-packages': 'warn',
|
|
27
|
+
'import/no-webpack-loader-syntax': 'error',
|
|
27
28
|
},
|
|
28
29
|
};
|
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
module.exports = {
|
|
3
3
|
rules: {
|
|
4
|
-
'import/
|
|
4
|
+
'import/consistent-type-specifier-style': ['warn', 'prefer-inline'],
|
|
5
|
+
'import/dynamic-import-chunkname': 'off',
|
|
5
6
|
'import/exports-last': 'off',
|
|
7
|
+
'import/extensions': ['error', 'never'],
|
|
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',
|
|
6
16
|
'import/no-duplicates': ['warn', {
|
|
7
|
-
considerQueryString: true,
|
|
17
|
+
'considerQueryString': true,
|
|
18
|
+
'prefer-inline': true,
|
|
8
19
|
}],
|
|
20
|
+
'import/no-named-default': 'error',
|
|
21
|
+
'import/no-named-export': 'off',
|
|
9
22
|
'import/no-namespace': 'off',
|
|
10
|
-
'import/
|
|
23
|
+
'import/no-unassigned-import': 'error',
|
|
11
24
|
'import/order': ['off', {
|
|
12
25
|
'groups': ['unknown', 'builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
|
|
13
26
|
'newlines-between': 'always',
|
|
@@ -16,15 +29,6 @@ module.exports = {
|
|
|
16
29
|
caseInsensitive: false,
|
|
17
30
|
},
|
|
18
31
|
}],
|
|
19
|
-
'import/newline-after-import': 'warn',
|
|
20
32
|
'import/prefer-default-export': 'off',
|
|
21
|
-
'import/max-dependencies': 'off',
|
|
22
|
-
'import/no-unassigned-import': 'error',
|
|
23
|
-
'import/no-named-default': 'error',
|
|
24
|
-
'import/no-default-export': 'error',
|
|
25
|
-
'import/no-named-export': 'off',
|
|
26
|
-
'import/no-anonymous-default-export': 'error',
|
|
27
|
-
'import/group-exports': 'off',
|
|
28
|
-
'import/dynamic-import-chunkname': 'off',
|
|
29
33
|
},
|
|
30
34
|
};
|
package/rules/jest/index.js
CHANGED
|
@@ -40,7 +40,6 @@ module.exports = {
|
|
|
40
40
|
'jest/no-mocks-import': 'error',
|
|
41
41
|
'jest/no-restricted-jest-methods': 'off',
|
|
42
42
|
'jest/no-restricted-matchers': ['error', {
|
|
43
|
-
resolves: 'Use `expect(await promise)` instead.',
|
|
44
43
|
toBeFalsy: 'Avoid `toBeFalsy`',
|
|
45
44
|
toBeTruthy: 'Avoid `toBeTruthy`',
|
|
46
45
|
toMatchSnapshot: 'Use `toMatchInlineSnapshot()` instead',
|
|
@@ -40,6 +40,12 @@ module.exports = {
|
|
|
40
40
|
}],
|
|
41
41
|
'init-declarations': 'off',
|
|
42
42
|
'@typescript-eslint/init-declarations': ['error', 'always'],
|
|
43
|
+
'key-spacing': 'off',
|
|
44
|
+
'@typescript-eslint/key-spacing': ['warn', {
|
|
45
|
+
beforeColon: false,
|
|
46
|
+
afterColon: true,
|
|
47
|
+
mode: 'strict',
|
|
48
|
+
}],
|
|
43
49
|
'keyword-spacing': 'off',
|
|
44
50
|
'@typescript-eslint/keyword-spacing': ['warn', {
|
|
45
51
|
before: true,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
1
|
+
export type TypescriptEslintNamingConventionFormat = 'camelCase' | 'strictCamelCase' | 'PascalCase' | 'StrictPascalCase' | 'snake_case' | 'UPPER_CASE';
|
|
2
|
+
export type TypescriptEslintNamingConventionIndividualSelector = 'variable' | 'function' | 'parameter' | 'classProperty' | 'objectLiteralProperty' | 'typeProperty' | 'parameterProperty' | 'classMethod' | 'objectLiteralMethod' | 'typeMethod' | 'accessor' | 'enumMember' | 'class' | 'interface' | 'typeAlias' | 'enum' | 'typeParameter';
|
|
3
|
+
export type TypescriptEslintNamingConventionGroupSelector = 'default' | 'variableLike' | 'memberLike' | 'typeLike' | 'property' | 'method';
|
|
4
|
+
export type TypescriptEslintNamingConventionSelector = TypescriptEslintNamingConventionIndividualSelector | TypescriptEslintNamingConventionGroupSelector;
|
|
5
|
+
export type TypescriptEslintNamingConventionUnderscore = 'forbid' | 'require' | 'requireDouble' | 'allow' | 'allowDouble' | 'allowSingleOrDouble';
|
|
6
6
|
export interface TypescriptEslintNamingConvention {
|
|
7
7
|
selector: TypescriptEslintNamingConventionSelector | TypescriptEslintNamingConventionSelector[];
|
|
8
8
|
format: TypescriptEslintNamingConventionFormat[] | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type TsLintRule = boolean | [boolean, unknown];
|
|
2
|
+
export type TsLintRules = Record<string, TsLintRule>;
|
|
3
3
|
export interface TypescriptEslintTslintConfig {
|
|
4
4
|
rules: TsLintRules;
|
|
5
5
|
rulesDirectory?: string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type UnicornPreventAbbreviationReplacements = Record<string, boolean | Record<string, boolean>>;
|
|
2
2
|
export interface UnicornPreventAbbreviations {
|
|
3
3
|
replacements: UnicornPreventAbbreviationReplacements;
|
|
4
4
|
extendDefaultReplacements: boolean;
|