@open-xchange/linter-presets 1.7.6 → 1.8.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/CHANGELOG.md +13 -2
- package/dist/eslint/core/base.js +1 -0
- package/dist/eslint/shared/env-utils.d.ts +13 -2
- package/dist/eslint/shared/env-utils.js +4 -2
- package/docs/eslint/env/browser.md +2 -1
- package/docs/eslint/env/codecept.md +2 -1
- package/docs/eslint/env/decorators.md +2 -1
- package/docs/eslint/env/eslint.md +2 -1
- package/docs/eslint/env/jest.md +2 -1
- package/docs/eslint/env/node.md +2 -1
- package/docs/eslint/env/project.md +2 -1
- package/docs/eslint/env/react.md +2 -1
- package/docs/eslint/env/tsconfig.md +2 -1
- package/docs/eslint/env/vitest.md +2 -1
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## `1.
|
|
3
|
+
## `1.8.0` – 2025-Aug-21
|
|
4
4
|
|
|
5
|
+
- added: (ESLint) support "basePath" option in environment presets
|
|
6
|
+
- added: (ESLint) support nested arrays in "files" option in environment presets (AND patterns)
|
|
7
|
+
- added: (ESLint) enable option "reportUnusedInlineConfigs" globally
|
|
5
8
|
- chore: bump dependencies
|
|
9
|
+
|
|
10
|
+
## `1.7.7` – 2025-Aug-14
|
|
11
|
+
|
|
12
|
+
- chore: bump dependencies
|
|
13
|
+
|
|
14
|
+
## `1.7.6` – 2025-Aug-10
|
|
15
|
+
|
|
6
16
|
- fixed: (ESLint) enable rule `@stylistic/indent` for jsx/tsx files
|
|
17
|
+
- chore: bump dependencies
|
|
7
18
|
|
|
8
19
|
## `1.7.5` – 2025-Aug-07
|
|
9
20
|
|
|
@@ -11,9 +22,9 @@
|
|
|
11
22
|
|
|
12
23
|
## `1.7.4` – 2025-Aug-01
|
|
13
24
|
|
|
14
|
-
- chore: bump typescript
|
|
15
25
|
- fixed: (ESLint) disable rule `@stylistic/indent` for jsx/tsx files ([eslint-stylistic#915](https://github.com/eslint-stylistic/eslint-stylistic/issues/915))
|
|
16
26
|
- fixed: (ESLint) set "tsconfigRootDir" parser option for all source files
|
|
27
|
+
- chore: bump typescript
|
|
17
28
|
|
|
18
29
|
## `1.7.3` – 2025-Jul-31
|
|
19
30
|
|
package/dist/eslint/core/base.js
CHANGED
|
@@ -32,6 +32,7 @@ export default function base(languageConfig) {
|
|
|
32
32
|
linterOptions: {
|
|
33
33
|
// report unused inline linter directives in source code
|
|
34
34
|
reportUnusedDisableDirectives: "error",
|
|
35
|
+
reportUnusedInlineConfigs: "error",
|
|
35
36
|
},
|
|
36
37
|
},
|
|
37
38
|
// ECMA version and module type for ES modules
|
|
@@ -120,11 +120,22 @@ export type StylisticConfig = DeepRequired<StylisticOptions>;
|
|
|
120
120
|
*/
|
|
121
121
|
export interface EnvFilesOptions {
|
|
122
122
|
/**
|
|
123
|
-
*
|
|
123
|
+
* Path to a sub directory to apply the environment preset to. The options
|
|
124
|
+
* "files" and "ignores" will be interpreted relatively to this path.
|
|
125
|
+
*
|
|
126
|
+
* @default "."
|
|
127
|
+
*/
|
|
128
|
+
basePath?: string;
|
|
129
|
+
/**
|
|
130
|
+
* Glob patterns for source files to be included into the environment. A
|
|
131
|
+
* file will be included if it matches one of the patterns. Inner arrays
|
|
132
|
+
* can be used to express AND conditions for files.
|
|
124
133
|
*/
|
|
125
|
-
files:
|
|
134
|
+
files: ReadonlyArray<string | string[]>;
|
|
126
135
|
/**
|
|
127
136
|
* Glob patterns for source files matching `files` to be ignored.
|
|
137
|
+
*
|
|
138
|
+
* @default []
|
|
128
139
|
*/
|
|
129
140
|
ignores?: readonly string[];
|
|
130
141
|
}
|
|
@@ -86,11 +86,13 @@ export function extGlob(extensions) {
|
|
|
86
86
|
* The resulting configuration entry.
|
|
87
87
|
*/
|
|
88
88
|
export function createConfig(name, envOptions, config, rules) {
|
|
89
|
+
const basePath = envOptions.basePath ?? config.basePath;
|
|
89
90
|
return {
|
|
90
91
|
...config,
|
|
91
92
|
name,
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
...(basePath ? { basePath } : undefined),
|
|
94
|
+
files: [envOptions.files, config.files].filter(e => !!e).flat(1),
|
|
95
|
+
ignores: [envOptions.ignores, config.ignores].filter(e => !!e).flat(1),
|
|
94
96
|
rules: { ...config.rules, ...rules },
|
|
95
97
|
};
|
|
96
98
|
}
|
|
@@ -12,7 +12,8 @@ function browser(options: EnvBrowserOptions): Linter.Config[];
|
|
|
12
12
|
|
|
13
13
|
| Name | Type | Default | Description |
|
|
14
14
|
| - | - | - | - |
|
|
15
|
-
| `
|
|
15
|
+
| `basePath` | `string` | `"."` | Path to a sub directory to apply the environment preset to. |
|
|
16
|
+
| `files` | `Array<string\|string[]>` | _required_ | Glob patterns for source files to be included. Use embedded arrays for AND patterns. |
|
|
16
17
|
| `ignores` | `string[]` | `[]` | Glob patterns for source files matching `files` to be ignored. |
|
|
17
18
|
| `restricted` | `EnvRestrictedOptions` | `{}` | Settings for banned globals, imports, object properties, and syntax constructs (see below). |
|
|
18
19
|
| `rules` | `Linter.RulesRecord` | `{}` | Additional linter rules to be added to the configuration. |
|
|
@@ -15,7 +15,8 @@ function codecept(options: EnvCodeceptOptions): Linter.Config[];
|
|
|
15
15
|
|
|
16
16
|
| Name | Type | Default | Description |
|
|
17
17
|
| - | - | - | - |
|
|
18
|
-
| `
|
|
18
|
+
| `basePath` | `string` | `"."` | Path to a sub directory to apply the environment preset to. |
|
|
19
|
+
| `files` | `Array<string\|string[]>` | _required_ | Glob patterns for source files to be included. Use embedded arrays for AND patterns. |
|
|
19
20
|
| `ignores` | `string[]` | `[]` | Glob patterns for source files matching `files` to be ignored. |
|
|
20
21
|
| `rules` | `Linter.RulesRecord` | `{}` | Additional linter rules to be added to the configuration. |
|
|
21
22
|
|
|
@@ -18,7 +18,8 @@ function decorators(options: EnvDecoratorsOptions): Linter.Config[];
|
|
|
18
18
|
|
|
19
19
|
| Name | Type | Default | Description |
|
|
20
20
|
| - | - | - | - |
|
|
21
|
-
| `
|
|
21
|
+
| `basePath` | `string` | `"."` | Path to a sub directory to apply the environment preset to. |
|
|
22
|
+
| `files` | `Array<string\|string[]>` | _required_ | Glob patterns for source files to be included. Use embedded arrays for AND patterns. |
|
|
22
23
|
| `ignores` | `string[]` | `[]` | Glob patterns for source files matching `files` to be ignored. |
|
|
23
24
|
| `rules` | `Linter.RulesRecord` | `{}` | Additional linter rules to be added to the configuration. |
|
|
24
25
|
|
|
@@ -12,7 +12,8 @@ function plugin(options: EnvEslintOptions): Linter.Config[];
|
|
|
12
12
|
|
|
13
13
|
| Name | Type | Default | Description |
|
|
14
14
|
| - | - | - | - |
|
|
15
|
-
| `
|
|
15
|
+
| `basePath` | `string` | `"."` | Path to a sub directory to apply the environment preset to. |
|
|
16
|
+
| `files` | `Array<string\|string[]>` | _required_ | Glob patterns for source files to be included. Use embedded arrays for AND patterns. |
|
|
16
17
|
| `ignores` | `string[]` | `[]` | Glob patterns for source files matching `files` to be ignored. |
|
|
17
18
|
| `rules` | `Linter.RulesRecord` | `{}` | Additional linter rules to be added to the configuration. |
|
|
18
19
|
|
package/docs/eslint/env/jest.md
CHANGED
|
@@ -17,7 +17,8 @@ function jest(options: EnvJestOptions): Linter.Config[];
|
|
|
17
17
|
|
|
18
18
|
| Name | Type | Default | Description |
|
|
19
19
|
| - | - | - | - |
|
|
20
|
-
| `
|
|
20
|
+
| `basePath` | `string` | `"."` | Path to a sub directory to apply the environment preset to. |
|
|
21
|
+
| `files` | `Array<string\|string[]>` | _required_ | Glob patterns for source files to be included. Use embedded arrays for AND patterns. |
|
|
21
22
|
| `ignores` | `string[]` | `[]` | Glob patterns for source files matching `files` to be ignored. |
|
|
22
23
|
| `rules` | `Linter.RulesRecord` | `{}` | Additional linter rules to be added to the configuration. |
|
|
23
24
|
| `jestExtended` | `boolean` | `false` | Activate plugin `eslint-plugin-jest-extended`. |
|
package/docs/eslint/env/node.md
CHANGED
|
@@ -12,7 +12,8 @@ function node(options: EnvNodeOptions): Linter.Config[];
|
|
|
12
12
|
|
|
13
13
|
| Name | Type | Default | Description |
|
|
14
14
|
| - | - | - | - |
|
|
15
|
-
| `
|
|
15
|
+
| `basePath` | `string` | `"."` | Path to a sub directory to apply the environment preset to. |
|
|
16
|
+
| `files` | `Array<string\|string[]>` | _required_ | Glob patterns for source files to be included. Use embedded arrays for AND patterns. |
|
|
16
17
|
| `ignores` | `string[]` | `[]` | Glob patterns for source files matching `files` to be ignored. |
|
|
17
18
|
| `sourceType` | `"module"\|"commonjs"` | `"module"` | Specifies how to treat `.js`, `.jsx`, `.ts`, and `.tsx`. |
|
|
18
19
|
| `restricted` | `EnvRestrictedOptions` | `{}` | Settings for banned globals, imports, object properties, and syntax constructs (see below). |
|
|
@@ -18,7 +18,8 @@ function project(options: EnvProjectOptions): Linter.Config[];
|
|
|
18
18
|
|
|
19
19
|
| Name | Type | Default | Description |
|
|
20
20
|
| - | - | - | - |
|
|
21
|
-
| `
|
|
21
|
+
| `basePath` | `string` | `"."` | Path to a sub directory to apply the environment preset to. |
|
|
22
|
+
| `files` | `Array<string\|string[]>` | _required_ | Glob patterns for source files to be included. Use embedded arrays for AND patterns. |
|
|
22
23
|
| `ignores` | `string[]` | `[]` | Glob patterns for source files matching `files` to be ignored. |
|
|
23
24
|
| `alias` | `Record<string, string>` | `{}` | Maps all alias prefixes to actual paths in the project (see below). |
|
|
24
25
|
| `external` | `string \| string[]` | `[]` | Specifies glob patterns for external modules (see below). |
|
package/docs/eslint/env/react.md
CHANGED
|
@@ -18,7 +18,8 @@ function react(options: EnvReactOptions): Linter.Config[];
|
|
|
18
18
|
|
|
19
19
|
| Name | Type | Default | Description |
|
|
20
20
|
| - | - | - | - |
|
|
21
|
-
| `
|
|
21
|
+
| `basePath` | `string` | `"."` | Path to a sub directory to apply the environment preset to. |
|
|
22
|
+
| `files` | `Array<string\|string[]>` | _required_ | Glob patterns for source files to be included. Use embedded arrays for AND patterns. |
|
|
22
23
|
| `ignores` | `string[]` | `[]` | Glob patterns for source files matching `files` to be ignored. |
|
|
23
24
|
| `rules` | `Linter.RulesRecord` | `{}` | Additional linter rules to be added to the configuration. |
|
|
24
25
|
|
|
@@ -14,7 +14,8 @@ function tsconfig(options: EnvTSConfigOptions): Linter.Config[];
|
|
|
14
14
|
|
|
15
15
|
| Name | Type | Default | Description |
|
|
16
16
|
| - | - | - | - |
|
|
17
|
-
| `
|
|
17
|
+
| `basePath` | `string` | `"."` | Path to a sub directory to apply the environment preset to. |
|
|
18
|
+
| `files` | `Array<string\|string[]>` | _required_ | Glob patterns for source files to be included. Use embedded arrays for AND patterns. |
|
|
18
19
|
| `ignores` | `string[]` | `[]` | Glob patterns for source files matching `files` to be ignored. |
|
|
19
20
|
| `project` | `string` | _required_ | The absolute path to the TypeScript project configuration file (`tsconfig.json`). |
|
|
20
21
|
| `rules` | `Linter.RulesRecord` | `{}` | Additional linter rules to be added to the configuration. |
|
|
@@ -17,7 +17,8 @@ function vitest(options: EnvVitestOptions): Linter.Config[];
|
|
|
17
17
|
|
|
18
18
|
| Name | Type | Default | Description |
|
|
19
19
|
| - | - | - | - |
|
|
20
|
-
| `
|
|
20
|
+
| `basePath` | `string` | `"."` | Path to a sub directory to apply the environment preset to. |
|
|
21
|
+
| `files` | `Array<string\|string[]>` | _required_ | Glob patterns for source files to be included. Use embedded arrays for AND patterns. |
|
|
21
22
|
| `ignores` | `string[]` | `[]` | Glob patterns for source files matching `files` to be ignored. |
|
|
22
23
|
| `rules` | `Linter.RulesRecord` | `{}` | Additional linter rules to be added to the configuration. |
|
|
23
24
|
| `jestExtended` | `boolean` | `false` | Activate plugin `eslint-plugin-jest-extended`. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-xchange/linter-presets",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
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.9.
|
|
14
|
+
"packageManager": "yarn@4.9.3",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
"./eslint": "./dist/eslint/index.js",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"test": "cd test && eslint . && stylelint \"**/*.{css,scss}\""
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@babel/core": "^7.28.
|
|
33
|
+
"@babel/core": "^7.28.3",
|
|
34
34
|
"@babel/eslint-parser": "^7.28.0",
|
|
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": "^1.52.
|
|
37
|
+
"@eslint-react/eslint-plugin": "^1.52.6",
|
|
38
38
|
"@eslint/compat": "^1.3.2",
|
|
39
39
|
"@eslint/config-helpers": "^0.3.1",
|
|
40
40
|
"@eslint/js": "^9.33.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"eslint-plugin-jest": "^29.0.1",
|
|
55
55
|
"eslint-plugin-jest-dom": "^5.5.0",
|
|
56
56
|
"eslint-plugin-jest-extended": "^3.0.0",
|
|
57
|
-
"eslint-plugin-jsdoc": "^
|
|
57
|
+
"eslint-plugin-jsdoc": "^54.1.1",
|
|
58
58
|
"eslint-plugin-jsonc": "^2.20.1",
|
|
59
59
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
60
60
|
"eslint-plugin-license-header": "^0.8.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"eslint-plugin-react-hooks-static-deps": "^1.0.7",
|
|
65
65
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
66
66
|
"eslint-plugin-regexp": "^2.10.0",
|
|
67
|
-
"eslint-plugin-testing-library": "^7.6.
|
|
67
|
+
"eslint-plugin-testing-library": "^7.6.6",
|
|
68
68
|
"eslint-plugin-vue": "^10.4.0",
|
|
69
69
|
"eslint-plugin-yml": "^1.18.0",
|
|
70
70
|
"globals": "^16.3.0",
|
|
@@ -75,15 +75,15 @@
|
|
|
75
75
|
"stylelint-config-standard-scss": "^15.0.1",
|
|
76
76
|
"stylelint-config-standard-vue": "^1.0.0",
|
|
77
77
|
"stylelint-plugin-license-header": "^1.0.3",
|
|
78
|
-
"typescript-eslint": "^8.
|
|
78
|
+
"typescript-eslint": "^8.40.0",
|
|
79
79
|
"vue-eslint-parser": "^10.2.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.
|
|
85
|
-
"@types/react": "^19.1.
|
|
86
|
-
"@typescript-eslint/utils": "^8.
|
|
84
|
+
"@types/node": "^24.3.0",
|
|
85
|
+
"@types/react": "^19.1.10",
|
|
86
|
+
"@typescript-eslint/utils": "^8.40.0",
|
|
87
87
|
"eslint": "^9.33.0",
|
|
88
88
|
"jest": "^30.0.5",
|
|
89
89
|
"jiti": "^2.5.1",
|