@open-xchange/linter-presets 1.7.7 → 1.8.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 CHANGED
@@ -1,13 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## `1.8.1` – 2025-Sep-04
4
+
5
+ - chore: bump dependencies
6
+
7
+ ## `1.8.0` – 2025-Aug-21
8
+
9
+ - added: (ESLint) support "basePath" option in environment presets
10
+ - added: (ESLint) support nested arrays in "files" option in environment presets (AND patterns)
11
+ - added: (ESLint) enable option "reportUnusedInlineConfigs" globally
12
+ - chore: bump dependencies
13
+
3
14
  ## `1.7.7` – 2025-Aug-14
4
15
 
5
16
  - chore: bump dependencies
6
17
 
7
18
  ## `1.7.6` – 2025-Aug-10
8
19
 
9
- - chore: bump dependencies
10
20
  - fixed: (ESLint) enable rule `@stylistic/indent` for jsx/tsx files
21
+ - chore: bump dependencies
11
22
 
12
23
  ## `1.7.5` – 2025-Aug-07
13
24
 
@@ -15,9 +26,9 @@
15
26
 
16
27
  ## `1.7.4` – 2025-Aug-01
17
28
 
18
- - chore: bump typescript
19
29
  - fixed: (ESLint) disable rule `@stylistic/indent` for jsx/tsx files ([eslint-stylistic#915](https://github.com/eslint-stylistic/eslint-stylistic/issues/915))
20
30
  - fixed: (ESLint) set "tsconfigRootDir" parser option for all source files
31
+ - chore: bump typescript
21
32
 
22
33
  ## `1.7.3` – 2025-Jul-31
23
34
 
@@ -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
- * Glob patterns for source files to be included into the environment.
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: readonly string[];
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
- files: flattenDeepArrays(envOptions.files, config.files),
93
- ignores: flattenDeepArrays(envOptions.ignores, config.ignores),
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
- | `files` | `string[]` | _required_ | Glob patterns for source files to be included. |
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
- | `files` | `string[]` | _required_ | Glob patterns for source files to be included. |
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
- | `files` | `string[]` | _required_ | Glob patterns for source files to be included. |
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
- | `files` | `string[]` | _required_ | Glob patterns for source files to be included. |
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
 
@@ -17,7 +17,8 @@ function jest(options: EnvJestOptions): Linter.Config[];
17
17
 
18
18
  | Name | Type | Default | Description |
19
19
  | - | - | - | - |
20
- | `files` | `string[]` | _required_ | Glob patterns for source files to be included. |
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`. |
@@ -12,7 +12,8 @@ function node(options: EnvNodeOptions): Linter.Config[];
12
12
 
13
13
  | Name | Type | Default | Description |
14
14
  | - | - | - | - |
15
- | `files` | `string[]` | _required_ | Glob patterns for source files to be included. |
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
- | `files` | `string[]` | _required_ | Glob patterns for source files to be included. |
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). |
@@ -18,7 +18,8 @@ function react(options: EnvReactOptions): Linter.Config[];
18
18
 
19
19
  | Name | Type | Default | Description |
20
20
  | - | - | - | - |
21
- | `files` | `string[]` | _required_ | Glob patterns for source files to be included. |
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
- | `files` | `string[]` | _required_ | Glob patterns for source files to be included. |
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
- | `files` | `string[]` | _required_ | Glob patterns for source files to be included. |
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.7.7",
3
+ "version": "1.8.1",
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.2",
14
+ "packageManager": "yarn@4.9.4",
15
15
  "type": "module",
16
16
  "exports": {
17
17
  "./eslint": "./dist/eslint/index.js",
@@ -30,21 +30,21 @@
30
30
  "test": "cd test && eslint . && stylelint \"**/*.{css,scss}\""
31
31
  },
32
32
  "dependencies": {
33
- "@babel/core": "^7.28.0",
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.4",
37
+ "@eslint-react/eslint-plugin": "^1.53.0",
38
38
  "@eslint/compat": "^1.3.2",
39
39
  "@eslint/config-helpers": "^0.3.1",
40
- "@eslint/js": "^9.33.0",
41
- "@eslint/markdown": "^7.1.0",
42
- "@stylistic/eslint-plugin": "^5.2.3",
40
+ "@eslint/js": "^9.34.0",
41
+ "@eslint/markdown": "^7.2.0",
42
+ "@stylistic/eslint-plugin": "^5.3.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.3.4",
47
+ "@vitest/eslint-plugin": "^1.3.8",
48
48
  "confusing-browser-globals": "^1.0.11",
49
49
  "empathic": "^2.0.0",
50
50
  "eslint-plugin-chai-expect": "^3.1.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": "^54.0.0",
57
+ "eslint-plugin-jsdoc": "^54.3.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.6",
67
+ "eslint-plugin-testing-library": "^7.6.8",
68
68
  "eslint-plugin-vue": "^10.4.0",
69
69
  "eslint-plugin-yml": "^1.18.0",
70
70
  "globals": "^16.3.0",
@@ -75,17 +75,17 @@
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.39.1",
78
+ "typescript-eslint": "^8.42.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.2.1",
85
- "@types/react": "^19.1.10",
86
- "@typescript-eslint/utils": "^8.39.1",
87
- "eslint": "^9.33.0",
88
- "jest": "^30.0.5",
84
+ "@types/node": "^24.3.0",
85
+ "@types/react": "^19.1.12",
86
+ "@typescript-eslint/utils": "^8.42.0",
87
+ "eslint": "^9.34.0",
88
+ "jest": "^30.1.3",
89
89
  "jiti": "^2.5.1",
90
90
  "premove": "^4.0.0",
91
91
  "stylelint": "^16.23.1",