@open-xchange/linter-presets 1.15.4 → 1.15.6
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 +9 -0
- package/dist/eslint/core/base.js +1 -1
- package/dist/eslint/core/js.js +1 -0
- package/dist/eslint/core/ts.d.ts +81 -1
- package/dist/eslint/core/ts.js +58 -50
- package/dist/eslint/core/vue.d.ts +5 -4
- package/dist/eslint/core/vue.js +18 -23
- package/dist/eslint/index.js +1 -1
- package/dist/eslint/shared/env-utils.d.ts +8 -2
- package/dist/eslint/shared/env-utils.js +3 -0
- package/package.json +23 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## `1.15.6` – 2025-Nov-21
|
|
4
|
+
|
|
5
|
+
- added: use `typescript-eslint` rules in Vue files
|
|
6
|
+
|
|
7
|
+
## `1.15.5` – 2025-Nov-20
|
|
8
|
+
|
|
9
|
+
- changed: use `@typescript-eslint/no-unused-private-class-members` for TS files instead of core rule
|
|
10
|
+
- chore: bump dependencies
|
|
11
|
+
|
|
3
12
|
## `1.15.4` – 2025-Nov-06
|
|
4
13
|
|
|
5
14
|
- chore: bump dependencies
|
package/dist/eslint/core/base.js
CHANGED
|
@@ -62,7 +62,7 @@ export default function base(languageConfig) {
|
|
|
62
62
|
"no-unassigned-vars": "error",
|
|
63
63
|
"no-unreachable-loop": "error",
|
|
64
64
|
"no-unsafe-optional-chaining": ["error", { disallowArithmeticOperators: true }],
|
|
65
|
-
"no-unused-private-class-members": "
|
|
65
|
+
"no-unused-private-class-members": "off", // separate rules for JS and TS
|
|
66
66
|
"require-atomic-updates": "error",
|
|
67
67
|
// suggestions
|
|
68
68
|
"block-scoped-var": "error",
|
package/dist/eslint/core/js.js
CHANGED
|
@@ -24,6 +24,7 @@ export default function js() {
|
|
|
24
24
|
"no-redeclare": "error",
|
|
25
25
|
"no-shadow": ["error", { ignoreOnInitialization: true }],
|
|
26
26
|
"no-throw-literal": "error",
|
|
27
|
+
"no-unused-private-class-members": "error",
|
|
27
28
|
"no-useless-constructor": "error",
|
|
28
29
|
"prefer-promise-reject-errors": "error",
|
|
29
30
|
"require-await": "error",
|
package/dist/eslint/core/ts.d.ts
CHANGED
|
@@ -1,4 +1,84 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { configs as pluginConfigs } from "typescript-eslint";
|
|
2
|
+
import type { ConfigArg } from "../shared/env-utils.js";
|
|
3
|
+
export type TSESLintConfigKey = keyof typeof pluginConfigs;
|
|
4
|
+
/**
|
|
5
|
+
* Names of all `typescript-eslint` presets to be included
|
|
6
|
+
*/
|
|
7
|
+
export declare const TSESLINT_PRESETS: ["strictTypeChecked", "stylisticTypeChecked"];
|
|
8
|
+
/**
|
|
9
|
+
* Custom configuration for `typescript-eslint` rules.
|
|
10
|
+
*/
|
|
11
|
+
export declare const TSESLINT_RULES: {
|
|
12
|
+
readonly "@typescript-eslint/array-type": ["error", {
|
|
13
|
+
readonly default: "array-simple";
|
|
14
|
+
}];
|
|
15
|
+
readonly "@typescript-eslint/consistent-indexed-object-style": "off";
|
|
16
|
+
readonly "@typescript-eslint/consistent-type-exports": "error";
|
|
17
|
+
readonly "@typescript-eslint/consistent-type-imports": ["error", {
|
|
18
|
+
readonly disallowTypeAnnotations: false;
|
|
19
|
+
}];
|
|
20
|
+
readonly "@typescript-eslint/default-param-last": "error";
|
|
21
|
+
readonly "@typescript-eslint/explicit-function-return-type": ["error", {
|
|
22
|
+
readonly allowExpressions: true;
|
|
23
|
+
readonly allowTypedFunctionExpressions: true;
|
|
24
|
+
readonly allowHigherOrderFunctions: true;
|
|
25
|
+
readonly allowConciseArrowFunctionExpressionsStartingWithVoid: true;
|
|
26
|
+
}];
|
|
27
|
+
readonly "@typescript-eslint/explicit-member-accessibility": ["error", {
|
|
28
|
+
readonly accessibility: "no-public";
|
|
29
|
+
readonly overrides: {
|
|
30
|
+
readonly constructors: "off";
|
|
31
|
+
};
|
|
32
|
+
}];
|
|
33
|
+
readonly "@typescript-eslint/no-confusing-void-expression": "off";
|
|
34
|
+
readonly "@typescript-eslint/no-dynamic-delete": "off";
|
|
35
|
+
readonly "@typescript-eslint/no-empty-function": ["error", {
|
|
36
|
+
readonly allow: readonly ["private-constructors", "protected-constructors", "decoratedFunctions", "overrideMethods"];
|
|
37
|
+
}];
|
|
38
|
+
readonly "@typescript-eslint/no-empty-object-type": ["error", {
|
|
39
|
+
readonly allowInterfaces: "always";
|
|
40
|
+
}];
|
|
41
|
+
readonly "@typescript-eslint/no-explicit-any": "off";
|
|
42
|
+
readonly "@typescript-eslint/no-import-type-side-effects": "error";
|
|
43
|
+
readonly "@typescript-eslint/no-invalid-this": "error";
|
|
44
|
+
readonly "@typescript-eslint/no-invalid-void-type": "off";
|
|
45
|
+
readonly "@typescript-eslint/no-loop-func": "error";
|
|
46
|
+
readonly "@typescript-eslint/no-misused-spread": "error";
|
|
47
|
+
readonly "@typescript-eslint/no-namespace": ["error", {
|
|
48
|
+
readonly allowDeclarations: true;
|
|
49
|
+
}];
|
|
50
|
+
readonly "@typescript-eslint/no-non-null-assertion": "off";
|
|
51
|
+
readonly "@typescript-eslint/no-redeclare": "error";
|
|
52
|
+
readonly "@typescript-eslint/no-shadow": ["error", {
|
|
53
|
+
readonly ignoreOnInitialization: true;
|
|
54
|
+
}];
|
|
55
|
+
readonly "@typescript-eslint/no-unnecessary-qualifier": "error";
|
|
56
|
+
readonly "@typescript-eslint/no-unnecessary-type-conversion": "error";
|
|
57
|
+
readonly "@typescript-eslint/no-unnecessary-type-parameters": "off";
|
|
58
|
+
readonly "@typescript-eslint/no-unsafe-declaration-merging": "off";
|
|
59
|
+
readonly "@typescript-eslint/no-unused-private-class-members": "error";
|
|
60
|
+
readonly "@typescript-eslint/no-unused-vars": ["error", {
|
|
61
|
+
varsIgnorePattern: string;
|
|
62
|
+
argsIgnorePattern: string;
|
|
63
|
+
destructuredArrayIgnorePattern: string;
|
|
64
|
+
caughtErrors: string;
|
|
65
|
+
ignoreRestSiblings: boolean;
|
|
66
|
+
}];
|
|
67
|
+
readonly "@typescript-eslint/parameter-properties": "error";
|
|
68
|
+
readonly "@typescript-eslint/prefer-nullish-coalescing": ["error", {
|
|
69
|
+
readonly ignorePrimitives: true;
|
|
70
|
+
}];
|
|
71
|
+
readonly "@typescript-eslint/prefer-readonly": "error";
|
|
72
|
+
readonly "@typescript-eslint/prefer-reduce-type-parameter": "off";
|
|
73
|
+
readonly "@typescript-eslint/restrict-template-expressions": "off";
|
|
74
|
+
readonly "@typescript-eslint/return-await": ["error", "always"];
|
|
75
|
+
readonly "@typescript-eslint/switch-exhaustiveness-check": ["error", {
|
|
76
|
+
readonly considerDefaultExhaustiveForUnions: true;
|
|
77
|
+
}];
|
|
78
|
+
readonly "@typescript-eslint/unified-signatures": ["error", {
|
|
79
|
+
readonly ignoreDifferentlyNamedParameters: true;
|
|
80
|
+
}];
|
|
81
|
+
};
|
|
2
82
|
/**
|
|
3
83
|
* Defines standard rules for TypeScript source files.
|
|
4
84
|
*
|
package/dist/eslint/core/ts.js
CHANGED
|
@@ -1,5 +1,57 @@
|
|
|
1
1
|
import { configs as pluginConfigs } from "typescript-eslint";
|
|
2
|
-
import { SRC_GLOB, TS_GLOB, DTS_GLOB, NO_UNUSED_VARS_OPTIONS } from "../shared/env-utils.js";
|
|
2
|
+
import { SRC_GLOB, TS_GLOB, DTS_GLOB, VUE_GLOB, NO_UNUSED_VARS_OPTIONS } from "../shared/env-utils.js";
|
|
3
|
+
// constants ==================================================================
|
|
4
|
+
/**
|
|
5
|
+
* Names of all `typescript-eslint` presets to be included
|
|
6
|
+
*/
|
|
7
|
+
export const TSESLINT_PRESETS = ["strictTypeChecked", "stylisticTypeChecked"];
|
|
8
|
+
/**
|
|
9
|
+
* Custom configuration for `typescript-eslint` rules.
|
|
10
|
+
*/
|
|
11
|
+
export const TSESLINT_RULES = {
|
|
12
|
+
"@typescript-eslint/array-type": ["error", { default: "array-simple" }],
|
|
13
|
+
"@typescript-eslint/consistent-indexed-object-style": "off",
|
|
14
|
+
"@typescript-eslint/consistent-type-exports": "error",
|
|
15
|
+
"@typescript-eslint/consistent-type-imports": ["error", { disallowTypeAnnotations: false }],
|
|
16
|
+
"@typescript-eslint/default-param-last": "error",
|
|
17
|
+
"@typescript-eslint/explicit-function-return-type": ["error", {
|
|
18
|
+
allowExpressions: true,
|
|
19
|
+
allowTypedFunctionExpressions: true,
|
|
20
|
+
allowHigherOrderFunctions: true,
|
|
21
|
+
allowConciseArrowFunctionExpressionsStartingWithVoid: true,
|
|
22
|
+
}],
|
|
23
|
+
"@typescript-eslint/explicit-member-accessibility": ["error", { accessibility: "no-public", overrides: { constructors: "off" } }],
|
|
24
|
+
"@typescript-eslint/no-confusing-void-expression": "off",
|
|
25
|
+
"@typescript-eslint/no-dynamic-delete": "off",
|
|
26
|
+
"@typescript-eslint/no-empty-function": ["error", {
|
|
27
|
+
allow: ["private-constructors", "protected-constructors", "decoratedFunctions", "overrideMethods"],
|
|
28
|
+
}],
|
|
29
|
+
"@typescript-eslint/no-empty-object-type": ["error", { allowInterfaces: "always" }],
|
|
30
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
31
|
+
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
32
|
+
"@typescript-eslint/no-invalid-this": "error",
|
|
33
|
+
"@typescript-eslint/no-invalid-void-type": "off",
|
|
34
|
+
"@typescript-eslint/no-loop-func": "error",
|
|
35
|
+
"@typescript-eslint/no-misused-spread": "error",
|
|
36
|
+
"@typescript-eslint/no-namespace": ["error", { allowDeclarations: true }],
|
|
37
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
38
|
+
"@typescript-eslint/no-redeclare": "error",
|
|
39
|
+
"@typescript-eslint/no-shadow": ["error", { ignoreOnInitialization: true }],
|
|
40
|
+
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
41
|
+
"@typescript-eslint/no-unnecessary-type-conversion": "error",
|
|
42
|
+
"@typescript-eslint/no-unnecessary-type-parameters": "off",
|
|
43
|
+
"@typescript-eslint/no-unsafe-declaration-merging": "off",
|
|
44
|
+
"@typescript-eslint/no-unused-private-class-members": "error",
|
|
45
|
+
"@typescript-eslint/no-unused-vars": ["error", NO_UNUSED_VARS_OPTIONS],
|
|
46
|
+
"@typescript-eslint/parameter-properties": "error",
|
|
47
|
+
"@typescript-eslint/prefer-nullish-coalescing": ["error", { ignorePrimitives: true }],
|
|
48
|
+
"@typescript-eslint/prefer-readonly": "error",
|
|
49
|
+
"@typescript-eslint/prefer-reduce-type-parameter": "off",
|
|
50
|
+
"@typescript-eslint/restrict-template-expressions": "off",
|
|
51
|
+
"@typescript-eslint/return-await": ["error", "always"],
|
|
52
|
+
"@typescript-eslint/switch-exhaustiveness-check": ["error", { considerDefaultExhaustiveForUnions: true }],
|
|
53
|
+
"@typescript-eslint/unified-signatures": ["error", { ignoreDifferentlyNamedParameters: true }],
|
|
54
|
+
};
|
|
3
55
|
// functions ==================================================================
|
|
4
56
|
/**
|
|
5
57
|
* Defines standard rules for TypeScript source files.
|
|
@@ -18,7 +70,7 @@ export default function ts(rootDir) {
|
|
|
18
70
|
return [
|
|
19
71
|
{
|
|
20
72
|
name: "core.ts.options",
|
|
21
|
-
files: SRC_GLOB,
|
|
73
|
+
files: [...SRC_GLOB, ...VUE_GLOB],
|
|
22
74
|
languageOptions: {
|
|
23
75
|
parserOptions: {
|
|
24
76
|
projectService: true,
|
|
@@ -32,54 +84,9 @@ export default function ts(rootDir) {
|
|
|
32
84
|
name: "core.ts.recommended",
|
|
33
85
|
files: TS_GLOB,
|
|
34
86
|
// recommended rules
|
|
35
|
-
extends: [
|
|
36
|
-
...pluginConfigs.strictTypeChecked,
|
|
37
|
-
...pluginConfigs.stylisticTypeChecked,
|
|
38
|
-
],
|
|
87
|
+
extends: TSESLINT_PRESETS.map(key => pluginConfigs[key]),
|
|
39
88
|
// reconfigure plugin rules
|
|
40
|
-
rules:
|
|
41
|
-
"@typescript-eslint/array-type": ["error", { default: "array-simple" }],
|
|
42
|
-
"@typescript-eslint/consistent-indexed-object-style": "off",
|
|
43
|
-
"@typescript-eslint/consistent-type-exports": "error",
|
|
44
|
-
"@typescript-eslint/consistent-type-imports": ["error", { disallowTypeAnnotations: false }],
|
|
45
|
-
"@typescript-eslint/default-param-last": "error",
|
|
46
|
-
"@typescript-eslint/explicit-function-return-type": ["error", {
|
|
47
|
-
allowExpressions: true,
|
|
48
|
-
allowTypedFunctionExpressions: true,
|
|
49
|
-
allowHigherOrderFunctions: true,
|
|
50
|
-
allowConciseArrowFunctionExpressionsStartingWithVoid: true,
|
|
51
|
-
}],
|
|
52
|
-
"@typescript-eslint/explicit-member-accessibility": ["error", { accessibility: "no-public", overrides: { constructors: "off" } }],
|
|
53
|
-
"@typescript-eslint/no-confusing-void-expression": "off",
|
|
54
|
-
"@typescript-eslint/no-dynamic-delete": "off",
|
|
55
|
-
"@typescript-eslint/no-empty-function": ["error", {
|
|
56
|
-
allow: ["private-constructors", "protected-constructors", "decoratedFunctions", "overrideMethods"],
|
|
57
|
-
}],
|
|
58
|
-
"@typescript-eslint/no-empty-object-type": ["error", { allowInterfaces: "always" }],
|
|
59
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
60
|
-
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
61
|
-
"@typescript-eslint/no-invalid-this": "error",
|
|
62
|
-
"@typescript-eslint/no-invalid-void-type": "off",
|
|
63
|
-
"@typescript-eslint/no-loop-func": "error",
|
|
64
|
-
"@typescript-eslint/no-misused-spread": "error",
|
|
65
|
-
"@typescript-eslint/no-namespace": ["error", { allowDeclarations: true }],
|
|
66
|
-
"@typescript-eslint/no-non-null-assertion": "off",
|
|
67
|
-
"@typescript-eslint/no-redeclare": "error",
|
|
68
|
-
"@typescript-eslint/no-shadow": ["error", { ignoreOnInitialization: true }],
|
|
69
|
-
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
70
|
-
"@typescript-eslint/no-unnecessary-type-conversion": "error",
|
|
71
|
-
"@typescript-eslint/no-unnecessary-type-parameters": "off",
|
|
72
|
-
"@typescript-eslint/no-unsafe-declaration-merging": "off",
|
|
73
|
-
"@typescript-eslint/no-unused-vars": ["error", NO_UNUSED_VARS_OPTIONS],
|
|
74
|
-
"@typescript-eslint/parameter-properties": "error",
|
|
75
|
-
"@typescript-eslint/prefer-nullish-coalescing": ["error", { ignorePrimitives: true }],
|
|
76
|
-
"@typescript-eslint/prefer-readonly": "error",
|
|
77
|
-
"@typescript-eslint/prefer-reduce-type-parameter": "off",
|
|
78
|
-
"@typescript-eslint/restrict-template-expressions": "off",
|
|
79
|
-
"@typescript-eslint/return-await": ["error", "always"],
|
|
80
|
-
"@typescript-eslint/switch-exhaustiveness-check": ["error", { considerDefaultExhaustiveForUnions: true }],
|
|
81
|
-
"@typescript-eslint/unified-signatures": ["error", { ignoreDifferentlyNamedParameters: true }],
|
|
82
|
-
},
|
|
89
|
+
rules: TSESLINT_RULES,
|
|
83
90
|
},
|
|
84
91
|
// fixes for module definition files
|
|
85
92
|
{
|
|
@@ -87,10 +94,11 @@ export default function ts(rootDir) {
|
|
|
87
94
|
files: DTS_GLOB,
|
|
88
95
|
rules: {
|
|
89
96
|
"no-duplicate-imports": "off", // triggers for multiple "declare" blocks in a file
|
|
90
|
-
"no-unused-private-class-members": "off", // allow to declare private class members
|
|
91
97
|
"@typescript-eslint/consistent-type-exports": "off",
|
|
92
98
|
"@typescript-eslint/consistent-type-imports": ["error", { prefer: "no-type-imports", disallowTypeAnnotations: false }],
|
|
93
99
|
"@typescript-eslint/no-extraneous-class": "off",
|
|
100
|
+
"@typescript-eslint/no-unused-private-class-members": "off", // allow to declare private class members
|
|
101
|
+
"@typescript-eslint/prefer-readonly": "off", // allow to declare class members without "readonly"
|
|
94
102
|
},
|
|
95
103
|
},
|
|
96
104
|
];
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import type { ConfigArg,
|
|
1
|
+
import type { ConfigArg, StylisticConfig } from "../shared/env-utils.js";
|
|
2
2
|
/**
|
|
3
3
|
* Creates configuration objects with linter rules for Vue.js.
|
|
4
4
|
*
|
|
5
5
|
* Wraps the following packages:
|
|
6
6
|
* - `eslint-plugin-vue`
|
|
7
|
+
* - `@vue/eslint-config-typescript`
|
|
7
8
|
*
|
|
8
|
-
* @param
|
|
9
|
-
*
|
|
9
|
+
* @param rootDir
|
|
10
|
+
* The project root directory.
|
|
10
11
|
*
|
|
11
12
|
* @param stylisticConfig
|
|
12
13
|
* Resolved stylistic configuration options.
|
|
@@ -14,4 +15,4 @@ import type { ConfigArg, LanguageConfig, StylisticConfig } from "../shared/env-u
|
|
|
14
15
|
* @returns
|
|
15
16
|
* The configuration entries to be added to the resulting configuration array.
|
|
16
17
|
*/
|
|
17
|
-
export default function vue(
|
|
18
|
+
export default function vue(rootDir: string, stylisticConfig: StylisticConfig): ConfigArg;
|
package/dist/eslint/core/vue.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import vuePlugin from "eslint-plugin-vue";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { configureVueProject, defineConfigWithVueTs, vueTsConfigs } from "@vue/eslint-config-typescript";
|
|
3
|
+
import { VUE_GLOB, NO_IMPLICIT_COERCION_OPTIONS, convertRuleWarningsToErrors, getCommaDangleConfig } from "../shared/env-utils.js";
|
|
4
|
+
import { TSESLINT_PRESETS, TSESLINT_RULES } from "./ts.js";
|
|
5
5
|
// functions ==================================================================
|
|
6
6
|
/**
|
|
7
7
|
* Creates configuration objects with linter rules for Vue.js.
|
|
8
8
|
*
|
|
9
9
|
* Wraps the following packages:
|
|
10
10
|
* - `eslint-plugin-vue`
|
|
11
|
+
* - `@vue/eslint-config-typescript`
|
|
11
12
|
*
|
|
12
|
-
* @param
|
|
13
|
-
*
|
|
13
|
+
* @param rootDir
|
|
14
|
+
* The project root directory.
|
|
14
15
|
*
|
|
15
16
|
* @param stylisticConfig
|
|
16
17
|
* Resolved stylistic configuration options.
|
|
@@ -18,23 +19,11 @@ import { NO_IMPLICIT_COERCION_OPTIONS, fixMissingFilesOption, convertRuleWarning
|
|
|
18
19
|
* @returns
|
|
19
20
|
* The configuration entries to be added to the resulting configuration array.
|
|
20
21
|
*/
|
|
21
|
-
export default function vue(
|
|
22
|
+
export default function vue(rootDir, stylisticConfig) {
|
|
23
|
+
configureVueProject({ rootDir, allowComponentTypeUnsafety: false });
|
|
22
24
|
// recommended configuration of the main plugin
|
|
23
25
|
const recommendedConfigs = vuePlugin.configs["flat/recommended"];
|
|
24
|
-
|
|
25
|
-
return fixMissingFilesOption(
|
|
26
|
-
// use TypeScript parser for Vue files
|
|
27
|
-
{
|
|
28
|
-
name: "core.vue.parser",
|
|
29
|
-
languageOptions: {
|
|
30
|
-
parser: vueParser,
|
|
31
|
-
parserOptions: {
|
|
32
|
-
parser: tseslint.parser,
|
|
33
|
-
sourceType: "module",
|
|
34
|
-
ecmaVersion: languageConfig.ecmaVersion,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
},
|
|
26
|
+
return defineConfigWithVueTs(
|
|
38
27
|
// register rule implementations and recommended rules, raise all recommended rules to "error" level
|
|
39
28
|
recommendedConfigs.map((config, index) => ({
|
|
40
29
|
...convertRuleWarningsToErrors(config),
|
|
@@ -72,7 +61,7 @@ export default function vue(languageConfig, stylisticConfig) {
|
|
|
72
61
|
"vue/require-explicit-slots": "error",
|
|
73
62
|
"vue/require-typed-ref": "error",
|
|
74
63
|
"vue/singleline-html-element-content-newline": "off",
|
|
75
|
-
//
|
|
64
|
+
// stylistic extensions
|
|
76
65
|
"vue/array-bracket-spacing": "error",
|
|
77
66
|
"vue/arrow-spacing": "error",
|
|
78
67
|
"vue/block-spacing": "error",
|
|
@@ -87,11 +76,17 @@ export default function vue(languageConfig, stylisticConfig) {
|
|
|
87
76
|
"vue/keyword-spacing": "error",
|
|
88
77
|
"vue/object-curly-spacing": ["error", "always"],
|
|
89
78
|
"vue/quote-props": ["error", "as-needed"],
|
|
90
|
-
"vue/script-indent": ["error", stylisticConfig.indent.vue, { switchCase: 1 }],
|
|
91
79
|
"vue/space-in-parens": "error",
|
|
92
80
|
"vue/space-infix-ops": "error",
|
|
93
81
|
"vue/space-unary-ops": "error",
|
|
94
82
|
"vue/template-curly-spacing": "error",
|
|
83
|
+
// @stylistic plugin
|
|
84
|
+
"@stylistic/indent": ["error", stylisticConfig.indent.vue, { SwitchCase: 1, MemberExpression: "off", flatTernaryExpressions: true }],
|
|
95
85
|
},
|
|
96
|
-
}
|
|
86
|
+
},
|
|
87
|
+
// create recommended typescript-eslint rules
|
|
88
|
+
...TSESLINT_PRESETS.map(key => vueTsConfigs[key]), {
|
|
89
|
+
name: "core.vue.ts.rules",
|
|
90
|
+
rules: TSESLINT_RULES,
|
|
91
|
+
}).map(config => ({ ...config, files: VUE_GLOB })); // restrict all configurations to Vue files
|
|
97
92
|
}
|
package/dist/eslint/index.js
CHANGED
|
@@ -106,7 +106,7 @@ export function defineConfig(options, ...configs) {
|
|
|
106
106
|
// default configuration for TypeScript files
|
|
107
107
|
ts(resolver.root),
|
|
108
108
|
// default configuration for Vue.js files
|
|
109
|
-
vue(
|
|
109
|
+
vue(resolver.root, stylisticConfig),
|
|
110
110
|
// default configuration for JSON files
|
|
111
111
|
json(stylisticConfig),
|
|
112
112
|
// default configuration for YAML files
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Linter } from "eslint";
|
|
2
2
|
import type { RuleConfig, RulesConfig, ConfigObject } from "@eslint/core";
|
|
3
3
|
import type { ConfigWithExtends } from "@eslint/config-helpers";
|
|
4
|
+
import type { TSESLint } from "@typescript-eslint/utils";
|
|
4
5
|
import type { DeepRequired, DeepOptArray } from "../../utils/utils.js";
|
|
5
|
-
export type Config = ConfigObject | ConfigWithExtends | Linter.Config;
|
|
6
|
+
export type Config = ConfigObject | ConfigWithExtends | Linter.Config | TSESLint.FlatConfig.Config;
|
|
6
7
|
export type ConfigArg = DeepOptArray<Config>;
|
|
7
8
|
/**
|
|
8
9
|
* Configuration options for language and project setup.
|
|
@@ -271,13 +272,18 @@ export declare function fixMissingFilesOption(...configs: ConfigArg[]): Config[]
|
|
|
271
272
|
* Converts severity "warning" of all rules in the passed configuration entry
|
|
272
273
|
* to severity "error".
|
|
273
274
|
*
|
|
275
|
+
* @template T
|
|
276
|
+
* The exact type of the passed configuration.
|
|
277
|
+
*
|
|
274
278
|
* @param config
|
|
275
279
|
* The configuration entry to be converted.
|
|
276
280
|
*
|
|
277
281
|
* @returns
|
|
278
282
|
* The converted configuration entry.
|
|
279
283
|
*/
|
|
280
|
-
export declare function convertRuleWarningsToErrors
|
|
284
|
+
export declare function convertRuleWarningsToErrors<T extends {
|
|
285
|
+
rules?: Partial<RulesConfig>;
|
|
286
|
+
}>(config: T): T;
|
|
281
287
|
/**
|
|
282
288
|
* Translates the stylistic option `dangle` to the configuration options for
|
|
283
289
|
* "comma-dangle" rules.
|
|
@@ -141,6 +141,9 @@ export function fixMissingFilesOption(...configs) {
|
|
|
141
141
|
* Converts severity "warning" of all rules in the passed configuration entry
|
|
142
142
|
* to severity "error".
|
|
143
143
|
*
|
|
144
|
+
* @template T
|
|
145
|
+
* The exact type of the passed configuration.
|
|
146
|
+
*
|
|
144
147
|
* @param config
|
|
145
148
|
* The configuration entry to be converted.
|
|
146
149
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-xchange/linter-presets",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.6",
|
|
4
4
|
"description": "Configuration presets for ESLint and StyleLint",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"engines": {
|
|
12
12
|
"node": ">=20.18"
|
|
13
13
|
},
|
|
14
|
-
"packageManager": "yarn@4.
|
|
14
|
+
"packageManager": "yarn@4.11.0",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
"./eslint": "./dist/eslint/index.js",
|
|
@@ -34,27 +34,28 @@
|
|
|
34
34
|
"@babel/eslint-parser": "^7.28.5",
|
|
35
35
|
"@babel/plugin-proposal-decorators": "^7.28.0",
|
|
36
36
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
37
|
-
"@eslint-react/eslint-plugin": "^2.3.
|
|
38
|
-
"@eslint/compat": "^
|
|
39
|
-
"@eslint/config-helpers": "^0.
|
|
37
|
+
"@eslint-react/eslint-plugin": "^2.3.5",
|
|
38
|
+
"@eslint/compat": "^2.0.0",
|
|
39
|
+
"@eslint/config-helpers": "^0.5.0",
|
|
40
40
|
"@eslint/js": "^9.39.1",
|
|
41
41
|
"@eslint/markdown": "^7.5.1",
|
|
42
|
-
"@stylistic/eslint-plugin": "^5.
|
|
42
|
+
"@stylistic/eslint-plugin": "^5.6.1",
|
|
43
43
|
"@stylistic/eslint-plugin-migrate": "^4.4.1",
|
|
44
44
|
"@stylistic/stylelint-config": "^3.0.1",
|
|
45
45
|
"@stylistic/stylelint-plugin": "^4.0.0",
|
|
46
46
|
"@types/picomatch": "^4.0.2",
|
|
47
|
-
"@vitest/eslint-plugin": "^1.4.
|
|
47
|
+
"@vitest/eslint-plugin": "^1.4.3",
|
|
48
|
+
"@vue/eslint-config-typescript": "^14.6.0",
|
|
48
49
|
"confusing-browser-globals": "^1.0.11",
|
|
49
50
|
"empathic": "^2.0.0",
|
|
50
51
|
"eslint-plugin-chai-expect": "^3.1.0",
|
|
51
52
|
"eslint-plugin-codeceptjs": "^1.3.0",
|
|
52
|
-
"eslint-plugin-depend": "^1.
|
|
53
|
+
"eslint-plugin-depend": "^1.4.0",
|
|
53
54
|
"eslint-plugin-eslint-plugin": "^7.2.0",
|
|
54
|
-
"eslint-plugin-jest": "^29.0
|
|
55
|
+
"eslint-plugin-jest": "^29.1.0",
|
|
55
56
|
"eslint-plugin-jest-dom": "^5.5.0",
|
|
56
57
|
"eslint-plugin-jest-extended": "^3.0.1",
|
|
57
|
-
"eslint-plugin-jsdoc": "^61.
|
|
58
|
+
"eslint-plugin-jsdoc": "^61.3.0",
|
|
58
59
|
"eslint-plugin-jsonc": "^2.21.0",
|
|
59
60
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
60
61
|
"eslint-plugin-license-header": "^0.8.0",
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
65
66
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
66
67
|
"eslint-plugin-regexp": "^2.10.0",
|
|
67
|
-
"eslint-plugin-testing-library": "^7.13.
|
|
68
|
+
"eslint-plugin-testing-library": "^7.13.4",
|
|
68
69
|
"eslint-plugin-vue": "^10.5.1",
|
|
69
70
|
"eslint-plugin-yml": "^1.19.0",
|
|
70
71
|
"globals": "^16.5.0",
|
|
@@ -75,15 +76,14 @@
|
|
|
75
76
|
"stylelint-config-standard-scss": "^16.0.0",
|
|
76
77
|
"stylelint-config-standard-vue": "^1.0.0",
|
|
77
78
|
"stylelint-plugin-license-header": "^1.0.3",
|
|
78
|
-
"typescript-eslint": "^8.
|
|
79
|
-
"vue-eslint-parser": "^10.2.0"
|
|
79
|
+
"typescript-eslint": "^8.47.0"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@types/confusing-browser-globals": "^1.0.3",
|
|
83
83
|
"@types/eslint-scope": "^8.3.2",
|
|
84
|
-
"@types/node": "^24.10.
|
|
85
|
-
"@types/react": "^19.2.
|
|
86
|
-
"@typescript-eslint/utils": "^8.
|
|
84
|
+
"@types/node": "^24.10.1",
|
|
85
|
+
"@types/react": "^19.2.6",
|
|
86
|
+
"@typescript-eslint/utils": "^8.47.0",
|
|
87
87
|
"eslint": "^9.39.1",
|
|
88
88
|
"jest": "^30.2.0",
|
|
89
89
|
"jiti": "^2.6.1",
|
|
@@ -91,7 +91,8 @@
|
|
|
91
91
|
"stylelint": "^16.25.0",
|
|
92
92
|
"ts-patch": "^3.3.0",
|
|
93
93
|
"typescript": "^5.9.3",
|
|
94
|
-
"typescript-transform-paths": "^3.5.5"
|
|
94
|
+
"typescript-transform-paths": "^3.5.5",
|
|
95
|
+
"vue": "^3.5.24"
|
|
95
96
|
},
|
|
96
97
|
"peerDependencies": {
|
|
97
98
|
"eslint": "^9.35.0",
|
|
@@ -99,7 +100,8 @@
|
|
|
99
100
|
"postcss": "^8.4.0",
|
|
100
101
|
"stylelint": "^16.23.0",
|
|
101
102
|
"typescript": "^5.9.0",
|
|
102
|
-
"vitest": "^3.0.0 || ^4.0.0"
|
|
103
|
+
"vitest": "^3.0.0 || ^4.0.0",
|
|
104
|
+
"vue": "^3.5.0"
|
|
103
105
|
},
|
|
104
106
|
"peerDependenciesMeta": {
|
|
105
107
|
"eslint": {
|
|
@@ -119,6 +121,9 @@
|
|
|
119
121
|
},
|
|
120
122
|
"vitest": {
|
|
121
123
|
"optional": true
|
|
124
|
+
},
|
|
125
|
+
"vue": {
|
|
126
|
+
"optional": true
|
|
122
127
|
}
|
|
123
128
|
}
|
|
124
129
|
}
|