@open-xchange/linter-presets 1.6.1 → 1.7.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/CHANGELOG.md +14 -1
- package/dist/eslint/core/base.d.ts +3 -4
- package/dist/eslint/core/base.js +96 -95
- package/dist/eslint/core/directives.d.ts +3 -3
- package/dist/eslint/core/directives.js +5 -5
- package/dist/eslint/core/js.d.ts +3 -3
- package/dist/eslint/core/js.js +5 -5
- package/dist/eslint/core/jsdoc.d.ts +3 -3
- package/dist/eslint/core/jsdoc.js +43 -42
- package/dist/eslint/core/json.d.ts +3 -4
- package/dist/eslint/core/json.js +10 -7
- package/dist/eslint/core/license.d.ts +4 -4
- package/dist/eslint/core/license.js +6 -6
- package/dist/eslint/core/markdown.d.ts +3 -3
- package/dist/eslint/core/markdown.js +5 -2
- package/dist/eslint/core/packages.d.ts +3 -4
- package/dist/eslint/core/packages.js +16 -15
- package/dist/eslint/core/promises.d.ts +3 -3
- package/dist/eslint/core/promises.js +18 -18
- package/dist/eslint/core/regexp.d.ts +3 -3
- package/dist/eslint/core/regexp.js +9 -7
- package/dist/eslint/core/stylistic.d.ts +3 -4
- package/dist/eslint/core/stylistic.js +99 -98
- package/dist/eslint/core/ts.d.ts +6 -3
- package/dist/eslint/core/ts.js +78 -72
- package/dist/eslint/core/vue.d.ts +3 -4
- package/dist/eslint/core/vue.js +10 -11
- package/dist/eslint/core/yaml.d.ts +3 -4
- package/dist/eslint/core/yaml.js +9 -6
- package/dist/eslint/env/browser.d.ts +3 -3
- package/dist/eslint/env/browser.js +18 -17
- package/dist/eslint/env/codecept.d.ts +3 -4
- package/dist/eslint/env/codecept.js +27 -26
- package/dist/eslint/env/decorators.d.ts +3 -4
- package/dist/eslint/env/decorators.js +19 -16
- package/dist/eslint/env/eslint.d.ts +3 -4
- package/dist/eslint/env/eslint.js +16 -15
- package/dist/eslint/env/jest.d.ts +3 -3
- package/dist/eslint/env/jest.js +37 -36
- package/dist/eslint/env/node.d.ts +3 -4
- package/dist/eslint/env/node.js +22 -21
- package/dist/eslint/env/project.d.ts +3 -4
- package/dist/eslint/env/project.js +25 -24
- package/dist/eslint/env/react.d.ts +3 -4
- package/dist/eslint/env/react.js +36 -47
- package/dist/eslint/env/tsconfig.d.ts +3 -4
- package/dist/eslint/env/tsconfig.js +14 -13
- package/dist/eslint/env/vitest.d.ts +3 -3
- package/dist/eslint/env/vitest.js +54 -53
- package/dist/eslint/index.d.ts +26 -21
- package/dist/eslint/index.js +16 -14
- package/dist/eslint/shared/env-utils.d.ts +17 -28
- package/dist/eslint/shared/env-utils.js +36 -46
- package/dist/eslint/shared/restricted.d.ts +3 -3
- package/dist/eslint/shared/restricted.js +12 -11
- package/dist/eslint/shared/unittest.d.ts +4 -5
- package/dist/eslint/shared/unittest.js +21 -20
- package/dist/stylelint/index.d.ts +9 -6
- package/dist/stylelint/index.js +7 -6
- package/dist/utils/resolver.d.ts +20 -10
- package/dist/utils/resolver.js +28 -10
- package/dist/utils/utils.d.ts +1 -1
- package/dist/utils/utils.js +1 -1
- package/docs/eslint/README.md +3 -30
- package/docs/stylelint/README.md +3 -30
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## `1.7.1` – 2025-Jul-18
|
|
4
|
+
|
|
5
|
+
- changed: (ESLint) `eslint-plugin-regexp`: raise all warnings in recommended config to errors
|
|
6
|
+
|
|
7
|
+
## `1.7.0` – 2025-Jul-17
|
|
8
|
+
|
|
9
|
+
- added: (ESLint and StyleLint) mandatory option `root`
|
|
10
|
+
- added: (ESLint) configuration entries can be callback functions receiving a path resolver
|
|
11
|
+
- changed: (ESLint and StyleLint) option `license` can be a relative path
|
|
12
|
+
- removed: (ESLint and StyleLint) `createResolver` function
|
|
13
|
+
- fixed: (ESLint) set `tsconfigRootDir` for TypeScript plugin to fix errors in VS Code
|
|
14
|
+
- chore: bump dependencies
|
|
15
|
+
|
|
3
16
|
## `1.6.1` – 2025-Jul-16
|
|
4
17
|
|
|
5
18
|
- removed: (ESLint) deprecated rule `@stylistic/jsx-indent`
|
|
@@ -9,7 +22,7 @@
|
|
|
9
22
|
- changed: dedicated package exports `/eslint` and `/stylelint`
|
|
10
23
|
- changed: (ESLint) replaced `configure` function with `defineConfig` function
|
|
11
24
|
- changed: (StyleLint) replaced `configure` function with `defineConfig` function
|
|
12
|
-
- changed: replaced `resolver` function with `createResolver` function
|
|
25
|
+
- changed: (ESLint and StyleLint) replaced `resolver` function with `createResolver` function
|
|
13
26
|
- added: (ESLint) new plugin `eslint-plugin-regexp`
|
|
14
27
|
- added: (ESLint) disable `no-duplicate-imports` rule in `.d.ts` files
|
|
15
28
|
- chore: bump dependencies
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { type LanguageConfig } from "../shared/env-utils.js";
|
|
1
|
+
import type { ConfigWithExtendsArg, LanguageConfig } from "../shared/env-utils.js";
|
|
3
2
|
/**
|
|
4
3
|
* Defines standard module settings and additional rules targeting JavaScript
|
|
5
4
|
* _and_ TypeScript source files.
|
|
@@ -11,6 +10,6 @@ import { type LanguageConfig } from "../shared/env-utils.js";
|
|
|
11
10
|
* Resolved configuration options.
|
|
12
11
|
*
|
|
13
12
|
* @returns
|
|
14
|
-
*
|
|
13
|
+
* The configuration entries to be added to the resulting configuration array.
|
|
15
14
|
*/
|
|
16
|
-
export default function base(languageConfig: LanguageConfig):
|
|
15
|
+
export default function base(languageConfig: LanguageConfig): ConfigWithExtendsArg;
|
package/dist/eslint/core/base.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import eslintJs from "@eslint/js";
|
|
2
|
-
import { SRC_GLOB, VUE_GLOB, NO_IMPLICIT_COERCION_OPTIONS, extGlob
|
|
2
|
+
import { SRC_GLOB, VUE_GLOB, NO_IMPLICIT_COERCION_OPTIONS, extGlob } from "../shared/env-utils.js";
|
|
3
3
|
import { builtinRestrictedRules } from "../shared/restricted.js";
|
|
4
4
|
// functions ==================================================================
|
|
5
5
|
/**
|
|
@@ -13,110 +13,111 @@ import { builtinRestrictedRules } from "../shared/restricted.js";
|
|
|
13
13
|
* Resolved configuration options.
|
|
14
14
|
*
|
|
15
15
|
* @returns
|
|
16
|
-
*
|
|
16
|
+
* The configuration entries to be added to the resulting configuration array.
|
|
17
17
|
*/
|
|
18
18
|
export default function base(languageConfig) {
|
|
19
19
|
// returns language options for specific file extensions
|
|
20
20
|
const languageOptions = (sourceType, ...extensions) => {
|
|
21
21
|
const { ecmaVersion } = languageConfig;
|
|
22
22
|
return {
|
|
23
|
-
name: `base
|
|
23
|
+
name: `core.base.language-options.${sourceType}.${extensions.join(",")}`,
|
|
24
24
|
files: extGlob(extensions),
|
|
25
25
|
languageOptions: { ecmaVersion, sourceType },
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
return [
|
|
29
|
+
// global linter configuration
|
|
30
|
+
{
|
|
31
|
+
name: "core.base.linter-options",
|
|
32
|
+
linterOptions: {
|
|
33
|
+
// report unused inline linter directives in source code
|
|
34
|
+
reportUnusedDisableDirectives: "error",
|
|
35
|
+
},
|
|
35
36
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
37
|
+
// ECMA version and module type for ES modules
|
|
38
|
+
languageOptions("module", "mjs", "mts"),
|
|
39
|
+
// ECMA version and module type for CommonJS modules
|
|
40
|
+
languageOptions("commonjs", "cjs", "cts"),
|
|
41
|
+
// ECMA version and module type for *.js and *.ts files
|
|
42
|
+
languageOptions(languageConfig.sourceType, "js", "jsx", "ts", "tsx"),
|
|
43
|
+
// configure linter rules
|
|
44
|
+
{
|
|
45
|
+
name: "core.base.rules",
|
|
46
|
+
files: [...SRC_GLOB, ...VUE_GLOB],
|
|
47
|
+
rules: {
|
|
48
|
+
// enable all rules recommended by ESLint itself
|
|
49
|
+
...eslintJs.configs.recommended.rules,
|
|
50
|
+
// possible problems
|
|
51
|
+
"no-cond-assign": ["error", "except-parens"],
|
|
52
|
+
"no-constant-binary-expression": "error",
|
|
53
|
+
"no-constructor-return": "error",
|
|
54
|
+
"no-control-regex": "off",
|
|
55
|
+
"no-duplicate-imports": ["error", { allowSeparateTypeImports: true }],
|
|
56
|
+
"no-new-native-nonconstructor": "error",
|
|
57
|
+
"no-new-symbol": "off", // disabled in favour of "no-new-native-nonconstructor"
|
|
58
|
+
"no-promise-executor-return": ["error", { allowVoid: true }],
|
|
59
|
+
"no-self-compare": "error",
|
|
60
|
+
"no-template-curly-in-string": "error",
|
|
61
|
+
"no-unassigned-vars": "error",
|
|
62
|
+
"no-unreachable-loop": "error",
|
|
63
|
+
"no-unsafe-optional-chaining": ["error", { disallowArithmeticOperators: true }],
|
|
64
|
+
"no-unused-private-class-members": "error",
|
|
65
|
+
"require-atomic-updates": "error",
|
|
66
|
+
// suggestions
|
|
67
|
+
"block-scoped-var": "error",
|
|
68
|
+
curly: "error",
|
|
69
|
+
eqeqeq: "error",
|
|
70
|
+
"grouped-accessor-pairs": "error",
|
|
71
|
+
"new-cap": "error",
|
|
72
|
+
"no-alert": "error",
|
|
73
|
+
"no-caller": "error",
|
|
74
|
+
"no-console": "error",
|
|
75
|
+
"no-else-return": "error",
|
|
76
|
+
"no-empty": "off",
|
|
77
|
+
"no-empty-static-block": "error",
|
|
78
|
+
"no-eval": "error",
|
|
79
|
+
"no-extend-native": "error",
|
|
80
|
+
"no-extra-bind": "error",
|
|
81
|
+
"no-extra-label": "error",
|
|
82
|
+
"no-implicit-coercion": ["error", NO_IMPLICIT_COERCION_OPTIONS],
|
|
83
|
+
"no-implied-eval": "error",
|
|
84
|
+
"no-iterator": "error",
|
|
85
|
+
"no-label-var": "error",
|
|
86
|
+
"no-labels": "error",
|
|
87
|
+
"no-lone-blocks": "error",
|
|
88
|
+
"no-lonely-if": "error",
|
|
89
|
+
"no-multi-str": "error",
|
|
90
|
+
"no-new": "error",
|
|
91
|
+
"no-new-func": "error",
|
|
92
|
+
"no-new-wrappers": "error",
|
|
93
|
+
"no-object-constructor": "error",
|
|
94
|
+
"no-octal-escape": "error",
|
|
95
|
+
"no-proto": "error",
|
|
96
|
+
"no-return-assign": ["error", "except-parens"],
|
|
97
|
+
"no-script-url": "error",
|
|
98
|
+
"no-sequences": ["error", { allowInParentheses: false }],
|
|
99
|
+
"no-unneeded-ternary": ["error", { defaultAssignment: false }],
|
|
100
|
+
"no-unused-expressions": "error",
|
|
101
|
+
"no-useless-assignment": "error",
|
|
102
|
+
"no-useless-call": "error",
|
|
103
|
+
"no-useless-computed-key": "error",
|
|
104
|
+
"no-useless-concat": "error",
|
|
105
|
+
"no-useless-rename": "error",
|
|
106
|
+
"no-useless-return": "error",
|
|
107
|
+
"no-var": "error",
|
|
108
|
+
"object-shorthand": "error",
|
|
109
|
+
"operator-assignment": "error",
|
|
110
|
+
"prefer-arrow-callback": "error",
|
|
111
|
+
"prefer-const": ["error", { destructuring: "all", ignoreReadBeforeAssign: true }],
|
|
112
|
+
"prefer-numeric-literals": "error",
|
|
113
|
+
"prefer-regex-literals": "error",
|
|
114
|
+
"prefer-rest-params": "error",
|
|
115
|
+
"prefer-spread": "error",
|
|
116
|
+
radix: "error",
|
|
117
|
+
"symbol-description": "error",
|
|
118
|
+
// built-in restricted items
|
|
119
|
+
...builtinRestrictedRules(),
|
|
120
|
+
},
|
|
120
121
|
},
|
|
121
|
-
|
|
122
|
+
];
|
|
122
123
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ConfigWithExtendsArg } from "../shared/env-utils.js";
|
|
2
2
|
/**
|
|
3
3
|
* Checks inline linter directives.
|
|
4
4
|
*
|
|
@@ -6,6 +6,6 @@ import type { Linter } from "eslint";
|
|
|
6
6
|
* - `eslint-plugin-eslint-comments`
|
|
7
7
|
*
|
|
8
8
|
* @returns
|
|
9
|
-
*
|
|
9
|
+
* The configuration entries to be added to the resulting configuration array.
|
|
10
10
|
*/
|
|
11
|
-
export default function directives():
|
|
11
|
+
export default function directives(): ConfigWithExtendsArg;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import commentsPluginConfigs from "@eslint-community/eslint-plugin-eslint-comments/configs";
|
|
2
|
-
import { SRC_GLOB, VUE_GLOB
|
|
2
|
+
import { SRC_GLOB, VUE_GLOB } from "../shared/env-utils.js";
|
|
3
3
|
// functions ==================================================================
|
|
4
4
|
/**
|
|
5
5
|
* Checks inline linter directives.
|
|
@@ -8,13 +8,13 @@ import { SRC_GLOB, VUE_GLOB, createConfigArray } from "../shared/env-utils.js";
|
|
|
8
8
|
* - `eslint-plugin-eslint-comments`
|
|
9
9
|
*
|
|
10
10
|
* @returns
|
|
11
|
-
*
|
|
11
|
+
* The configuration entries to be added to the resulting configuration array.
|
|
12
12
|
*/
|
|
13
13
|
export default function directives() {
|
|
14
14
|
// register rule implementations and recommended rules
|
|
15
|
-
return
|
|
16
|
-
name: "directives:recommended",
|
|
15
|
+
return {
|
|
17
16
|
files: [...SRC_GLOB, ...VUE_GLOB],
|
|
18
17
|
...commentsPluginConfigs.recommended,
|
|
19
|
-
|
|
18
|
+
name: "core.directives.recommended",
|
|
19
|
+
};
|
|
20
20
|
}
|
package/dist/eslint/core/js.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ConfigWithExtendsArg } from "../shared/env-utils.js";
|
|
2
2
|
/**
|
|
3
3
|
* Defines additional standard rules targeting JavaScript but _not_ TypeScript
|
|
4
4
|
* source files.
|
|
5
5
|
*
|
|
6
6
|
* @returns
|
|
7
|
-
*
|
|
7
|
+
* The configuration entries to be added to the resulting configuration array.
|
|
8
8
|
*/
|
|
9
|
-
export default function js():
|
|
9
|
+
export default function js(): ConfigWithExtendsArg;
|
package/dist/eslint/core/js.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { JS_GLOB, NO_UNUSED_VARS_OPTIONS
|
|
1
|
+
import { JS_GLOB, NO_UNUSED_VARS_OPTIONS } from "../shared/env-utils.js";
|
|
2
2
|
// functions ==================================================================
|
|
3
3
|
/**
|
|
4
4
|
* Defines additional standard rules targeting JavaScript but _not_ TypeScript
|
|
5
5
|
* source files.
|
|
6
6
|
*
|
|
7
7
|
* @returns
|
|
8
|
-
*
|
|
8
|
+
* The configuration entries to be added to the resulting configuration array.
|
|
9
9
|
*/
|
|
10
10
|
export default function js() {
|
|
11
|
-
return
|
|
12
|
-
name: "js
|
|
11
|
+
return {
|
|
12
|
+
name: "core.js.recommended",
|
|
13
13
|
files: JS_GLOB,
|
|
14
14
|
rules: {
|
|
15
15
|
// possible problems
|
|
@@ -28,5 +28,5 @@ export default function js() {
|
|
|
28
28
|
"prefer-promise-reject-errors": "error",
|
|
29
29
|
"require-await": "error",
|
|
30
30
|
},
|
|
31
|
-
}
|
|
31
|
+
};
|
|
32
32
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ConfigWithExtendsArg } from "../shared/env-utils.js";
|
|
2
2
|
/**
|
|
3
3
|
* Checks the JSDoc comments in source files.
|
|
4
4
|
*
|
|
@@ -6,6 +6,6 @@ import type { Linter } from "eslint";
|
|
|
6
6
|
* - `eslint-plugin-jsdoc`
|
|
7
7
|
*
|
|
8
8
|
* @returns
|
|
9
|
-
*
|
|
9
|
+
* The configuration entries to be added to the resulting configuration array.
|
|
10
10
|
*/
|
|
11
|
-
export default function jsdoc():
|
|
11
|
+
export default function jsdoc(): ConfigWithExtendsArg;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import jsdocPlugin from "eslint-plugin-jsdoc";
|
|
2
|
-
import { TS_GLOB, SRC_GLOB
|
|
2
|
+
import { TS_GLOB, SRC_GLOB } from "../shared/env-utils.js";
|
|
3
3
|
// functions ==================================================================
|
|
4
4
|
/**
|
|
5
5
|
* Checks the JSDoc comments in source files.
|
|
@@ -8,52 +8,53 @@ import { TS_GLOB, SRC_GLOB, createConfigArray } from "../shared/env-utils.js";
|
|
|
8
8
|
* - `eslint-plugin-jsdoc`
|
|
9
9
|
*
|
|
10
10
|
* @returns
|
|
11
|
-
*
|
|
11
|
+
* The configuration entries to be added to the resulting configuration array.
|
|
12
12
|
*/
|
|
13
13
|
export default function jsdoc() {
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
14
|
+
return [
|
|
15
|
+
// register rule implementations and recommended rules
|
|
16
|
+
{
|
|
17
|
+
files: SRC_GLOB,
|
|
18
|
+
...jsdocPlugin.configs["flat/recommended-error"],
|
|
19
|
+
name: "core.jsdoc.recommended",
|
|
20
|
+
},
|
|
21
|
+
// general configuration
|
|
22
|
+
{
|
|
23
|
+
name: "core.jsdoc.settings",
|
|
24
|
+
settings: {
|
|
25
|
+
jsdoc: {
|
|
26
|
+
tagNamePreference: {
|
|
27
|
+
// disallowed tags for ES6 keywords `const`, `class`, `extends`
|
|
28
|
+
augments: false,
|
|
29
|
+
class: false,
|
|
30
|
+
const: false,
|
|
31
|
+
constant: false,
|
|
32
|
+
constructor: false,
|
|
33
|
+
extends: false,
|
|
34
|
+
},
|
|
34
35
|
},
|
|
35
36
|
},
|
|
36
37
|
},
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
// overrides for TypeScript files
|
|
39
|
+
{
|
|
40
|
+
name: "core.jsdoc.typescript",
|
|
41
|
+
files: TS_GLOB,
|
|
42
|
+
rules: {
|
|
43
|
+
...jsdocPlugin.configs["flat/recommended-typescript-error"].rules,
|
|
44
|
+
"jsdoc/check-param-names": ["error", { allowExtraTrailingParamDocs: true }], // overload signatures
|
|
45
|
+
},
|
|
45
46
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
// configure plugin rules
|
|
48
|
+
{
|
|
49
|
+
name: "core.jsdoc.rules",
|
|
50
|
+
files: SRC_GLOB,
|
|
51
|
+
rules: {
|
|
52
|
+
"jsdoc/check-template-names": "error",
|
|
53
|
+
"jsdoc/require-asterisk-prefix": "error",
|
|
54
|
+
"jsdoc/require-template": ["error", { requireSeparateTemplates: true }],
|
|
55
|
+
"jsdoc/require-throws": "error",
|
|
56
|
+
"jsdoc/tag-lines": "off",
|
|
57
|
+
},
|
|
57
58
|
},
|
|
58
|
-
|
|
59
|
+
];
|
|
59
60
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { type StylisticConfig } from "../shared/env-utils.js";
|
|
1
|
+
import type { ConfigWithExtendsArg, StylisticConfig } from "../shared/env-utils.js";
|
|
3
2
|
/**
|
|
4
3
|
* Defines standard linting rules for JSON files.
|
|
5
4
|
*
|
|
@@ -10,6 +9,6 @@ import { type StylisticConfig } from "../shared/env-utils.js";
|
|
|
10
9
|
* Resolved configuration options.
|
|
11
10
|
*
|
|
12
11
|
* @returns
|
|
13
|
-
*
|
|
12
|
+
* The configuration entries to be added to the resulting configuration array.
|
|
14
13
|
*/
|
|
15
|
-
export default function json(stylisticConfig: StylisticConfig):
|
|
14
|
+
export default function json(stylisticConfig: StylisticConfig): ConfigWithExtendsArg;
|
package/dist/eslint/core/json.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import jsonPlugin from "eslint-plugin-jsonc";
|
|
2
|
-
import {
|
|
2
|
+
import { fixMissingFilesOption } from "../shared/env-utils.js";
|
|
3
3
|
// functions ==================================================================
|
|
4
4
|
/**
|
|
5
5
|
* Defines standard linting rules for JSON files.
|
|
@@ -11,16 +11,19 @@ import { createConfigArray, fixMissingFilesOption } from "../shared/env-utils.js
|
|
|
11
11
|
* Resolved configuration options.
|
|
12
12
|
*
|
|
13
13
|
* @returns
|
|
14
|
-
*
|
|
14
|
+
* The configuration entries to be added to the resulting configuration array.
|
|
15
15
|
*/
|
|
16
16
|
export default function json(stylisticConfig) {
|
|
17
17
|
// add missing "files" property in configurations with rules (otherwise, plugin conflicts with "@eslint/markdown")
|
|
18
|
-
return fixMissingFilesOption(
|
|
18
|
+
return fixMissingFilesOption(
|
|
19
19
|
// register rule implementations and recommended rules
|
|
20
|
-
jsonPlugin.configs["flat/recommended-with-json"],
|
|
20
|
+
jsonPlugin.configs["flat/recommended-with-json"].map((config, index) => ({
|
|
21
|
+
...config,
|
|
22
|
+
name: `core.json.recommended-${index}`,
|
|
23
|
+
})),
|
|
21
24
|
// reconfigure plugin rules
|
|
22
25
|
{
|
|
23
|
-
name: "json
|
|
26
|
+
name: "core.json.rules",
|
|
24
27
|
rules: {
|
|
25
28
|
"jsonc/array-bracket-spacing": "error",
|
|
26
29
|
"jsonc/comma-style": "error",
|
|
@@ -30,10 +33,10 @@ export default function json(stylisticConfig) {
|
|
|
30
33
|
"jsonc/no-octal-escape": "error",
|
|
31
34
|
},
|
|
32
35
|
}, {
|
|
33
|
-
name: "json
|
|
36
|
+
name: "core.json.tsconfig",
|
|
34
37
|
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
35
38
|
rules: {
|
|
36
39
|
"jsonc/no-comments": "off",
|
|
37
40
|
},
|
|
38
|
-
})
|
|
41
|
+
});
|
|
39
42
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ConfigWithExtendsArg } from "../shared/env-utils.js";
|
|
2
2
|
/**
|
|
3
3
|
* Checks the existence of license headers in source files.
|
|
4
4
|
*
|
|
@@ -6,9 +6,9 @@ import type { Linter } from "eslint";
|
|
|
6
6
|
* - `eslint-plugin-license-header`
|
|
7
7
|
*
|
|
8
8
|
* @param path
|
|
9
|
-
*
|
|
9
|
+
* Absolute path to the template file containing the license header.
|
|
10
10
|
*
|
|
11
11
|
* @returns
|
|
12
|
-
*
|
|
12
|
+
* The configuration entries to be added to the resulting configuration array.
|
|
13
13
|
*/
|
|
14
|
-
export default function license(path: string):
|
|
14
|
+
export default function license(path: string): ConfigWithExtendsArg;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import licensePlugin from "eslint-plugin-license-header";
|
|
2
|
-
import { SRC_GLOB
|
|
2
|
+
import { SRC_GLOB } from "../shared/env-utils.js";
|
|
3
3
|
// functions ==================================================================
|
|
4
4
|
/**
|
|
5
5
|
* Checks the existence of license headers in source files.
|
|
@@ -8,14 +8,14 @@ import { SRC_GLOB, createConfigArray } from "../shared/env-utils.js";
|
|
|
8
8
|
* - `eslint-plugin-license-header`
|
|
9
9
|
*
|
|
10
10
|
* @param path
|
|
11
|
-
*
|
|
11
|
+
* Absolute path to the template file containing the license header.
|
|
12
12
|
*
|
|
13
13
|
* @returns
|
|
14
|
-
*
|
|
14
|
+
* The configuration entries to be added to the resulting configuration array.
|
|
15
15
|
*/
|
|
16
16
|
export default function license(path) {
|
|
17
|
-
return
|
|
18
|
-
name: "license
|
|
17
|
+
return {
|
|
18
|
+
name: "core.license.plugin",
|
|
19
19
|
files: SRC_GLOB,
|
|
20
20
|
// register rule implementations of the plugin
|
|
21
21
|
plugins: {
|
|
@@ -25,5 +25,5 @@ export default function license(path) {
|
|
|
25
25
|
rules: {
|
|
26
26
|
"license-header/header": ["error", path],
|
|
27
27
|
},
|
|
28
|
-
}
|
|
28
|
+
};
|
|
29
29
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ConfigWithExtendsArg } from "../shared/env-utils.js";
|
|
2
2
|
/**
|
|
3
3
|
* Defines standard linting rules for Markdown files.
|
|
4
4
|
*
|
|
@@ -6,6 +6,6 @@ import type { Linter } from "eslint";
|
|
|
6
6
|
* - `@eslint/markdown`
|
|
7
7
|
*
|
|
8
8
|
* @returns
|
|
9
|
-
*
|
|
9
|
+
* The configuration entries to be added to the resulting configuration array.
|
|
10
10
|
*/
|
|
11
|
-
export default function markdown():
|
|
11
|
+
export default function markdown(): ConfigWithExtendsArg;
|
|
@@ -7,8 +7,11 @@ import markdownPlugin from "@eslint/markdown";
|
|
|
7
7
|
* - `@eslint/markdown`
|
|
8
8
|
*
|
|
9
9
|
* @returns
|
|
10
|
-
*
|
|
10
|
+
* The configuration entries to be added to the resulting configuration array.
|
|
11
11
|
*/
|
|
12
12
|
export default function markdown() {
|
|
13
|
-
return markdownPlugin.configs.recommended
|
|
13
|
+
return markdownPlugin.configs.recommended.map((config, index) => ({
|
|
14
|
+
...config,
|
|
15
|
+
name: `core.markdown.recommended-${index}`,
|
|
16
|
+
}));
|
|
14
17
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { type PackagesConfig } from "../shared/env-utils.js";
|
|
1
|
+
import type { ConfigWithExtendsArg, PackagesConfig } from "../shared/env-utils.js";
|
|
3
2
|
/**
|
|
4
3
|
* Defines linting rules for outdated or unneeded external dependencies.
|
|
5
4
|
*
|
|
@@ -10,6 +9,6 @@ import { type PackagesConfig } from "../shared/env-utils.js";
|
|
|
10
9
|
* Resolved configuration options.
|
|
11
10
|
*
|
|
12
11
|
* @returns
|
|
13
|
-
*
|
|
12
|
+
* The configuration entries to be added to the resulting configuration array.
|
|
14
13
|
*/
|
|
15
|
-
export default function packages(packagesConfig: PackagesConfig):
|
|
14
|
+
export default function packages(packagesConfig: PackagesConfig): ConfigWithExtendsArg;
|