@perfective/eslint-config 0.30.0 → 0.31.1
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.adoc +185 -60
- package/README.md +53 -40
- 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/possible-problems-rules.d.ts +2 -0
- package/config/eslint/suggestions-rules.d.ts +2 -0
- package/config/eslint-comments/best-practices-rules.d.ts +2 -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/import/helpful-warnings-rules.d.ts +2 -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/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/style-guide-rules.d.ts +2 -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-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/{rules → config}/simple-import-sort/rules/imports.d.ts +11 -2
- 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/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 +35 -1
- package/config/typescript-eslint/supported-rules.d.ts +2 -0
- package/{rules → config}/typescript-eslint/supported-rules.js +7 -3
- 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 +14 -2
- package/config/unicorn/unicorn-config.d.ts +2 -0
- package/config/unicorn/unicorn-config.js +185 -0
- package/index.d.ts +5 -1766
- package/index.js +5 -102
- 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/{config → linter}/node.d.ts +3 -1
- package/{config → linter}/plugin.d.ts +6 -2
- package/package.json +38 -40
- package/config.d.ts +0 -1
- package/config.js +0 -1
- package/cypress.d.ts +0 -6
- package/cypress.js +0 -31
- package/jest-dom.d.ts +0 -1
- package/jest-dom.js +0 -8
- package/jest.d.ts +0 -7
- package/jest.js +0 -29
- package/rules/array-func/index.d.ts +0 -13
- package/rules/array-func/index.js +0 -14
- package/rules/cypress/index.d.ts +0 -29
- package/rules/cypress/index.js +0 -23
- package/rules/eslint/index.d.ts +0 -339
- package/rules/eslint/index.js +0 -6
- package/rules/eslint/layout-formatting.d.ts +0 -64
- package/rules/eslint/possible-problems.d.ts +0 -96
- package/rules/eslint/suggestions.d.ts +0 -181
- package/rules/eslint-comments/best-practices.d.ts +0 -8
- package/rules/eslint-comments/index.d.ts +0 -20
- package/rules/eslint-comments/index.js +0 -9
- package/rules/eslint-comments/stylistic-issues.d.ts +0 -9
- package/rules/import/helpful-warnings.d.ts +0 -10
- package/rules/import/index.d.ts +0 -78
- package/rules/import/index.js +0 -11
- package/rules/import/module-systems.d.ts +0 -10
- package/rules/import/rules/no-extraneous-dependencies.d.ts +0 -14
- package/rules/import/rules/no-extraneous-dependencies.js +0 -23
- package/rules/import/static-analysis.d.ts +0 -26
- package/rules/import/style-guide.d.ts +0 -33
- package/rules/jest/index.d.ts +0 -124
- package/rules/jest/index.js +0 -98
- package/rules/jest/typescript-eslint.d.ts +0 -5
- package/rules/jest-dom/index.d.ts +0 -32
- package/rules/jest-dom/index.js +0 -19
- package/rules/jsdoc/index.d.ts +0 -134
- package/rules/jsdoc/index.js +0 -161
- package/rules/n/index.d.ts +0 -66
- package/rules/n/index.js +0 -64
- package/rules/prefer-arrow/index.d.ts +0 -13
- package/rules/prefer-arrow/index.js +0 -14
- package/rules/promise/index.d.ts +0 -34
- package/rules/promise/index.js +0 -35
- package/rules/rxjs/index.d.ts +0 -60
- package/rules/rxjs/index.js +0 -60
- package/rules/security/index.d.ts +0 -21
- package/rules/security/index.js +0 -22
- package/rules/simple-import-sort/index.d.ts +0 -10
- package/rules/simple-import-sort/index.js +0 -12
- package/rules/stylistic/js/index.d.ts +0 -204
- package/rules/stylistic/js/index.js +0 -198
- package/rules/stylistic/jsx/index.d.ts +0 -87
- package/rules/stylistic/jsx/index.js +0 -81
- package/rules/stylistic/plus/index.d.ts +0 -18
- package/rules/stylistic/plus/index.js +0 -14
- package/rules/stylistic/ts/index.d.ts +0 -141
- package/rules/stylistic/ts/index.js +0 -135
- package/rules/testing-library/index.d.ts +0 -62
- package/rules/testing-library/index.js +0 -41
- package/rules/typescript-eslint/extension-rules.d.ts +0 -113
- package/rules/typescript-eslint/index.d.ts +0 -371
- package/rules/typescript-eslint/index.js +0 -9
- package/rules/typescript-eslint/supported-rules.d.ts +0 -255
- package/rules/unicorn/index.d.ts +0 -183
- package/rules/unicorn/index.js +0 -178
- package/rules.d.ts +0 -4
- package/rules.js +0 -4
- package/rxjs.d.ts +0 -6
- package/rxjs.js +0 -22
- package/testing-library.d.ts +0 -1
- package/testing-library.js +0 -8
- /package/{rules/eslint/layout-formatting.js → config/eslint/layout-formatting-rules.js} +0 -0
- /package/{rules/eslint/possible-problems.js → config/eslint/possible-problems-rules.js} +0 -0
- /package/{rules/eslint/suggestions.js → config/eslint/suggestions-rules.js} +0 -0
- /package/{rules/eslint-comments/best-practices.js → config/eslint-comments/best-practices-rules.js} +0 -0
- /package/{rules/eslint-comments/stylistic-issues.js → config/eslint-comments/stylistic-issues-rules.js} +0 -0
- /package/{rules/import/helpful-warnings.js → config/import/helpful-warnings-rules.js} +0 -0
- /package/{rules/import/module-systems.js → config/import/module-systems-rules.js} +0 -0
- /package/{rules/import/static-analysis.js → config/import/static-analysis-rules.js} +0 -0
- /package/{rules/import/style-guide.js → config/import/style-guide-rules.js} +0 -0
- /package/{rules/jest/typescript-eslint.js → config/jest/typescript-eslint-jest-rules.js} +0 -0
- /package/{rules → config}/simple-import-sort/rules/imports.js +0 -0
- /package/{rules → config}/typescript-eslint/extension-rules.js +0 -0
- /package/{rules → config}/typescript-eslint/rules/typescript-eslint-naming-convention.js +0 -0
- /package/{rules → config}/unicorn/rules/prevent-abbreviations.js +0 -0
- /package/{config → linter}/node.js +0 -0
- /package/{config → linter}/plugin.js +0 -0
|
@@ -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 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { jestDomConfig } from './jest-dom-config';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { jestDomConfig } from "./jest-dom-config.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Linter } from 'eslint';
|
|
2
|
+
import { Glob } from '../../linter/glob';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a flat config for `eslint-plugin-jest-dom` for a given list of files globs.
|
|
5
|
+
*
|
|
6
|
+
* @since v0.31.0
|
|
7
|
+
*/
|
|
8
|
+
export declare function jestDomConfig(files?: Glob[]): Linter.Config;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import eslintPluginJestDom from 'eslint-plugin-jest-dom';
|
|
2
|
+
import { jestFiles } from "../../linter/glob.js";
|
|
3
|
+
export function jestDomConfig(files = jestFiles) {
|
|
4
|
+
return {
|
|
5
|
+
files,
|
|
6
|
+
plugins: {
|
|
7
|
+
'jest-dom': eslintPluginJestDom
|
|
8
|
+
},
|
|
9
|
+
rules: {
|
|
10
|
+
'jest-dom/prefer-checked': 'warn',
|
|
11
|
+
'jest-dom/prefer-empty': 'warn',
|
|
12
|
+
'jest-dom/prefer-enabled-disabled': 'warn',
|
|
13
|
+
'jest-dom/prefer-focus': 'warn',
|
|
14
|
+
'jest-dom/prefer-in-document': 'off',
|
|
15
|
+
'jest-dom/prefer-required': 'warn',
|
|
16
|
+
'jest-dom/prefer-to-have-attribute': 'warn',
|
|
17
|
+
'jest-dom/prefer-to-have-class': 'warn',
|
|
18
|
+
'jest-dom/prefer-to-have-style': 'warn',
|
|
19
|
+
'jest-dom/prefer-to-have-text-content': 'warn',
|
|
20
|
+
'jest-dom/prefer-to-have-value': 'warn'
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import eslintPluginJsdoc from 'eslint-plugin-jsdoc';
|
|
2
|
+
import { javascriptFiles } from "../../linter/glob.js";
|
|
3
|
+
import { javascriptLanguageOptions } from "../../linter/language-options.js";
|
|
4
|
+
export function jsdocConfig() {
|
|
5
|
+
return {
|
|
6
|
+
plugins: {
|
|
7
|
+
jsdoc: {
|
|
8
|
+
rules: eslintPluginJsdoc.configs['flat/recommended'].plugins['jsdoc'].rules
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
settings: {
|
|
12
|
+
jsdoc: {
|
|
13
|
+
tagNamePreference: {
|
|
14
|
+
augments: {
|
|
15
|
+
message: 'Use @extends instead of @augments as it is more evocative of classes than @augments',
|
|
16
|
+
replacement: 'extends'
|
|
17
|
+
},
|
|
18
|
+
todo: {
|
|
19
|
+
message: 'Use TODO for comments'
|
|
20
|
+
},
|
|
21
|
+
fires: {
|
|
22
|
+
replacement: 'emits'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
ignoreReplacesDocs: true,
|
|
26
|
+
overrideReplacesDocs: true,
|
|
27
|
+
augmentsExtendsReplacesDocs: false,
|
|
28
|
+
implementsReplacesDoc: false
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
rules: {
|
|
32
|
+
'jsdoc/check-access': 'off',
|
|
33
|
+
'jsdoc/check-alignment': 'error',
|
|
34
|
+
'jsdoc/check-examples': 'off',
|
|
35
|
+
'jsdoc/check-indentation': 'off',
|
|
36
|
+
'jsdoc/check-line-alignment': ['off', 'never'],
|
|
37
|
+
'jsdoc/check-param-names': ['error', {
|
|
38
|
+
allowExtraTrailingParamDocs: false,
|
|
39
|
+
checkDestructured: true,
|
|
40
|
+
checkRestProperty: false,
|
|
41
|
+
disableExtraPropertyReporting: false,
|
|
42
|
+
disableMissingParamChecks: false,
|
|
43
|
+
enableFixer: true,
|
|
44
|
+
useDefaultObjectProperties: false
|
|
45
|
+
}],
|
|
46
|
+
'jsdoc/check-property-names': ['error', {
|
|
47
|
+
enableFixer: true
|
|
48
|
+
}],
|
|
49
|
+
'jsdoc/check-syntax': 'error',
|
|
50
|
+
'jsdoc/check-tag-names': ['error', {
|
|
51
|
+
definedTags: ['final', 'flags', 'sealed', 'workaround'],
|
|
52
|
+
jsxTags: true
|
|
53
|
+
}],
|
|
54
|
+
'jsdoc/check-template-names': 'error',
|
|
55
|
+
'jsdoc/check-types': ['error', {
|
|
56
|
+
noDefaults: false
|
|
57
|
+
}],
|
|
58
|
+
'jsdoc/check-values': 'error',
|
|
59
|
+
'jsdoc/convert-to-jsdoc-comments': 'off',
|
|
60
|
+
'jsdoc/empty-tags': ['error', {
|
|
61
|
+
tags: ['final', 'flags', 'sealed']
|
|
62
|
+
}],
|
|
63
|
+
'jsdoc/implements-on-classes': 'error',
|
|
64
|
+
'jsdoc/imports-as-dependencies': 'error',
|
|
65
|
+
'jsdoc/lines-before-block': 'off',
|
|
66
|
+
'jsdoc/match-description': 'error',
|
|
67
|
+
'jsdoc/match-name': 'off',
|
|
68
|
+
'jsdoc/multiline-blocks': ['warn', {
|
|
69
|
+
noZeroLineText: true,
|
|
70
|
+
noFinalLineText: true,
|
|
71
|
+
noSingleLineBlocks: true,
|
|
72
|
+
singleLineTags: ['lends', 'type', 'deprecated'],
|
|
73
|
+
noMultilineBlocks: false,
|
|
74
|
+
multilineTags: ['*'],
|
|
75
|
+
allowMultipleTags: true
|
|
76
|
+
}],
|
|
77
|
+
'jsdoc/no-bad-blocks': ['error', {
|
|
78
|
+
ignore: ['ts-check', 'ts-expect-error', 'ts-ignore', 'ts-nocheck', 'typescript-eslint'],
|
|
79
|
+
preventAllMultiAsteriskBlocks: false
|
|
80
|
+
}],
|
|
81
|
+
'jsdoc/no-blank-blocks': 'warn',
|
|
82
|
+
'jsdoc/no-blank-block-descriptions': 'off',
|
|
83
|
+
'jsdoc/no-defaults': 'error',
|
|
84
|
+
'jsdoc/no-missing-syntax': 'off',
|
|
85
|
+
'jsdoc/no-multi-asterisks': ['error', {
|
|
86
|
+
allowWhitespace: false,
|
|
87
|
+
preventAtMiddleLines: true,
|
|
88
|
+
preventAtEnd: true
|
|
89
|
+
}],
|
|
90
|
+
'jsdoc/no-restricted-syntax': 'off',
|
|
91
|
+
'jsdoc/no-types': 'error',
|
|
92
|
+
'jsdoc/no-undefined-types': 'error',
|
|
93
|
+
'jsdoc/require-asterisk-prefix': ['error', 'always'],
|
|
94
|
+
'jsdoc/require-description': ['error', {
|
|
95
|
+
exemptedBy: ['inheritdoc', 'package', 'private', 'see', 'deprecated']
|
|
96
|
+
}],
|
|
97
|
+
'jsdoc/require-description-complete-sentence': 'warn',
|
|
98
|
+
'jsdoc/require-example': 'off',
|
|
99
|
+
'jsdoc/require-file-overview': 'off',
|
|
100
|
+
'jsdoc/require-hyphen-before-param-description': ['warn', 'always'],
|
|
101
|
+
'jsdoc/require-jsdoc': 'off',
|
|
102
|
+
'jsdoc/require-param': 'off',
|
|
103
|
+
'jsdoc/require-param-description': 'error',
|
|
104
|
+
'jsdoc/require-param-name': 'error',
|
|
105
|
+
'jsdoc/require-param-type': 'off',
|
|
106
|
+
'jsdoc/require-property': 'error',
|
|
107
|
+
'jsdoc/require-property-description': 'error',
|
|
108
|
+
'jsdoc/require-property-name': 'error',
|
|
109
|
+
'jsdoc/require-property-type': 'error',
|
|
110
|
+
'jsdoc/require-returns': 'off',
|
|
111
|
+
'jsdoc/require-returns-check': 'error',
|
|
112
|
+
'jsdoc/require-returns-description': 'error',
|
|
113
|
+
'jsdoc/require-returns-type': 'off',
|
|
114
|
+
'jsdoc/require-template': ['off', {
|
|
115
|
+
requireSeparateTemplates: false
|
|
116
|
+
}],
|
|
117
|
+
'jsdoc/require-throws': 'error',
|
|
118
|
+
'jsdoc/require-yields': 'error',
|
|
119
|
+
'jsdoc/require-yields-check': 'error',
|
|
120
|
+
'jsdoc/sort-tags': ['warn', {
|
|
121
|
+
tagSequence: [{
|
|
122
|
+
tags: ['summary', 'typeSummary']
|
|
123
|
+
}, {
|
|
124
|
+
tags: ['module', 'exports', 'file', 'fileoverview', 'overview']
|
|
125
|
+
}, {
|
|
126
|
+
tags: ['typedef', 'interface', 'record', 'template', 'name', 'kind', 'type', 'alias', 'external', 'host', 'callback', 'func', 'function', 'method', 'class', 'constructor']
|
|
127
|
+
}, {
|
|
128
|
+
tags: ['modifies', 'mixes', 'mixin', 'mixinClass', 'mixinFunction', 'namespace', 'borrows', 'constructs', 'lends', 'implements', 'requires']
|
|
129
|
+
}, {
|
|
130
|
+
tags: ['desc', 'description', 'classdesc', 'tutorial', 'copyright', 'license']
|
|
131
|
+
}, {
|
|
132
|
+
tags: ['const', 'constant', 'final', 'global', 'readonly', 'abstract', 'virtual', 'var', 'member', 'memberof', 'memberof!', 'inner', 'instance', 'inheritdoc', 'inheritDoc', 'override', 'hideconstructor']
|
|
133
|
+
}, {
|
|
134
|
+
tags: ['param', 'arg', 'argument', 'prop', 'property']
|
|
135
|
+
}, {
|
|
136
|
+
tags: ['async', 'generator', 'default', 'defaultvalue', 'enum', 'augments', 'extends', 'return', 'returns', 'throws', 'exception', 'yield', 'yields', 'event', 'fires', 'emits', 'listens', 'this']
|
|
137
|
+
}, {
|
|
138
|
+
tags: ['static', 'private', 'protected', 'public', 'access', 'package']
|
|
139
|
+
}, {
|
|
140
|
+
tags: ['see', 'example']
|
|
141
|
+
}, {
|
|
142
|
+
tags: ['closurePrimitive', 'customElement', 'expose', 'hidden', 'idGenerator', 'meaning', 'ngInject', 'owner', 'wizaction']
|
|
143
|
+
}, {
|
|
144
|
+
tags: ['define', 'dict', 'export', 'externs', 'implicitCast', 'noalias', 'nocollapse', 'nocompile', 'noinline', 'nosideeffects', 'polymer', 'polymerBehavior', 'preserve', 'struct', 'suppress', 'unrestricted']
|
|
145
|
+
}, {
|
|
146
|
+
tags: ['category']
|
|
147
|
+
}, {
|
|
148
|
+
tags: ['ignore', 'author', 'version', 'variation', 'since', 'deprecated', 'todo']
|
|
149
|
+
}],
|
|
150
|
+
alphabetizeExtras: false,
|
|
151
|
+
linesBetween: 1,
|
|
152
|
+
reportTagGroupSpacing: true,
|
|
153
|
+
reportIntraTagGroupSpacing: true
|
|
154
|
+
}],
|
|
155
|
+
'jsdoc/tag-lines': ['warn', 'always', {
|
|
156
|
+
count: 0,
|
|
157
|
+
startLines: 1,
|
|
158
|
+
endLines: 0,
|
|
159
|
+
applyToEndTag: false,
|
|
160
|
+
tags: {}
|
|
161
|
+
}],
|
|
162
|
+
'jsdoc/valid-types': 'error'
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
export function jsdocJavascriptConfig() {
|
|
167
|
+
return {
|
|
168
|
+
files: javascriptFiles,
|
|
169
|
+
languageOptions: javascriptLanguageOptions(),
|
|
170
|
+
rules: {
|
|
171
|
+
'jsdoc/no-types': 'off',
|
|
172
|
+
'jsdoc/no-undefined-types': 'off',
|
|
173
|
+
'jsdoc/require-param': 'error',
|
|
174
|
+
'jsdoc/require-param-type': 'error',
|
|
175
|
+
'jsdoc/require-returns': 'error',
|
|
176
|
+
'jsdoc/require-returns-type': 'error'
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import eslintPluginN from 'eslint-plugin-n';
|
|
2
|
+
export function nodeConfig() {
|
|
3
|
+
return {
|
|
4
|
+
plugins: {
|
|
5
|
+
n: eslintPluginN
|
|
6
|
+
},
|
|
7
|
+
rules: {
|
|
8
|
+
'n/callback-return': ['error', ['callback', 'cb', 'next']],
|
|
9
|
+
'n/exports-style': ['warn', 'module.exports', {
|
|
10
|
+
allowBatchAssign: false
|
|
11
|
+
}],
|
|
12
|
+
'n/file-extension-in-import': 'off',
|
|
13
|
+
'n/global-require': 'error',
|
|
14
|
+
'n/handle-callback-err': 'error',
|
|
15
|
+
'n/hashbang': 'warn',
|
|
16
|
+
'n/no-callback-literal': 'error',
|
|
17
|
+
'n/no-deprecated-api': 'error',
|
|
18
|
+
'n/no-exports-assign': 'error',
|
|
19
|
+
'n/no-extraneous-import': 'off',
|
|
20
|
+
'n/no-extraneous-require': 'off',
|
|
21
|
+
'n/no-hide-core-modules': 'off',
|
|
22
|
+
'n/no-missing-import': 'off',
|
|
23
|
+
'n/no-missing-require': 'off',
|
|
24
|
+
'n/no-mixed-requires': 'error',
|
|
25
|
+
'n/no-new-require': 'error',
|
|
26
|
+
'n/no-path-concat': 'error',
|
|
27
|
+
'n/no-process-env': 'error',
|
|
28
|
+
'n/no-process-exit': 'off',
|
|
29
|
+
'n/no-restricted-import': 'error',
|
|
30
|
+
'n/no-restricted-require': 'error',
|
|
31
|
+
'n/no-sync': ['error', {
|
|
32
|
+
allowAtRootLevel: false
|
|
33
|
+
}],
|
|
34
|
+
'n/no-unpublished-bin': 'error',
|
|
35
|
+
'n/no-unpublished-import': ['error', {
|
|
36
|
+
ignorePrivate: false
|
|
37
|
+
}],
|
|
38
|
+
'n/no-unpublished-require': ['error', {
|
|
39
|
+
allowModules: [],
|
|
40
|
+
ignorePrivate: false,
|
|
41
|
+
tryExtensions: ['.js', '.json', '.node']
|
|
42
|
+
}],
|
|
43
|
+
'n/no-unsupported-features/es-builtins': ['error', {
|
|
44
|
+
version: '>=18.0.0',
|
|
45
|
+
ignores: []
|
|
46
|
+
}],
|
|
47
|
+
'n/no-unsupported-features/es-syntax': 'off',
|
|
48
|
+
'n/no-unsupported-features/node-builtins': ['error', {
|
|
49
|
+
version: '>=18.0.0',
|
|
50
|
+
ignores: []
|
|
51
|
+
}],
|
|
52
|
+
'n/prefer-global/buffer': ['error', 'always'],
|
|
53
|
+
'n/prefer-global/console': ['error', 'always'],
|
|
54
|
+
'n/prefer-global/process': ['error', 'always'],
|
|
55
|
+
'n/prefer-global/text-decoder': ['error', 'always'],
|
|
56
|
+
'n/prefer-global/text-encoder': ['error', 'always'],
|
|
57
|
+
'n/prefer-global/url': ['error', 'always'],
|
|
58
|
+
'n/prefer-global/url-search-params': ['error', 'always'],
|
|
59
|
+
'n/prefer-node-protocol': 'off',
|
|
60
|
+
'n/prefer-promises/dns': 'error',
|
|
61
|
+
'n/prefer-promises/fs': 'error',
|
|
62
|
+
'n/process-exit-as-throw': 'error',
|
|
63
|
+
'n/shebang': 'off'
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { configurationFiles, typescriptDeclarationFiles } from "../linter/glob.js";
|
|
2
|
+
import { languageOptions } from "../linter/language-options.js";
|
|
3
|
+
import { linterConfig } from "../linter/linter-config.js";
|
|
4
|
+
import { arrayFuncConfig } from "./array-func/array-func-config.js";
|
|
5
|
+
import { eslintConfig } from "./eslint/eslint-config.js";
|
|
6
|
+
import { eslintCommentsConfig } from "./eslint-comments/eslint-comments-config.js";
|
|
7
|
+
import { importConfig, importJavascriptConfig, importTypescriptConfig } from "./import/import-config.js";
|
|
8
|
+
import { importNoExtraneousDependencies } from "./import/index.js";
|
|
9
|
+
import { jsdocConfig, jsdocJavascriptConfig } from "./jsdoc/jsdoc-config.js";
|
|
10
|
+
import { nodeConfig } from "./node/node-config.js";
|
|
11
|
+
import { preferArrowConfig } from "./prefer-arrow/prefer-arrow-config.js";
|
|
12
|
+
import { promiseConfig } from "./promise/promise-config.js";
|
|
13
|
+
import { securityConfig } from "./security/security-config.js";
|
|
14
|
+
import { simpleImportSortConfig } from "./simple-import-sort/simple-import-sort-config.js";
|
|
15
|
+
import { stylisticJsConfig } from "./stylistic/js/stylistic-js-config.js";
|
|
16
|
+
import { stylisticJsxConfig } from "./stylistic/jsx/stylistic-jsx-config.js";
|
|
17
|
+
import { stylisticPlusConfig } from "./stylistic/plus/stylistic-plus-config.js";
|
|
18
|
+
import { stylisticTsConfig } from "./stylistic/ts/stylistic-ts-config.js";
|
|
19
|
+
import { typescriptEslintConfig } from "./typescript-eslint/typescript-eslint-config.js";
|
|
20
|
+
import { unicornConfig } from "./unicorn/unicorn-config.js";
|
|
21
|
+
export function perfectiveEslintConfig(configs = []) {
|
|
22
|
+
return [{
|
|
23
|
+
languageOptions: languageOptions()
|
|
24
|
+
}, {
|
|
25
|
+
ignores: ['**/dist', typescriptDeclarationFiles]
|
|
26
|
+
}, eslintConfig(), typescriptEslintConfig(), arrayFuncConfig(), eslintCommentsConfig(), importConfig(), importJavascriptConfig(), importTypescriptConfig(), jsdocConfig(), jsdocJavascriptConfig(), nodeConfig(), preferArrowConfig(), promiseConfig(), securityConfig(), simpleImportSortConfig(), stylisticJsConfig(), stylisticJsxConfig(), stylisticPlusConfig(), stylisticTsConfig(), unicornConfig(), configurationFilesConfig()].concat(configs.map(linterConfig));
|
|
27
|
+
}
|
|
28
|
+
function configurationFilesConfig() {
|
|
29
|
+
return {
|
|
30
|
+
files: configurationFiles,
|
|
31
|
+
rules: {
|
|
32
|
+
'import/extensions': ['error', 'ignorePackages'],
|
|
33
|
+
'import/no-default-export': ['off'],
|
|
34
|
+
'import/no-extraneous-dependencies': ['error', importNoExtraneousDependencies({
|
|
35
|
+
devDependencies: configurationFiles
|
|
36
|
+
})],
|
|
37
|
+
'n/no-unpublished-import': ['error', {
|
|
38
|
+
allowModules: ['gulp', '@perfective/build'],
|
|
39
|
+
convertPath: {
|
|
40
|
+
'dist/**/*.js': ['^dist/(.+)?\\.js$', '$1.js']
|
|
41
|
+
}
|
|
42
|
+
}]
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import eslintPluginPreferArrow from 'eslint-plugin-prefer-arrow';
|
|
2
|
+
export function preferArrowConfig() {
|
|
3
|
+
return {
|
|
4
|
+
plugins: {
|
|
5
|
+
'prefer-arrow': eslintPluginPreferArrow
|
|
6
|
+
},
|
|
7
|
+
rules: {
|
|
8
|
+
'prefer-arrow/prefer-arrow-functions': ['error', {
|
|
9
|
+
allowStandaloneDeclarations: true,
|
|
10
|
+
classPropertiesAllowed: false,
|
|
11
|
+
disallowPrototype: false,
|
|
12
|
+
singleReturnOnly: false
|
|
13
|
+
}]
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import eslintPluginPromise from 'eslint-plugin-promise';
|
|
2
|
+
export function promiseConfig() {
|
|
3
|
+
return {
|
|
4
|
+
plugins: {
|
|
5
|
+
promise: eslintPluginPromise
|
|
6
|
+
},
|
|
7
|
+
rules: {
|
|
8
|
+
'promise/catch-or-return': ['error', {
|
|
9
|
+
allowThen: false,
|
|
10
|
+
allowThenStrict: false,
|
|
11
|
+
allowFinally: true
|
|
12
|
+
}],
|
|
13
|
+
'promise/no-return-wrap': 'error',
|
|
14
|
+
'promise/param-names': 'warn',
|
|
15
|
+
'promise/always-return': ['error', {
|
|
16
|
+
ignoreAssignmentVariable: ['globalThis']
|
|
17
|
+
}],
|
|
18
|
+
'promise/no-multiple-resolved': 'error',
|
|
19
|
+
'promise/no-native': 'off',
|
|
20
|
+
'promise/no-nesting': 'error',
|
|
21
|
+
'promise/no-promise-in-callback': 'error',
|
|
22
|
+
'promise/no-callback-in-promise': ['error', {
|
|
23
|
+
timeoutsErr: false
|
|
24
|
+
}],
|
|
25
|
+
'promise/avoid-new': 'off',
|
|
26
|
+
'promise/no-new-statics': 'warn',
|
|
27
|
+
'promise/no-return-in-finally': 'error',
|
|
28
|
+
'promise/prefer-catch': 'warn',
|
|
29
|
+
'promise/spec-only': ['error', {
|
|
30
|
+
allowedMethods: []
|
|
31
|
+
}],
|
|
32
|
+
'promise/valid-params': 'error',
|
|
33
|
+
'promise/prefer-await-to-then': 'off',
|
|
34
|
+
'promise/prefer-await-to-callbacks': 'off'
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { rxjsConfig } from './rxjs-config';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { rxjsConfig } from "./rxjs-config.js";
|