@open-xchange/linter-presets 1.21.1 → 1.23.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.
Files changed (118) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +21 -0
  3. package/dist/eslint/index.d.mts +667 -0
  4. package/dist/eslint/index.d.mts.map +1 -0
  5. package/dist/eslint/index.mjs +2030 -0
  6. package/dist/eslint/index.mjs.map +1 -0
  7. package/dist/resolver-B_ekbcn6.mjs +37 -0
  8. package/dist/resolver-B_ekbcn6.mjs.map +1 -0
  9. package/dist/stylelint/index.d.mts +62 -0
  10. package/dist/stylelint/index.d.mts.map +1 -0
  11. package/dist/stylelint/index.mjs +98 -0
  12. package/dist/stylelint/index.mjs.map +1 -0
  13. package/package.json +20 -19
  14. package/dist/eslint/core/base.d.ts +0 -16
  15. package/dist/eslint/core/base.d.ts.map +0 -1
  16. package/dist/eslint/core/base.js +0 -124
  17. package/dist/eslint/core/directives.d.ts +0 -12
  18. package/dist/eslint/core/directives.d.ts.map +0 -1
  19. package/dist/eslint/core/directives.js +0 -20
  20. package/dist/eslint/core/js.d.ts +0 -10
  21. package/dist/eslint/core/js.d.ts.map +0 -1
  22. package/dist/eslint/core/js.js +0 -33
  23. package/dist/eslint/core/jsdoc.d.ts +0 -12
  24. package/dist/eslint/core/jsdoc.d.ts.map +0 -1
  25. package/dist/eslint/core/jsdoc.js +0 -76
  26. package/dist/eslint/core/json.d.ts +0 -15
  27. package/dist/eslint/core/json.d.ts.map +0 -1
  28. package/dist/eslint/core/json.js +0 -44
  29. package/dist/eslint/core/license.d.ts +0 -15
  30. package/dist/eslint/core/license.d.ts.map +0 -1
  31. package/dist/eslint/core/license.js +0 -29
  32. package/dist/eslint/core/markdown.d.ts +0 -12
  33. package/dist/eslint/core/markdown.d.ts.map +0 -1
  34. package/dist/eslint/core/markdown.js +0 -17
  35. package/dist/eslint/core/packages.d.ts +0 -15
  36. package/dist/eslint/core/packages.d.ts.map +0 -1
  37. package/dist/eslint/core/packages.js +0 -32
  38. package/dist/eslint/core/promises.d.ts +0 -12
  39. package/dist/eslint/core/promises.d.ts.map +0 -1
  40. package/dist/eslint/core/promises.js +0 -31
  41. package/dist/eslint/core/regexp.d.ts +0 -12
  42. package/dist/eslint/core/regexp.d.ts.map +0 -1
  43. package/dist/eslint/core/regexp.js +0 -23
  44. package/dist/eslint/core/stylistic.d.ts +0 -16
  45. package/dist/eslint/core/stylistic.d.ts.map +0 -1
  46. package/dist/eslint/core/stylistic.js +0 -124
  47. package/dist/eslint/core/ts.d.ts +0 -99
  48. package/dist/eslint/core/ts.d.ts.map +0 -1
  49. package/dist/eslint/core/ts.js +0 -108
  50. package/dist/eslint/core/vue.d.ts +0 -32
  51. package/dist/eslint/core/vue.d.ts.map +0 -1
  52. package/dist/eslint/core/vue.js +0 -100
  53. package/dist/eslint/core/yaml.d.ts +0 -15
  54. package/dist/eslint/core/yaml.d.ts.map +0 -1
  55. package/dist/eslint/core/yaml.js +0 -35
  56. package/dist/eslint/env/browser.d.ts +0 -24
  57. package/dist/eslint/env/browser.d.ts.map +0 -1
  58. package/dist/eslint/env/browser.js +0 -111
  59. package/dist/eslint/env/codecept.d.ts +0 -22
  60. package/dist/eslint/env/codecept.d.ts.map +0 -1
  61. package/dist/eslint/env/codecept.js +0 -45
  62. package/dist/eslint/env/decorators.d.ts +0 -21
  63. package/dist/eslint/env/decorators.d.ts.map +0 -1
  64. package/dist/eslint/env/decorators.js +0 -37
  65. package/dist/eslint/env/eslint.d.ts +0 -20
  66. package/dist/eslint/env/eslint.d.ts.map +0 -1
  67. package/dist/eslint/env/eslint.js +0 -28
  68. package/dist/eslint/env/jest.d.ts +0 -25
  69. package/dist/eslint/env/jest.d.ts.map +0 -1
  70. package/dist/eslint/env/jest.js +0 -62
  71. package/dist/eslint/env/node.d.ts +0 -61
  72. package/dist/eslint/env/node.d.ts.map +0 -1
  73. package/dist/eslint/env/node.js +0 -51
  74. package/dist/eslint/env/project.d.ts +0 -32
  75. package/dist/eslint/env/project.d.ts.map +0 -1
  76. package/dist/eslint/env/project.js +0 -41
  77. package/dist/eslint/env/react.d.ts +0 -35
  78. package/dist/eslint/env/react.d.ts.map +0 -1
  79. package/dist/eslint/env/react.js +0 -72
  80. package/dist/eslint/env/tsconfig.d.ts +0 -21
  81. package/dist/eslint/env/tsconfig.d.ts.map +0 -1
  82. package/dist/eslint/env/tsconfig.js +0 -26
  83. package/dist/eslint/env/vitest.d.ts +0 -25
  84. package/dist/eslint/env/vitest.d.ts.map +0 -1
  85. package/dist/eslint/env/vitest.js +0 -78
  86. package/dist/eslint/index.d.ts +0 -85
  87. package/dist/eslint/index.d.ts.map +0 -1
  88. package/dist/eslint/index.js +0 -137
  89. package/dist/eslint/rules/no-amd-module-directive.d.ts +0 -4
  90. package/dist/eslint/rules/no-amd-module-directive.d.ts.map +0 -1
  91. package/dist/eslint/rules/no-amd-module-directive.js +0 -33
  92. package/dist/eslint/rules/no-invalid-hierarchy.d.ts +0 -32
  93. package/dist/eslint/rules/no-invalid-hierarchy.d.ts.map +0 -1
  94. package/dist/eslint/rules/no-invalid-hierarchy.js +0 -85
  95. package/dist/eslint/rules/no-invalid-modules.d.ts +0 -14
  96. package/dist/eslint/rules/no-invalid-modules.d.ts.map +0 -1
  97. package/dist/eslint/rules/no-invalid-modules.js +0 -56
  98. package/dist/eslint/shared/env-utils.d.ts +0 -316
  99. package/dist/eslint/shared/env-utils.d.ts.map +0 -1
  100. package/dist/eslint/shared/env-utils.js +0 -202
  101. package/dist/eslint/shared/restricted.d.ts +0 -91
  102. package/dist/eslint/shared/restricted.d.ts.map +0 -1
  103. package/dist/eslint/shared/restricted.js +0 -98
  104. package/dist/eslint/shared/rule-utils.d.ts +0 -149
  105. package/dist/eslint/shared/rule-utils.d.ts.map +0 -1
  106. package/dist/eslint/shared/rule-utils.js +0 -261
  107. package/dist/eslint/shared/unittest.d.ts +0 -41
  108. package/dist/eslint/shared/unittest.d.ts.map +0 -1
  109. package/dist/eslint/shared/unittest.js +0 -39
  110. package/dist/stylelint/index.d.ts +0 -58
  111. package/dist/stylelint/index.d.ts.map +0 -1
  112. package/dist/stylelint/index.js +0 -111
  113. package/dist/utils/resolver.d.ts +0 -23
  114. package/dist/utils/resolver.d.ts.map +0 -1
  115. package/dist/utils/resolver.js +0 -33
  116. package/dist/utils/utils.d.ts +0 -32
  117. package/dist/utils/utils.d.ts.map +0 -1
  118. package/dist/utils/utils.js +0 -40
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## `1.23.0` – 2026-Apr-20
4
+
5
+ - added: (ESLint) support for eslint v10 (with ES decorators)
6
+
7
+ ## `1.22.0` – 2026-Apr-09
8
+
9
+ - chore: switch to `tsdown` for building packages
10
+
3
11
  ## `1.21.1` – 2026-Apr-09
4
12
 
5
13
  - added: (ESLint) rules `@eslint-react/jsx-no-leaked-dollar` and `@eslint-react/jsx-no-leaked-semicolon`
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Open-Xchange GmbH, Germany <info@open-xchange.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,667 @@
1
+ import { ConfigWithExtends } from "@eslint/config-helpers";
2
+ import { ESLintUtils, TSESLint } from "@typescript-eslint/utils";
3
+ import { ConfigObject, ConfigObject as ConfigObject$1, RulesConfig, RulesConfig as RulesConfig$1 } from "@eslint/core";
4
+ import { Linter } from "eslint";
5
+ import ts from "typescript";
6
+
7
+ //#region src/utils/resolver.d.ts
8
+ /**
9
+ * A resolver for file paths relative to a base URL.
10
+ */
11
+ declare class PathResolver {
12
+ #private;
13
+ constructor(url: string);
14
+ /**
15
+ * @returns
16
+ * The directory path of the URL passed to the constructor.
17
+ */
18
+ get root(): string;
19
+ /**
20
+ * Converts a file path relative to 'root' to an absolute file path.
21
+ *
22
+ * @param file
23
+ * The file path to be converted.
24
+ *
25
+ * @returns
26
+ * The absolute file path.
27
+ */
28
+ path(file: string): string;
29
+ }
30
+ //#endregion
31
+ //#region src/utils/utils.d.ts
32
+ type DeepOptArray<T> = T | false | null | undefined | ReadonlyArray<DeepOptArray<T>>;
33
+ //#endregion
34
+ //#region src/eslint/shared/env-utils.d.ts
35
+ type Config = ConfigObject$1 | ConfigWithExtends | Linter.Config | TSESLint.FlatConfig.Config;
36
+ type ConfigArg = DeepOptArray<Config>;
37
+ /**
38
+ * Configuration options for language and project setup.
39
+ */
40
+ interface LanguageOptions {
41
+ /**
42
+ * The ECMAScript version to be used in the project (version or year).
43
+ *
44
+ * @default 'latest'
45
+ */
46
+ ecmaVersion?: Linter.EcmaVersion;
47
+ /**
48
+ * Specifies how to treat `.js`, `.jsx`, `.ts`, and `.tsx` files.
49
+ *
50
+ * - 'module': The files will be considered being ES modules.
51
+ * - 'commonjs': The files will be considered being CommonJS modules.
52
+ *
53
+ * @default 'module'
54
+ */
55
+ sourceType?: 'module' | 'commonjs';
56
+ }
57
+ /**
58
+ * Configuration options for external package dependencies.
59
+ */
60
+ interface PackagesOptions {
61
+ /**
62
+ * A list of packages to be allowed in the project even if they have been
63
+ * banned by the plugin `eslint-plugin-depend`.
64
+ */
65
+ allowed?: readonly string[];
66
+ /**
67
+ * A list of additional packages to be banned in the project.
68
+ */
69
+ banned?: readonly string[];
70
+ }
71
+ /**
72
+ * Configuration options for code indentation per file type.
73
+ */
74
+ interface IndentOverridesOptions {
75
+ /**
76
+ * Indentation size for JavaScript and TypeScript files, including JSX.
77
+ */
78
+ js?: number;
79
+ /**
80
+ * Indentation size for JSON files.
81
+ */
82
+ json?: number;
83
+ /**
84
+ * Indentation size for YAML files.
85
+ */
86
+ yaml?: number;
87
+ /**
88
+ * Indentation size for Vue.js files (script and template blocks).
89
+ */
90
+ vue?: number;
91
+ }
92
+ /**
93
+ * Configuration options for code style.
94
+ */
95
+ interface StylisticOptions {
96
+ /**
97
+ * Default indentation (number of space characters) for all file types.
98
+ *
99
+ * @default 2
100
+ */
101
+ indent?: number;
102
+ /**
103
+ * Indentation (number of space characters) overrides for specific file
104
+ * types.
105
+ *
106
+ * @default 2
107
+ */
108
+ indentOverrides?: IndentOverridesOptions;
109
+ /**
110
+ * Specifies how to treat semicolons.
111
+ *
112
+ * - 'always': Require semicolons following all statements.
113
+ * - 'never': Require to omit semicolons according to ASI rules.
114
+ * - 'off': Semicolons will not be checked.
115
+ *
116
+ * @default 'never'
117
+ */
118
+ semi?: 'always' | 'never' | 'off';
119
+ /**
120
+ * The type of the string delimiter character.
121
+ *
122
+ * @default 'single'
123
+ */
124
+ quotes?: 'single' | 'double' | 'off';
125
+ /**
126
+ * Specifies how to treat dangling commas in multiline lists.
127
+ *
128
+ * - 'always': Dangling commas will be required in all multi-line array
129
+ * literals, object literals, function parameters, template parameters,
130
+ * imports, and exports.
131
+ * - 'never': Dangling commas will be forbidden.
132
+ * - 'off': Dangling commas will not be checked.
133
+ *
134
+ * @default 'always'
135
+ */
136
+ dangle?: 'always' | 'never' | 'off';
137
+ }
138
+ /**
139
+ * Shared options for an environment preset with included and excluded files.
140
+ */
141
+ interface EnvFilesOptions {
142
+ /**
143
+ * Path to a sub directory to apply the environment preset to. The options
144
+ * 'files' and 'ignores' will be interpreted relatively to this path.
145
+ *
146
+ * @default '.'
147
+ */
148
+ basePath?: string;
149
+ /**
150
+ * Glob patterns for source files to be included into the environment. A file
151
+ * will be included if it matches one of the patterns. Inner arrays can be
152
+ * used to express AND conditions for files.
153
+ */
154
+ files: ReadonlyArray<string | string[]>;
155
+ /**
156
+ * Glob patterns for source files matching `files` to be ignored.
157
+ *
158
+ * @default []
159
+ */
160
+ ignores?: readonly string[];
161
+ }
162
+ /**
163
+ * Shared options for an environment preset: include and exclude files, and add
164
+ * more linter rules.
165
+ */
166
+ interface EnvBaseOptions extends EnvFilesOptions {
167
+ /**
168
+ * Additional linter rules to be added to the configuration.
169
+ */
170
+ rules?: RulesConfig$1;
171
+ }
172
+ //#endregion
173
+ //#region src/eslint/core/vue.d.ts
174
+ /**
175
+ * Configuration options for Vue source files.
176
+ */
177
+ interface VueOptions {
178
+ /**
179
+ * Names of all globally registered directives to be ignored by the rule
180
+ * `vue/no-undef-directives` (without 'v-' prefix).
181
+ */
182
+ globalDirectives?: readonly string[];
183
+ }
184
+ //#endregion
185
+ //#region src/eslint/shared/restricted.d.ts
186
+ /**
187
+ * Configuration for a single banned global or import.
188
+ */
189
+ interface EnvRestrictedName {
190
+ name: string;
191
+ message: string;
192
+ }
193
+ /**
194
+ * Configuration for a single banned object property.
195
+ */
196
+ interface EnvRestrictedProperty {
197
+ object: string;
198
+ property: string;
199
+ message: string;
200
+ }
201
+ /**
202
+ * Configuration for a single banned syntax construct.
203
+ */
204
+ interface EnvRestrictedSyntax {
205
+ selector: string;
206
+ message: string;
207
+ }
208
+ /**
209
+ * Collection of banned globals, imports, properties, and syntax constructs.
210
+ */
211
+ interface EnvRestrictedItems {
212
+ /** The global symbols to be banned. */
213
+ globals?: EnvRestrictedName[];
214
+ /** The module imports to be banned. */
215
+ imports?: EnvRestrictedName[];
216
+ /** The global object properties to be banned. */
217
+ properties?: EnvRestrictedProperty[];
218
+ /** The syntax constructs to be banned. */
219
+ syntax?: EnvRestrictedSyntax[];
220
+ }
221
+ /**
222
+ * Collection of banned globals, imports, properties, and syntax constructs,
223
+ * for a specific subset of the files included in an environment.
224
+ */
225
+ interface EnvRestrictedOverride extends EnvFilesOptions, EnvRestrictedItems {}
226
+ /**
227
+ * Type shape of a dedicated environment option 'restricted' with settings for
228
+ * banned globals, imports, properties, and syntax constructs.
229
+ */
230
+ interface EnvRestrictedOption extends EnvRestrictedItems {
231
+ /**
232
+ * Overrides for specific subsets of files in the environment. All restricted
233
+ * items of overrides will be merged with the common restricted items defined
234
+ * for the entire environment.
235
+ */
236
+ overrides?: EnvRestrictedOverride[];
237
+ }
238
+ /**
239
+ * Shared options for an environment preset: include and exclude files, add
240
+ * more linter rules, and settings for restricted items.
241
+ */
242
+ interface EnvRestrictedOptions extends EnvBaseOptions {
243
+ /**
244
+ * All globals, imports, properties, and syntax constructs to be banned for
245
+ * the files included by the environment.
246
+ */
247
+ restricted?: EnvRestrictedOption;
248
+ }
249
+ //#endregion
250
+ //#region src/eslint/env/node.d.ts
251
+ type EnvNodeConvertPathPattern = [pattern: string, replacement: string];
252
+ /**
253
+ * Configuration for the record-style setting 'convertPath' of the plugin
254
+ * `eslint-plugin-n`.
255
+ */
256
+ type EnvNodeConvertPathRecord = Record<string, EnvNodeConvertPathPattern>;
257
+ /**
258
+ * Configuration for the elements in the array-style setting 'convertPath' of
259
+ * the plugin `eslint-plugin-n`.
260
+ */
261
+ interface EnvNodeConvertPathElement {
262
+ include: string[];
263
+ exclude?: string[];
264
+ replace: EnvNodeConvertPathPattern;
265
+ }
266
+ /**
267
+ * Shared settings for the plugin `eslint-plugin-n`.
268
+ */
269
+ interface EnvNodeSharedSettings {
270
+ version?: string;
271
+ allowModules?: string[];
272
+ resolvePaths?: string[];
273
+ convertPath?: EnvNodeConvertPathRecord | EnvNodeConvertPathElement[];
274
+ tryExtensions?: string[];
275
+ tsconfigPath?: string[];
276
+ typescriptExtensionMap?: ts.server.protocol.JsxEmit | Array<[string, string]>;
277
+ }
278
+ /**
279
+ * Configuration options for the environment preset 'env.node'.
280
+ */
281
+ interface EnvNodeOptions extends EnvRestrictedOptions {
282
+ /**
283
+ * The module mode used by the linted files.
284
+ *
285
+ * @default 'module'
286
+ */
287
+ sourceType?: LanguageOptions['sourceType'];
288
+ /**
289
+ * Shared settings for the plugin `eslint-plugin-n`. Will be merged into the
290
+ * settings object with the key 'n'.
291
+ */
292
+ settings?: EnvNodeSharedSettings;
293
+ }
294
+ /**
295
+ * Creates configuration objects with global symbols and linter rules for
296
+ * NodeJS modules.
297
+ *
298
+ * Wraps the following packages:
299
+ * - `eslint-plugin-n`
300
+ *
301
+ * @param envOptions
302
+ * Configuration options for the environment.
303
+ *
304
+ * @returns
305
+ * The configuration entries to be added to the resulting configuration array.
306
+ */
307
+ declare function node(envOptions: EnvNodeOptions): ConfigArg;
308
+ //#endregion
309
+ //#region src/eslint/env/browser.d.ts
310
+ /**
311
+ * Configuration options for the environment preset 'env.browser'.
312
+ */
313
+ interface EnvBrowserOptions extends EnvRestrictedOptions {}
314
+ /**
315
+ * Creates configuration objects with global symbols and linter rules for for
316
+ * browser modules.
317
+ *
318
+ * Wraps the following packages:
319
+ * - `globals`
320
+ * - `confusing-browser-globals`
321
+ * - `eslint-plugin-no-unsanitized`
322
+ *
323
+ * @param envOptions
324
+ * Configuration options for the environment.
325
+ *
326
+ * @returns
327
+ * The configuration entries to be added to the resulting configuration array.
328
+ */
329
+ declare function browser(envOptions: EnvBrowserOptions): ConfigArg;
330
+ //#endregion
331
+ //#region src/eslint/shared/unittest.d.ts
332
+ /**
333
+ * Shared options for environment presets for unit tests.
334
+ */
335
+ interface EnvUnitTestOptions extends EnvBaseOptions {
336
+ /**
337
+ * Specifies whether to include `eslint-plugin-jest-extended`. Should only be
338
+ * used, if the package `jest-extended` has been installed in the project.
339
+ *
340
+ * @default false
341
+ */
342
+ jestExtended?: boolean;
343
+ /**
344
+ * Specifies whether to include `eslint-plugin-jest-dom`. Should only be
345
+ * used, if the package `@testing-library/jest-dom` has been installed in the
346
+ * project.
347
+ *
348
+ * @default false
349
+ */
350
+ jestDom?: boolean;
351
+ /**
352
+ * Specifies the recommended rule set of `eslint-plugin-testing-library` to
353
+ * be included.
354
+ */
355
+ testingLib?: 'angular' | 'dom' | 'marko' | 'react' | 'vue';
356
+ }
357
+ //#endregion
358
+ //#region src/eslint/env/jest.d.ts
359
+ /**
360
+ * Configuration options for the environment preset 'env.jest'.
361
+ */
362
+ interface EnvJestOptions extends EnvUnitTestOptions {}
363
+ /**
364
+ * Creates configuration objects with global symbols and linter rules for unit
365
+ * tests using Jest.
366
+ *
367
+ * Wraps the following packages:
368
+ * - `eslint-plugin-jest`
369
+ * - `eslint-plugin-jest-extended`
370
+ * - `eslint-plugin-jest-dom`
371
+ * - `eslint-plugin-testing-library`
372
+ *
373
+ * @param envOptions
374
+ * Configuration options for the environment.
375
+ *
376
+ * @returns
377
+ * The configuration entries to be added to the resulting configuration array.
378
+ */
379
+ declare function jest(envOptions: EnvJestOptions): ConfigArg;
380
+ //#endregion
381
+ //#region src/eslint/env/vitest.d.ts
382
+ /**
383
+ * Configuration options for the environment preset 'env.vitest'.
384
+ */
385
+ interface EnvVitestOptions extends EnvUnitTestOptions {}
386
+ /**
387
+ * Creates configuration objects with global symbols and linter rules for unit
388
+ * tests using Vitest.
389
+ *
390
+ * Wraps the following packages:
391
+ * - `eslint-plugin-vitest`
392
+ * - `eslint-plugin-jest-extended`
393
+ * - `eslint-plugin-jest-dom`
394
+ * - `eslint-plugin-testing-library`
395
+ *
396
+ * @param envOptions
397
+ * Configuration options for the environment.
398
+ *
399
+ * @returns
400
+ * The configuration entries to be added to the resulting configuration array.
401
+ */
402
+ declare function vitest(envOptions: EnvVitestOptions): ConfigArg;
403
+ //#endregion
404
+ //#region src/eslint/env/codecept.d.ts
405
+ /**
406
+ * Configuration options for the environment preset 'env.codecept'.
407
+ */
408
+ interface EnvCodeceptOptions extends EnvBaseOptions {}
409
+ /**
410
+ * Creates configuration objects with global symbols and linter rules for E2E
411
+ * tests using CodeceptJS.
412
+ *
413
+ * Wraps the following packages:
414
+ * - `eslint-plugin-codeceptjs`
415
+ * - `eslint-plugin-chai-expect`
416
+ *
417
+ * @param envOptions
418
+ * Configuration options for the environment.
419
+ *
420
+ * @returns
421
+ * The configuration entries to be added to the resulting configuration array.
422
+ */
423
+ declare function codecept(envOptions: EnvCodeceptOptions): ConfigArg;
424
+ //#endregion
425
+ //#region src/eslint/env/react.d.ts
426
+ /**
427
+ * Configuration options for the environment preset 'env.react'.
428
+ */
429
+ interface EnvReactOptions extends EnvBaseOptions {
430
+ /**
431
+ * Configuration for the rule '@eslint-react/rules-of-hooks'.
432
+ *
433
+ * Additional hooks that will be treated as effect hooks, like 'useEffect'.
434
+ */
435
+ effectHooks?: readonly string[];
436
+ /**
437
+ * Configuration for the rule '@eslint-react/set-state-in-effect'.
438
+ *
439
+ * Additional hooks that will be treated as state hooks, like 'useState'.
440
+ */
441
+ stateHooks?: readonly string[];
442
+ }
443
+ /**
444
+ * Creates configuration objects with linter rules for ReactJS.
445
+ *
446
+ * Wraps the following packages:
447
+ * - `@eslint-react/eslint-plugin`
448
+ * - `eslint-plugin-react-hooks`
449
+ * - `eslint-plugin-react-refresh`
450
+ * - `eslint-plugin-jsx-a11y`
451
+ *
452
+ * @param envOptions
453
+ * Configuration options for the environment.
454
+ *
455
+ * @returns
456
+ * The configuration entries to be added to the resulting configuration array.
457
+ */
458
+ declare function react(envOptions: EnvReactOptions): ConfigArg;
459
+ //#endregion
460
+ //#region src/eslint/env/eslint.d.ts
461
+ /**
462
+ * Configuration options for the environment preset 'env.eslint'.
463
+ */
464
+ interface EnvEslintOptions extends EnvBaseOptions {}
465
+ /**
466
+ * Adds linter rules for ESLint plugin implementations.
467
+ *
468
+ * Wraps the following packages:
469
+ * - `eslint-plugin-eslint-plugin`
470
+ *
471
+ * @param envOptions
472
+ * Configuration options for the environment.
473
+ *
474
+ * @returns
475
+ * The configuration entries to be added to the resulting configuration array.
476
+ */
477
+ declare function eslint(envOptions: EnvEslintOptions): ConfigArg;
478
+ //#endregion
479
+ //#region src/eslint/shared/rule-utils.d.ts
480
+ /**
481
+ * Shared settings used by multiple rules.
482
+ */
483
+ interface SharedRuleSettings {
484
+ /**
485
+ * Maps all alias prefixes to actual paths in the project.
486
+ */
487
+ alias?: Record<string, string>;
488
+ }
489
+ //#endregion
490
+ //#region src/eslint/rules/no-invalid-modules.d.ts
491
+ /**
492
+ * Configuration for the rule 'env-project/no-invalid-modules'.
493
+ */
494
+ interface RuleNoInvalidModulesOptions {
495
+ /**
496
+ * Specifies glob patterns for external modules.
497
+ */
498
+ external?: string[];
499
+ }
500
+ //#endregion
501
+ //#region src/eslint/rules/no-invalid-hierarchy.d.ts
502
+ /**
503
+ * Configuration for the rule 'env-project/no-invalid-hierarchy' to specify a
504
+ * sub package inside a project.
505
+ */
506
+ interface RuleNoInvalidHierarchyPackage {
507
+ /**
508
+ * Glob patterns selecting all source files that are part of the package.
509
+ */
510
+ files: string[];
511
+ /**
512
+ * Specifies the names of all packages (keys of the `packages` dictionary)
513
+ * this package depends on.
514
+ */
515
+ extends?: string | string[];
516
+ /**
517
+ * Set to `true` to mark an optional package that may be missing in an
518
+ * installation. Such a package cannot be imported statically (with `import`
519
+ * statement) from a non-optional package, but can only be loaded dynamically
520
+ * at runtime (by calling `import()`). The rule will mark all static imports
521
+ * of optional code as an error.
522
+ *
523
+ * @default false
524
+ */
525
+ optional?: boolean;
526
+ }
527
+ type RuleNoInvalidHierarchyOptions = Record<string, RuleNoInvalidHierarchyPackage>;
528
+ //#endregion
529
+ //#region src/eslint/env/project.d.ts
530
+ /**
531
+ * Configuration options for the environment preset 'env.project'.
532
+ */
533
+ interface EnvProjectOptions extends EnvBaseOptions {
534
+ /**
535
+ * Maps all alias prefixes to actual paths in the project.
536
+ */
537
+ alias?: SharedRuleSettings['alias'];
538
+ /**
539
+ * Options to be passed to the rule 'env-project/no-invalid-modules'.
540
+ */
541
+ external?: RuleNoInvalidModulesOptions['external'];
542
+ /**
543
+ * Options to be passed to the rule 'env-project/no-invalid-hierarchy'.
544
+ */
545
+ hierarchy?: RuleNoInvalidHierarchyOptions;
546
+ }
547
+ /**
548
+ * Adds custom linter rules for checking project setup and module hierarchy.
549
+ *
550
+ * @param envOptions
551
+ * Configuration options for the environment.
552
+ *
553
+ * @returns
554
+ * The configuration entries to be added to the resulting configuration array.
555
+ */
556
+ declare function project(envOptions: EnvProjectOptions): ConfigArg;
557
+ //#endregion
558
+ //#region src/eslint/env/tsconfig.d.ts
559
+ /**
560
+ * Configuration options for the environment preset 'env.tsconfig'.
561
+ */
562
+ interface EnvTSConfigOptions extends EnvBaseOptions {
563
+ /**
564
+ * The path to the TypeScript project configuration file (`tsconfig.json`).
565
+ */
566
+ project: string;
567
+ }
568
+ /**
569
+ * Creates configuration objects for TypeScript projects.
570
+ *
571
+ * @param envOptions
572
+ * Configuration options for the environment.
573
+ *
574
+ * @returns
575
+ * The configuration entries to be added to the resulting configuration array.
576
+ */
577
+ declare function tsconfig(envOptions: EnvTSConfigOptions): ConfigArg;
578
+ //#endregion
579
+ //#region src/eslint/env/decorators.d.ts
580
+ /**
581
+ * Adds support for native decorators in JavaScript source files.
582
+ *
583
+ * Wraps the following packages:
584
+ * - `@babel/eslint-parser`
585
+ * - `@babel/plugin-proposal-decorators`
586
+ *
587
+ * @param envOptions
588
+ * Configuration options for the environment.
589
+ *
590
+ * @returns
591
+ * The configuration entries to be added to the resulting configuration array.
592
+ */
593
+ declare function decorators(envOptions: EnvBaseOptions): ConfigArg;
594
+ //#endregion
595
+ //#region src/eslint/index.d.ts
596
+ /**
597
+ * Configuration options for linting the entire project with ESLint.
598
+ */
599
+ interface ProjectOptions {
600
+ /**
601
+ * The URL of the project root containing the ESLint configuration file.
602
+ * Should usually be set to `import.meta.url`.
603
+ */
604
+ root: string;
605
+ /**
606
+ * Glob patterns with all files and folders to be ignored by ESLint.
607
+ */
608
+ ignores?: readonly string[];
609
+ /**
610
+ * Path to the template file containing the license header to be used in all
611
+ * source files. May be a path relative to the project root.
612
+ */
613
+ license?: string;
614
+ /**
615
+ * Configuration options for language and project setup.
616
+ */
617
+ language?: LanguageOptions;
618
+ /**
619
+ * Configuration options for external package dependencies.
620
+ */
621
+ packages?: PackagesOptions;
622
+ /**
623
+ * Configuration options for code style.
624
+ */
625
+ stylistic?: StylisticOptions;
626
+ /**
627
+ * Additional configuration options for Vue source files.
628
+ */
629
+ vue?: VueOptions;
630
+ /**
631
+ * Additional linter rules to be added to the global configuration.
632
+ */
633
+ rules?: RulesConfig;
634
+ }
635
+ /**
636
+ * A collection with all available environment presets.
637
+ */
638
+ declare const env: {
639
+ readonly node: typeof node;
640
+ readonly browser: typeof browser;
641
+ readonly jest: typeof jest;
642
+ readonly vitest: typeof vitest;
643
+ readonly codecept: typeof codecept;
644
+ readonly react: typeof react;
645
+ readonly eslint: typeof eslint;
646
+ readonly project: typeof project;
647
+ readonly tsconfig: typeof tsconfig;
648
+ readonly decorators: typeof decorators;
649
+ };
650
+ /**
651
+ * Generates a complete ESLint configuration array.
652
+ *
653
+ * @param options
654
+ * Options for the base configuration that will be generated.
655
+ *
656
+ * @param configs
657
+ * Additional configuration entries: Each parameter may be a callback function
658
+ * that will be invoked with a `PathResolver` utility.
659
+ *
660
+ * @returns
661
+ * The resulting ESLint configuration array that must be returned from the
662
+ * `eslint.config.*` file.
663
+ */
664
+ declare function defineConfig(options: ProjectOptions, ...configs: Array<ConfigArg | ((resolver: PathResolver) => ConfigArg)>): ConfigObject[];
665
+ //#endregion
666
+ export { type ConfigObject, type LanguageOptions, type PackagesOptions, ProjectOptions, type RulesConfig, type StylisticOptions, type VueOptions, defineConfig, env };
667
+ //# sourceMappingURL=index.d.mts.map