linter-bundle 6.2.2 → 7.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/.linter-bundle.js +27 -17
- package/.linter-bundle.schema.json +45 -0
- package/CHANGELOG.md +149 -4
- package/README.md +60 -63
- package/eslint/gatsby.mjs +95 -0
- package/eslint/index.mjs +1127 -0
- package/eslint/javascript-lazy.mjs +24 -0
- package/eslint/javascript.mjs +126 -0
- package/eslint/jest.mjs +172 -0
- package/eslint/jsdoc.mjs +103 -0
- package/eslint/react.mjs +232 -0
- package/eslint/rules/no-unnecessary-typeof.md +1 -1
- package/eslint/rules/{no-unnecessary-typeof.js → no-unnecessary-typeof.mjs} +9 -11
- package/eslint/rules/restricted-filenames.md +4 -4
- package/eslint/rules/{restricted-filenames.js → restricted-filenames.mjs} +7 -6
- package/eslint/storybook.mjs +42 -0
- package/eslint/type-declarations.mjs +49 -0
- package/eslint/{overrides-worker.cjs → worker.mjs} +12 -14
- package/eslint.mjs +5 -0
- package/files/index.js +3 -3
- package/helper/{ensure-type.cjs → ensure-type.mjs} +1 -5
- package/helper/get-outdated-dependencies.js +4 -4
- package/helper/get-outdated-overrides.js +2 -2
- package/helper/get-stylelint-path.js +4 -3
- package/helper/is-npm-or-yarn.js +2 -2
- package/helper/linter-bundle-config.d.ts +24 -0
- package/helper/linter-bundle-config.js +9 -14
- package/helper/run-process.js +1 -1
- package/lint.js +21 -16
- package/package.json +31 -29
- package/stylelint/index.mjs +1111 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/html-tags/{index.cjs → index.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/reference/{selectors.cjs → selectors.mjs} +15 -31
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-case/{index.cjs → index.mjs} +6 -12
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-space-after/{index.cjs → index.mjs} +11 -13
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-semicolon-newline-after/{index.cjs → index.mjs} +18 -22
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-semicolon-space-before/{index.cjs → index.mjs} +10 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{atRuleNameSpaceChecker.cjs → atRuleNameSpaceChecker.mjs} +4 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-empty-line-before/{index.cjs → index.mjs} +16 -30
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-newline-after/{index.cjs → index.mjs} +13 -35
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-newline-before/{index.cjs → index.mjs} +11 -40
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-space-before/{index.cjs → index.mjs} +10 -27
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-newline-after/{index.cjs → index.mjs} +14 -65
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-space-after/{index.cjs → index.mjs} +13 -30
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-space-before/{index.cjs → index.mjs} +14 -27
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/color-hex-case/{index.cjs → index.mjs} +10 -16
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-after/index.mjs +93 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-before/{index.cjs → index.mjs} +11 -12
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-newline-after/{index.cjs → index.mjs} +11 -29
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-newline-before/{index.cjs → index.mjs} +9 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-space-after/{index.cjs → index.mjs} +10 -23
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-space-before/{index.cjs → index.mjs} +11 -36
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-trailing-semicolon/{index.cjs → index.mjs} +9 -27
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-newline-after/{index.cjs → index.mjs} +9 -25
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-space-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-space-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{declarationBangSpaceChecker.cjs → declarationBangSpaceChecker.mjs} +5 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{declarationColonSpaceChecker.cjs → declarationColonSpaceChecker.mjs} +5 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{findMediaOperator.cjs → findMediaOperator.mjs} +2 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-newline-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-newline-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-space-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-space-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-max-empty-lines/{index.cjs → index.mjs} +19 -39
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-parentheses-newline-inside/{index.cjs → index.mjs} +19 -54
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-parentheses-space-inside/{index.cjs → index.mjs} +21 -68
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-whitespace-after/{index.cjs → index.mjs} +16 -31
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{functionCommaSpaceChecker.cjs → functionCommaSpaceChecker.mjs} +8 -7
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{functionCommaSpaceFix.cjs → functionCommaSpaceFix.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/indentation/{index.cjs → index.mjs} +39 -64
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/linebreaks/{index.cjs → index.mjs} +15 -44
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-empty-lines/{index.cjs → index.mjs} +10 -49
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-line-length/{index.cjs → index.mjs} +10 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-colon-space-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-colon-space-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-name-case/{index.cjs → index.mjs} +9 -16
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-parentheses-space-inside/{index.cjs → index.mjs} +8 -21
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-range-operator-space-after/{index.cjs → index.mjs} +10 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-range-operator-space-before/{index.cjs → index.mjs} +10 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-newline-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-newline-before/{index.cjs → index.mjs} +6 -6
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-space-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-space-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{mediaFeatureColonSpaceChecker.cjs → mediaFeatureColonSpaceChecker.mjs} +5 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{mediaQueryListCommaWhitespaceChecker.cjs → mediaQueryListCommaWhitespaceChecker.mjs} +6 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-empty-first-line/{index.cjs → index.mjs} +6 -20
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-eol-whitespace/{index.cjs → index.mjs} +13 -16
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-extra-semicolons/{index.cjs → index.mjs} +10 -33
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-missing-end-of-source-newline/{index.cjs → index.mjs} +7 -13
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/number-leading-zero/{index.cjs → index.mjs} +13 -31
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/number-no-trailing-zeros/{index.cjs → index.mjs} +9 -18
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/property-case/{index.cjs → index.mjs} +10 -16
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-brackets-space-inside/{index.cjs → index.mjs} +9 -36
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-operator-space-after/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-operator-space-before/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-combinator-space-after/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-combinator-space-before/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-descendant-combinator-no-non-space/{index.cjs → index.mjs} +9 -20
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-newline-after/{index.cjs → index.mjs} +9 -14
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-newline-before/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-space-after/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-space-before/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-max-empty-lines/{index.cjs → index.mjs} +10 -21
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-class-case/{index.cjs → index.mjs} +10 -24
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-class-parentheses-space-inside/{index.cjs → index.mjs} +12 -35
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-element-case/{index.cjs → index.mjs} +10 -15
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{selectorAttributeOperatorSpaceChecker.cjs → selectorAttributeOperatorSpaceChecker.mjs} +6 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{selectorCombinatorSpaceChecker.cjs → selectorCombinatorSpaceChecker.mjs} +12 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{selectorListCommaWhitespaceChecker.cjs → selectorListCommaWhitespaceChecker.mjs} +5 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/string-quotes/{index.cjs → index.mjs} +43 -65
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unicode-bom/{index.cjs → index.mjs} +5 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unit-case/{index.cjs → index.mjs} +17 -34
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-newline-after/{index.cjs → index.mjs} +11 -12
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-newline-before/{index.cjs → index.mjs} +6 -6
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-space-after/{index.cjs → index.mjs} +10 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-space-before/{index.cjs → index.mjs} +10 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-max-empty-lines/{index.cjs → index.mjs} +12 -18
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{valueListCommaWhitespaceChecker.cjs → valueListCommaWhitespaceChecker.mjs} +6 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/style-search/{index.cjs → index.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{addEmptyLineAfter.cjs → addEmptyLineAfter.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{hasEmptyBlock.cjs → hasEmptyBlock.mjs} +2 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{nextNonCommentNode.cjs → nextNonCommentNode.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{removeEmptyLinesAfter.cjs → removeEmptyLinesAfter.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/transformSelector.mjs +19 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{whitespaceChecker.cjs → whitespaceChecker.mjs} +5 -5
- package/stylelint/plugins/stylelint-selector-no-empty.js +2 -0
- package/stylelint/plugins/stylelint-selector-tag-no-without-class.js +2 -2
- package/stylelint.mjs +6 -0
- package/TODO.md +0 -58
- package/eslint/index.cjs +0 -1065
- package/eslint/overrides-gatsby.cjs +0 -108
- package/eslint/overrides-javascript-lazy.cjs +0 -27
- package/eslint/overrides-javascript.cjs +0 -121
- package/eslint/overrides-jest.cjs +0 -144
- package/eslint/overrides-jsdoc.cjs +0 -94
- package/eslint/overrides-react.cjs +0 -220
- package/eslint/overrides-storybook.cjs +0 -44
- package/eslint/overrides-type-declarations.cjs +0 -51
- package/eslint/rules/no-global-undefined-check.js +0 -85
- package/eslint/rules/no-global-undefined-check.md +0 -34
- package/eslint.cjs +0 -5
- package/stylelint/index.cjs +0 -1104
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-after/index.cjs +0 -95
- package/stylelint.cjs +0 -5
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Settings for Gatsby-based projects.
|
|
3
|
-
*
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
module.exports = {
|
|
7
|
-
overrides: [
|
|
8
|
-
{
|
|
9
|
-
files: ['*.ts', '*.tsx'],
|
|
10
|
-
rules: {
|
|
11
|
-
/**
|
|
12
|
-
* ./rules
|
|
13
|
-
*/
|
|
14
|
-
'no-global-undefined-check': 'error',
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* eslint
|
|
18
|
-
* @see https://eslint.org/docs/rules/
|
|
19
|
-
*/
|
|
20
|
-
'no-restricted-imports': ['error', {
|
|
21
|
-
paths: [{
|
|
22
|
-
name: '@reach/router',
|
|
23
|
-
importNames: ['useNavigate'],
|
|
24
|
-
message: 'Use "import { navigate } from \'gatsby\';" instead of "const navigate = useNavigate();"'
|
|
25
|
-
}]
|
|
26
|
-
}],
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* typescript-eslint
|
|
30
|
-
* @see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules
|
|
31
|
-
*/
|
|
32
|
-
'@typescript-eslint/no-confusing-void-expression': 'off', // @todo Conflicts with graphql-template strings
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* eslint-plugin-import
|
|
36
|
-
* @see https://github.com/import-js/eslint-plugin-import
|
|
37
|
-
*/
|
|
38
|
-
'import/no-unresolved': ['error', { caseSensitiveStrict: true, ignore: ['@reach/router'] }],
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* eslint-plugin-unicorn
|
|
42
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn
|
|
43
|
-
*/
|
|
44
|
-
'unicorn/string-content': ['error', {
|
|
45
|
-
patterns: {
|
|
46
|
-
// '\\.\\.\\.': '…', // @todo Does not support graphql-template strings. Report that as bug!
|
|
47
|
-
// eslint-disable-next-line unicorn/string-content -- If not disabled, the rule would report it's own disable-patterns.
|
|
48
|
-
'->': '→'
|
|
49
|
-
}
|
|
50
|
-
}]
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
files: ['*.tsx'],
|
|
55
|
-
settings: {
|
|
56
|
-
linkComponents: [
|
|
57
|
-
{ name: 'Link', linkAttribute: 'to' }
|
|
58
|
-
]
|
|
59
|
-
},
|
|
60
|
-
rules: {
|
|
61
|
-
/**
|
|
62
|
-
* eslint-plugin-unicorn
|
|
63
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn
|
|
64
|
-
*/
|
|
65
|
-
'unicorn/filename-case': ['off', { // Disabled in favour of the linter-bundle `files` task
|
|
66
|
-
cases: {
|
|
67
|
-
camelCase: true,
|
|
68
|
-
pascalCase: true
|
|
69
|
-
},
|
|
70
|
-
ignore: [
|
|
71
|
-
/([A-Za-z0-9]?[a-z0-9]+)*[A-Z]{2,4}([A-Za-z0-9]?[a-z0-9]+)*/u // Up to 4 Characters can be upper-case in a row (e.g. in `prepareDOM` or `SVGIcon`)
|
|
72
|
-
]
|
|
73
|
-
}]
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
files: ['src/pages/*.tsx'],
|
|
78
|
-
rules: {
|
|
79
|
-
/**
|
|
80
|
-
* eslint-plugin-import
|
|
81
|
-
* @see https://github.com/import-js/eslint-plugin-import
|
|
82
|
-
*/
|
|
83
|
-
'import/no-default-export': 'off',
|
|
84
|
-
'import/no-unused-modules': ['error', { missingExports: true }],
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* eslint-plugin-unicorn
|
|
88
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn
|
|
89
|
-
*/
|
|
90
|
-
'unicorn/filename-case': ['off', { // Disabled in favour of the linter-bundle `files` task
|
|
91
|
-
cases: {
|
|
92
|
-
kebabCase: true
|
|
93
|
-
}
|
|
94
|
-
}]
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
files: ['gatsby-browser.js'],
|
|
99
|
-
rules: {
|
|
100
|
-
/**
|
|
101
|
-
* eslint-plugin-n
|
|
102
|
-
* @see https://github.com/eslint-community/eslint-plugin-n
|
|
103
|
-
*/
|
|
104
|
-
'n/no-unsupported-features/es-syntax': 'off'
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
]
|
|
108
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Extends `./overrides-javascript` but ignores unsafe types.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const overridesJavaScript = require('./overrides-javascript.cjs');
|
|
6
|
-
|
|
7
|
-
module.exports = {
|
|
8
|
-
...overridesJavaScript,
|
|
9
|
-
overrides: [
|
|
10
|
-
...overridesJavaScript.overrides,
|
|
11
|
-
{
|
|
12
|
-
files: ['*.js', '*.cjs', '*.mjs'],
|
|
13
|
-
rules: {
|
|
14
|
-
/**
|
|
15
|
-
* typescript-eslint
|
|
16
|
-
*
|
|
17
|
-
* @see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules
|
|
18
|
-
*/
|
|
19
|
-
'@typescript-eslint/no-unsafe-argument': 'off',
|
|
20
|
-
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
21
|
-
'@typescript-eslint/no-unsafe-call': 'off',
|
|
22
|
-
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
23
|
-
'@typescript-eslint/no-unsafe-return': 'off'
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
]
|
|
27
|
-
};
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Settings for JavaScript (Node.js) files.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
6
|
-
overrides: [
|
|
7
|
-
{
|
|
8
|
-
files: ['*.js', '*.cjs', '*.mjs'],
|
|
9
|
-
env: {
|
|
10
|
-
node: true,
|
|
11
|
-
es6: true
|
|
12
|
-
},
|
|
13
|
-
plugins: ['n'],
|
|
14
|
-
rules: {
|
|
15
|
-
/**
|
|
16
|
-
* eslint
|
|
17
|
-
*
|
|
18
|
-
* @see https://eslint.org/docs/rules/
|
|
19
|
-
*/
|
|
20
|
-
'max-lines-per-function': 'off',
|
|
21
|
-
'no-undef': 'error',
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* typescript-eslint
|
|
25
|
-
*
|
|
26
|
-
* @see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules
|
|
27
|
-
*/
|
|
28
|
-
'@typescript-eslint/explicit-function-return-type': 'off', // Requires type information (@see https://github.com/typescript-eslint/typescript-eslint/issues/906)
|
|
29
|
-
'@typescript-eslint/explicit-member-accessibility': 'off', // @todo This function should also consider JSDoc @public/@private, but it doesn't do that yet, so create an ticket.
|
|
30
|
-
'@typescript-eslint/naming-convention': 'off', // Requires type information
|
|
31
|
-
'@typescript-eslint/no-implicit-any-catch': 'off', // @todo What's the correct way to define the type of the error-parameter in js files?
|
|
32
|
-
'@typescript-eslint/no-require-imports': 'off', // Requires type information
|
|
33
|
-
'@typescript-eslint/no-unsafe-assignment': 'off', // @todo Reactivate after bug in @typescript-eslint is fixed (@see https://github.com/typescript-eslint/typescript-eslint/issues/1943)
|
|
34
|
-
'@typescript-eslint/no-var-requires': 'off', // Requires type information
|
|
35
|
-
'@typescript-eslint/triple-slash-reference': 'off', // Required to make use of *.d.ts files
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* eslint-plugin-import
|
|
39
|
-
*
|
|
40
|
-
* @see https://github.com/import-js/eslint-plugin-import
|
|
41
|
-
*/
|
|
42
|
-
'import/no-commonjs': 'off',
|
|
43
|
-
'import/no-import-module-exports': 'error',
|
|
44
|
-
'import/no-internal-modules': 'off',
|
|
45
|
-
'import/no-nodejs-modules': 'off',
|
|
46
|
-
'import/dynamic-import-chunkname': 'off',
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* eslint-plugin-n
|
|
50
|
-
*
|
|
51
|
-
* @see https://github.com/eslint-community/eslint-plugin-n
|
|
52
|
-
*/
|
|
53
|
-
'n/callback-return': 'error',
|
|
54
|
-
'n/exports-style': 'error',
|
|
55
|
-
'n/file-extension-in-import': 'error',
|
|
56
|
-
'n/global-require': 'off',
|
|
57
|
-
'n/handle-callback-err': 'error',
|
|
58
|
-
'n/no-callback-literal': 'error',
|
|
59
|
-
'n/no-deprecated-api': 'error',
|
|
60
|
-
'n/no-exports-assign': 'error',
|
|
61
|
-
'n/no-extraneous-import': 'error',
|
|
62
|
-
'n/no-extraneous-require': 'error',
|
|
63
|
-
'n/no-missing-import': 'error',
|
|
64
|
-
'n/no-missing-require': 'error',
|
|
65
|
-
'n/no-mixed-requires': 'error',
|
|
66
|
-
'n/no-new-require': 'error',
|
|
67
|
-
'n/no-path-concat': 'error',
|
|
68
|
-
'n/no-process-env': 'error',
|
|
69
|
-
'n/no-process-exit': 'error',
|
|
70
|
-
'n/no-restricted-import': 'error',
|
|
71
|
-
'n/no-restricted-require': 'error',
|
|
72
|
-
'n/no-sync': 'off', // Since the .js files are used in the CLI, preventing the use of sync functions is not required
|
|
73
|
-
'n/no-unpublished-bin': 'error',
|
|
74
|
-
'n/no-unpublished-import': 'error',
|
|
75
|
-
'n/no-unpublished-require': 'off', // Since we use .js files only for the dev-environment, we don't need this rule
|
|
76
|
-
'n/no-unsupported-features/es-builtins': 'error',
|
|
77
|
-
'n/no-unsupported-features/es-syntax': 'error',
|
|
78
|
-
'n/no-unsupported-features/node-builtins': 'error',
|
|
79
|
-
'n/prefer-global/buffer': 'error',
|
|
80
|
-
'n/prefer-global/console': 'error',
|
|
81
|
-
'n/prefer-global/process': 'error',
|
|
82
|
-
'n/prefer-global/text-decoder': 'error',
|
|
83
|
-
'n/prefer-global/text-encoder': 'error',
|
|
84
|
-
'n/prefer-global/url-search-params': 'error',
|
|
85
|
-
'n/prefer-global/url': 'error',
|
|
86
|
-
'n/prefer-promises/dns': 'error',
|
|
87
|
-
'n/prefer-promises/fs': 'error',
|
|
88
|
-
'n/process-exit-as-throw': 'error',
|
|
89
|
-
'n/shebang': 'error',
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* eslint-plugin-unicorn
|
|
93
|
-
*
|
|
94
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn
|
|
95
|
-
*/
|
|
96
|
-
'unicorn/filename-case': ['off', { // Disabled in favour of the linter-bundle `files` task
|
|
97
|
-
cases: {
|
|
98
|
-
kebabCase: true
|
|
99
|
-
}
|
|
100
|
-
}],
|
|
101
|
-
'unicorn/no-process-exit': 'off', // n/no-process-exit
|
|
102
|
-
'unicorn/prefer-module': 'error',
|
|
103
|
-
'unicorn/prefer-node-protocol': 'off', // @todo Requires Node.js v16. Activate in 2025
|
|
104
|
-
'unicorn/prevent-abbreviations': ['error', { ignore: ['args', 'dev', 'env', 'i', 'j', 'i18n', 'pkg', 'ref', 'Ref', 'req', 'res', 'setupDevServerMiddleware'] }],
|
|
105
|
-
'unicorn/text-encoding-identifier-case': 'off'
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
files: ['*.mjs'],
|
|
110
|
-
rules: {
|
|
111
|
-
'unicorn/prefer-top-level-await': 'error'
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
files: ['./*.js'],
|
|
116
|
-
rules: {
|
|
117
|
-
'unicorn/prefer-module': 'off'
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
]
|
|
121
|
-
};
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Settings for Jest based unit tests.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const jestVersion = (() => {
|
|
6
|
-
try {
|
|
7
|
-
// eslint-disable-next-line n/no-missing-require, import/no-dynamic-require -- If "overrides-jest" is used, "jest" should be installed, and it should be searched in the working directory of the process.
|
|
8
|
-
const version = require(require.resolve('jest', { paths: [process.cwd()] })).getVersion().split('.')[0];
|
|
9
|
-
|
|
10
|
-
process.stdout.write(`Detected Jest version: ${version}\n\n`);
|
|
11
|
-
|
|
12
|
-
return version;
|
|
13
|
-
}
|
|
14
|
-
catch {
|
|
15
|
-
process.stderr.write('No Jest version detected\n\n');
|
|
16
|
-
|
|
17
|
-
return 'detect';
|
|
18
|
-
}
|
|
19
|
-
})();
|
|
20
|
-
|
|
21
|
-
module.exports = {
|
|
22
|
-
overrides: [
|
|
23
|
-
{
|
|
24
|
-
files: ['**/__tests__/**/*.[jt]s', '**/?(*.)+(spec|test).[jt]s'],
|
|
25
|
-
env: {
|
|
26
|
-
jest: true
|
|
27
|
-
},
|
|
28
|
-
settings: {
|
|
29
|
-
jest: {
|
|
30
|
-
version: jestVersion
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
plugins: ['jest'],
|
|
34
|
-
rules: {
|
|
35
|
-
/**
|
|
36
|
-
* eslint
|
|
37
|
-
*
|
|
38
|
-
* @see https://eslint.org/docs/rules/
|
|
39
|
-
*/
|
|
40
|
-
'max-lines': 'off',
|
|
41
|
-
'max-lines-per-function': 'off',
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* typescript-eslint
|
|
45
|
-
*
|
|
46
|
-
* @see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules
|
|
47
|
-
*/
|
|
48
|
-
'@typescript-eslint/ban-ts-comment': ['error', {
|
|
49
|
-
'ts-expect-error': false
|
|
50
|
-
}],
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* eslint-plugin-import
|
|
54
|
-
*
|
|
55
|
-
* @see https://github.com/import-js/eslint-plugin-import
|
|
56
|
-
*/
|
|
57
|
-
'import/no-unassigned-import': 'error',
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* eslint-plugin-jest
|
|
61
|
-
*
|
|
62
|
-
* @see https://github.com/jest-community/eslint-plugin-jest/tree/master/docs/rules
|
|
63
|
-
*/
|
|
64
|
-
'jest/consistent-test-it': 'error',
|
|
65
|
-
'jest/expect-expect': 'error',
|
|
66
|
-
'jest/prefer-lowercase-title': ['error', { ignore: ['describe'] }],
|
|
67
|
-
'jest/max-expects': 'error',
|
|
68
|
-
'jest/max-nested-describe': 'error',
|
|
69
|
-
'jest/no-alias-methods': 'error',
|
|
70
|
-
'jest/no-commented-out-tests': 'error',
|
|
71
|
-
'jest/no-conditional-expect': 'error',
|
|
72
|
-
'jest/no-conditional-in-test': 'error',
|
|
73
|
-
'jest/no-confusing-set-timeout': 'error',
|
|
74
|
-
'jest/no-deprecated-functions': 'error',
|
|
75
|
-
'jest/no-disabled-tests': 'error',
|
|
76
|
-
'jest/no-done-callback': 'error',
|
|
77
|
-
'jest/no-duplicate-hooks': 'error',
|
|
78
|
-
'jest/no-export': 'error',
|
|
79
|
-
'jest/no-focused-tests': 'error',
|
|
80
|
-
'jest/no-hooks': ['error', { allow: ['beforeEach', 'afterEach', 'afterAll'] }],
|
|
81
|
-
'jest/no-identical-title': 'error',
|
|
82
|
-
'jest/no-interpolation-in-snapshots': 'error',
|
|
83
|
-
'jest/no-jasmine-globals': 'error',
|
|
84
|
-
'jest/no-large-snapshots': 'error',
|
|
85
|
-
'jest/no-mocks-import': 'error',
|
|
86
|
-
'jest/no-restricted-jest-methods': 'off', // Right now, there are no specific restrictions
|
|
87
|
-
'jest/no-restricted-matchers': ['error', {
|
|
88
|
-
resolves: 'Use `expect(await promise)` instead.',
|
|
89
|
-
toBeFalsy: 'Avoid `toBeFalsy`',
|
|
90
|
-
toBeTruthy: 'Avoid `toBeTruthy`',
|
|
91
|
-
toMatchSnapshot: 'Use `toMatchInlineSnapshot()` instead',
|
|
92
|
-
toThrowErrorMatchingSnapshot: 'Use `toThrowErrorMatchingInlineSnapshot()` instead'
|
|
93
|
-
}],
|
|
94
|
-
'jest/no-standalone-expect': 'error',
|
|
95
|
-
'jest/no-test-prefixes': 'error',
|
|
96
|
-
'jest/no-test-return-statement': 'error',
|
|
97
|
-
'jest/prefer-called-with': 'error',
|
|
98
|
-
'jest/prefer-expect-assertions': ['error', { onlyFunctionsWithAsyncKeyword: true }],
|
|
99
|
-
'jest/prefer-expect-resolves': 'off', // We prefer `expect(await promise)` enforced by 'jest/no-restricted-matchers'
|
|
100
|
-
'jest/prefer-hooks-in-order': 'error',
|
|
101
|
-
'jest/prefer-hooks-on-top': 'error',
|
|
102
|
-
'jest/prefer-comparison-matcher': 'error',
|
|
103
|
-
'jest/prefer-each': 'error',
|
|
104
|
-
'jest/prefer-equality-matcher': 'error',
|
|
105
|
-
'jest/prefer-mock-promise-shorthand': 'error',
|
|
106
|
-
'jest/prefer-snapshot-hint': 'error',
|
|
107
|
-
'jest/prefer-spy-on': 'error',
|
|
108
|
-
'jest/prefer-strict-equal': 'error',
|
|
109
|
-
'jest/prefer-to-be': 'error',
|
|
110
|
-
'jest/prefer-to-contain': 'error',
|
|
111
|
-
'jest/prefer-to-have-length': 'error',
|
|
112
|
-
'jest/prefer-todo': 'error',
|
|
113
|
-
'jest/require-hook': 'error',
|
|
114
|
-
'jest/require-top-level-describe': 'error',
|
|
115
|
-
'jest/require-to-throw-message': 'error',
|
|
116
|
-
'jest/unbound-method': 'error',
|
|
117
|
-
'jest/valid-describe-callback': 'error',
|
|
118
|
-
'jest/valid-expect-in-promise': 'error',
|
|
119
|
-
'jest/valid-expect': 'error',
|
|
120
|
-
'jest/valid-title': 'error'
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
files: ['**/__tests__/**/*.ts', '**/?(*.)+(spec|test).ts'],
|
|
125
|
-
env: {
|
|
126
|
-
jest: true
|
|
127
|
-
},
|
|
128
|
-
settings: {
|
|
129
|
-
jest: {
|
|
130
|
-
version: jestVersion
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
plugins: ['jest'],
|
|
134
|
-
rules: {
|
|
135
|
-
/**
|
|
136
|
-
* eslint-plugin-jest
|
|
137
|
-
*
|
|
138
|
-
* @see https://github.com/jest-community/eslint-plugin-jest/tree/master/docs/rules
|
|
139
|
-
*/
|
|
140
|
-
'jest/no-untyped-mock-factory': 'error'
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
]
|
|
144
|
-
};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Settings for JSDoc comments in JavaScript (Node.js) files.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
6
|
-
overrides: [
|
|
7
|
-
{
|
|
8
|
-
files: ['*.js', '*.cjs', '*.mjs'],
|
|
9
|
-
env: {
|
|
10
|
-
node: true,
|
|
11
|
-
es6: true
|
|
12
|
-
},
|
|
13
|
-
plugins: ['jsdoc'],
|
|
14
|
-
settings: {
|
|
15
|
-
jsdoc: {
|
|
16
|
-
mode: 'typescript',
|
|
17
|
-
exemptDestructuredRootsFromChecks: true
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
rules: {
|
|
21
|
-
/**
|
|
22
|
-
* "eslint-plugin-jsdoc" rules
|
|
23
|
-
* @see https://github.com/gajus/eslint-plugin-jsdoc
|
|
24
|
-
*/
|
|
25
|
-
'jsdoc/check-access': 'error',
|
|
26
|
-
'jsdoc/check-alignment': 'error',
|
|
27
|
-
'jsdoc/check-examples': 'off', // @todo Need to be configured to allow text-based examples
|
|
28
|
-
'jsdoc/check-indentation': ['off', { excludeTags: ['typedef'] }], // @todo Why is this disabled?
|
|
29
|
-
'jsdoc/check-param-names': 'error',
|
|
30
|
-
'jsdoc/check-syntax': 'error',
|
|
31
|
-
'jsdoc/check-line-alignment': 'error',
|
|
32
|
-
'jsdoc/check-tag-names': 'error',
|
|
33
|
-
'jsdoc/check-types': 'error',
|
|
34
|
-
'jsdoc/check-values': 'error',
|
|
35
|
-
'jsdoc/empty-tags': 'error',
|
|
36
|
-
'jsdoc/implements-on-classes': 'error',
|
|
37
|
-
'jsdoc/imports-as-dependencies': 'off', // @todo Doesn't cover `peerDependencies` yet. As of v46.2.5 it should cover Node.js modules (like `child_process`), which must be checked, before activation.
|
|
38
|
-
'jsdoc/informative-docs': 'error',
|
|
39
|
-
'jsdoc/match-description': 'error',
|
|
40
|
-
'jsdoc/match-name': 'off',
|
|
41
|
-
'jsdoc/multiline-blocks': ['error', { noSingleLineBlocks: true, singleLineTags: ['lends', 'type', 'typedef'], noFinalLineText: false }],
|
|
42
|
-
'jsdoc/no-bad-blocks': 'error',
|
|
43
|
-
'jsdoc/no-blank-blocks': 'error',
|
|
44
|
-
'jsdoc/no-defaults': 'off',
|
|
45
|
-
'jsdoc/no-missing-syntax': 'off',
|
|
46
|
-
'jsdoc/no-multi-asterisks': ['error', { preventAtEnd: false }],
|
|
47
|
-
'jsdoc/no-restricted-syntax': 'off',
|
|
48
|
-
'jsdoc/no-types': 'off',
|
|
49
|
-
'jsdoc/no-undefined-types': ['error', { definedTypes: ['void', 'never', 'Readonly'] }],
|
|
50
|
-
'jsdoc/require-description-complete-sentence': 'off', // @todo Doesn't work correctly (e.g. the `g` of `e.g.` is interpreted as separate sentence).
|
|
51
|
-
'jsdoc/require-description': 'error',
|
|
52
|
-
'jsdoc/require-example': 'off',
|
|
53
|
-
'jsdoc/require-file-overview': 'error',
|
|
54
|
-
'jsdoc/require-hyphen-before-param-description': 'error',
|
|
55
|
-
'jsdoc/require-jsdoc': ['error', { minLineCount: 2 }],
|
|
56
|
-
'jsdoc/require-param-description': 'error',
|
|
57
|
-
'jsdoc/require-param-name': 'error',
|
|
58
|
-
'jsdoc/require-param-type': 'error',
|
|
59
|
-
'jsdoc/require-param': 'error',
|
|
60
|
-
'jsdoc/require-property': 'error',
|
|
61
|
-
'jsdoc/require-returns-check': 'error',
|
|
62
|
-
'jsdoc/require-returns-description': 'error',
|
|
63
|
-
'jsdoc/require-returns-type': 'error',
|
|
64
|
-
'jsdoc/require-returns': ['error', { forceReturnsWithAsync: true }],
|
|
65
|
-
'jsdoc/require-throws': 'error',
|
|
66
|
-
'jsdoc/require-yields': 'error',
|
|
67
|
-
'jsdoc/require-yields-check': 'error',
|
|
68
|
-
'jsdoc/tag-lines': ['error', 'always', {
|
|
69
|
-
tags: {
|
|
70
|
-
example: { lines: 'always' },
|
|
71
|
-
file: { lines: 'always' },
|
|
72
|
-
fileOverview: { lines: 'always' },
|
|
73
|
-
license: { lines: 'always' },
|
|
74
|
-
param: { lines: 'never' },
|
|
75
|
-
private: { lines: 'never' },
|
|
76
|
-
property: { lines: 'never' },
|
|
77
|
-
protected: { lines: 'never' },
|
|
78
|
-
public: { lines: 'never' },
|
|
79
|
-
returns: { lines: 'never' },
|
|
80
|
-
see: { lines: 'any' },
|
|
81
|
-
template: { lines: 'never' },
|
|
82
|
-
throws: { lines: 'never' },
|
|
83
|
-
typedef: { lines: 'never' }
|
|
84
|
-
},
|
|
85
|
-
startLines: null,
|
|
86
|
-
endLines: null,
|
|
87
|
-
applyToEndTag: false
|
|
88
|
-
}],
|
|
89
|
-
'jsdoc/text-escaping': 'off', // Right now, there is no description of this rule available on the page. Only the discussion here: https://github.com/gajus/eslint-plugin-jsdoc/issues/864
|
|
90
|
-
'jsdoc/valid-types': 'off' // Checked by TypeScript
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
]
|
|
94
|
-
};
|