@open-xchange/linter-presets 1.30.6 → 1.31.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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [Unreleased]
4
+
5
+ ## [1.31.0] - 2026-10-05
6
+
7
+ - changed: (ESLint) disable all rules of `eslint-plugin-react-hooks` that are also implemented in `@eslint-react/eslint-plugin`, using the configuration `disable-conflict-eslint-plugin-react-hooks` of that plugin; enable rule `@eslint-react/globals`
8
+ - changed: (StyleLint) pass extension and plugin packages as absolute paths resolved with `import.meta.resolve()` instead of importing all packages eagerly and replacing them in the configuration
9
+ - fixed: (ESLint) re-enable rule `@typescript-eslint/no-unnecessary-type-arguments` (the bug in `typescript-eslint` has been fixed upstream)
10
+
11
+ ## [1.30.7] - 2026-10-01
12
+
13
+ - chore: plain https repository URL, so that Renovate shows links and release notes in merge requests
14
+ - chore: bump dependencies
15
+
3
16
  ## [1.30.6] - 2026-09-30
4
17
 
5
18
  - chore: bump dependencies
@@ -929,5 +942,8 @@
929
942
  - added: (ESLint) project configuration (core, js, ts, json, yaml, license, directives, promises, jsdoc, stylistic)
930
943
  - added: (ESLint) environment presets (tsconfig, node, browser, jest, vitest, codecept, react, plugin)
931
944
 
945
+ [Unreleased]: https://gitlab.com/openxchange/appsuite/documents/commons/plugins/-/compare/linter-presets-1.31.0...main
946
+ [1.31.0]: https://gitlab.com/openxchange/appsuite/documents/commons/plugins/-/compare/linter-presets-1.30.7...linter-presets-1.31.0
947
+ [1.30.7]: https://gitlab.com/openxchange/appsuite/documents/commons/plugins/-/compare/linter-presets-1.30.6...linter-presets-1.30.7
932
948
  [1.30.6]: https://gitlab.com/openxchange/appsuite/documents/commons/plugins/-/compare/linter-presets-1.30.5...linter-presets-1.30.6
933
949
  [1.30.5]: https://gitlab.com/openxchange/appsuite/documents/commons/plugins/-/compare/linter-presets-1.30.4...linter-presets-1.30.5
package/README.md CHANGED
@@ -41,7 +41,7 @@ The module `stylelint` exports a `defineConfig` function for setting up the enti
41
41
  _Usage example:_
42
42
 
43
43
  ```ts
44
- // stylelint.config.js
44
+ // stylelint.config.ts
45
45
  import { defineConfig } from '@open-xchange/linter-presets/stylelint'
46
46
 
47
47
  export default defineConfig({
@@ -12,6 +12,8 @@ declare class PathResolver {
12
12
  #private;
13
13
  constructor(url: string);
14
14
  /**
15
+ * Returns the directory path of the URL passed to the constructor.
16
+ *
15
17
  * @returns
16
18
  * The directory path of the URL passed to the constructor.
17
19
  */
@@ -47,8 +49,8 @@ interface LanguageOptions {
47
49
  /**
48
50
  * Specifies how to treat `.js`, `.jsx`, `.ts`, and `.tsx` files.
49
51
  *
50
- * - 'module': The files will be considered being ES modules.
51
- * - 'commonjs': The files will be considered being CommonJS modules.
52
+ * - 'module': The files will be parsed as ES modules.
53
+ * - 'commonjs': The files will be parsed as CommonJS modules.
52
54
  *
53
55
  * @default 'module'
54
56
  */
@@ -105,9 +107,7 @@ interface StylisticOptions {
105
107
  indent?: number;
106
108
  /**
107
109
  * Indentation (number of space characters) overrides for specific file
108
- * types.
109
- *
110
- * @default 2
110
+ * types. Each file type defaults to the value of `indent`.
111
111
  */
112
112
  indentOverrides?: IndentOverridesOptions;
113
113
  /**
@@ -125,7 +125,7 @@ interface StylisticOptions {
125
125
  /**
126
126
  * The type of the string delimiter character.
127
127
  *
128
- * Affects rule `@stylistic/string-quotes`.
128
+ * Affects rule `@stylistic/quotes`.
129
129
  *
130
130
  * @default 'single'
131
131
  */
@@ -148,12 +148,12 @@ interface StylisticOptions {
148
148
  * Specifies whether to expect whitespace between function names and
149
149
  * parentheses. Does not affect anonymous functions and `catch` clauses.
150
150
  *
151
- * Affects rule `@stylistic/space-before-function-paren`.
152
- *
153
151
  * - 'always': Spacing between function name and parenthesis required.
154
152
  * - 'never': Spacing between function name and parenthesis forbidden.
155
153
  * - 'off': Spacing between function name and parenthesis will be ignored.
156
154
  *
155
+ * Affects rule `@stylistic/space-before-function-paren`.
156
+ *
157
157
  * @default 'off'
158
158
  */
159
159
  funcSpacing?: 'always' | 'never' | 'off';
@@ -164,7 +164,7 @@ interface StylisticOptions {
164
164
  interface EnvFilesOptions {
165
165
  /**
166
166
  * Path to a sub directory to apply the environment preset to. The options
167
- * 'files' and 'ignores' will be interpreted relatively to this path.
167
+ * 'files' and 'ignores' will be interpreted relative to this path.
168
168
  *
169
169
  * @default '.'
170
170
  */
@@ -358,14 +358,14 @@ declare function browser(envOptions: EnvBrowserOptions): ConfigArg;
358
358
  interface EnvUnitTestOptions extends EnvBaseOptions {
359
359
  /**
360
360
  * Specifies whether to include `eslint-plugin-jest-extended`. Should only be
361
- * used, if the package `jest-extended` has been installed in the project.
361
+ * used if the package `jest-extended` has been installed in the project.
362
362
  *
363
363
  * @default false
364
364
  */
365
365
  jestExtended?: boolean;
366
366
  /**
367
367
  * Specifies whether to include `eslint-plugin-jest-dom`. Should only be
368
- * used, if the package `@testing-library/jest-dom` has been installed in the
368
+ * used if the package `@testing-library/jest-dom` has been installed in the
369
369
  * project.
370
370
  *
371
371
  * @default false
@@ -411,7 +411,7 @@ interface EnvVitestOptions extends EnvUnitTestOptions {}
411
411
  * tests using Vitest.
412
412
  *
413
413
  * Wraps the following packages:
414
- * - `eslint-plugin-vitest`
414
+ * - `@vitest/eslint-plugin`
415
415
  * - `eslint-plugin-jest-extended`
416
416
  * - `eslint-plugin-jest-dom`
417
417
  * - `eslint-plugin-testing-library`
@@ -453,7 +453,7 @@ interface EnvReactOptions extends EnvBaseOptions {
453
453
  /**
454
454
  * Additional hooks that will be treated as state hooks, like 'useState'.
455
455
  *
456
- * Will be used by the rule '@eslint-react/set-state-in-effect'.
456
+ * Will be used by the rule '@eslint-react/set-state-in-effect' and others.
457
457
  */
458
458
  stateHooks?: readonly string[];
459
459
  /**
@@ -467,7 +467,7 @@ interface EnvReactOptions extends EnvBaseOptions {
467
467
  /**
468
468
  * Additional hooks that will be treated as effect hooks, like 'useEffect'.
469
469
  *
470
- * Will be used by the rule '@eslint-react/rules-of-hooks'.
470
+ * Will be used by the rule '@eslint-react/rules-of-hooks' and others.
471
471
  */
472
472
  effectHooks?: readonly string[];
473
473
  }
@@ -475,6 +475,7 @@ interface EnvReactOptions extends EnvBaseOptions {
475
475
  * Creates configuration objects with linter rules for ReactJS.
476
476
  *
477
477
  * Wraps the following packages:
478
+ * - `@eslint-react/kit`
478
479
  * - `@eslint-react/eslint-plugin`
479
480
  * - `eslint-plugin-react-hooks`
480
481
  * - `eslint-plugin-react-refresh`
@@ -524,7 +525,9 @@ interface SharedRuleSettings {
524
525
  */
525
526
  interface RuleNoInvalidModulesOptions {
526
527
  /**
527
- * Specifies glob patterns for external modules.
528
+ * Glob patterns for module names that are neither project source files nor
529
+ * installed packages, e.g. virtual modules of a bundler. Matching imports
530
+ * are accepted without further checks.
528
531
  */
529
532
  external?: string[];
530
533
  }
@@ -536,7 +539,9 @@ interface RuleNoInvalidModulesOptions {
536
539
  */
537
540
  interface RuleNoInvalidHierarchyPackage {
538
541
  /**
539
- * Glob patterns selecting all source files that are part of the package.
542
+ * Glob patterns matching the module names (project-relative paths without
543
+ * file extension, with alias prefix if configured) of all modules in the
544
+ * package.
540
545
  */
541
546
  files: string[];
542
547
  /**
@@ -547,9 +552,8 @@ interface RuleNoInvalidHierarchyPackage {
547
552
  /**
548
553
  * Set to `true` to mark an optional package that may be missing in an
549
554
  * installation. Such a package cannot be imported statically (with `import`
550
- * statement) from a non-optional package, but can only be loaded dynamically
551
- * at runtime (by calling `import()`). The rule will mark all static imports
552
- * of optional code as an error.
555
+ * statement) from any other package, but can only be loaded dynamically at
556
+ * runtime (by calling `import()`).
553
557
  *
554
558
  * @default false
555
559
  */
@@ -567,11 +571,13 @@ interface EnvProjectOptions extends EnvBaseOptions {
567
571
  */
568
572
  alias?: SharedRuleSettings['alias'];
569
573
  /**
570
- * Options to be passed to the rule 'env-project/no-invalid-modules'.
574
+ * Glob patterns for external modules, passed as option 'external' to the
575
+ * rule 'env-project/no-invalid-modules'.
571
576
  */
572
577
  external?: RuleNoInvalidModulesOptions['external'];
573
578
  /**
574
- * Options to be passed to the rule 'env-project/no-invalid-hierarchy'.
579
+ * Options to be passed to the rule 'env-project/no-invalid-hierarchy'. If
580
+ * omitted, the rule will be disabled.
575
581
  */
576
582
  hierarchy?: RuleNoInvalidHierarchyOptions;
577
583
  }
@@ -597,7 +603,8 @@ interface EnvTSConfigOptions extends EnvBaseOptions {
597
603
  project: string;
598
604
  }
599
605
  /**
600
- * Creates configuration objects for TypeScript projects.
606
+ * Binds type-aware linter rules to an explicit TypeScript project
607
+ * configuration file instead of the automatic project service.
601
608
  *
602
609
  * @param envOptions
603
610
  * Configuration options for the environment.
@@ -608,12 +615,15 @@ interface EnvTSConfigOptions extends EnvBaseOptions {
608
615
  declare function tsconfig(envOptions: EnvTSConfigOptions): ConfigArg;
609
616
  //#endregion
610
617
  //#region src/eslint/env/decorators.d.ts
618
+ /**
619
+ * Configuration options for the environment preset 'env.decorators'.
620
+ */
621
+ interface EnvDecoratorsOptions extends EnvBaseOptions {}
611
622
  /**
612
623
  * Adds support for native decorators in JavaScript source files.
613
624
  *
614
625
  * Wraps the following packages:
615
- * - `@babel/eslint-parser`
616
- * - `@babel/plugin-proposal-decorators`
626
+ * - `@babel/eslint-parser` with syntax plugin `decorators`
617
627
  *
618
628
  * @param envOptions
619
629
  * Configuration options for the environment.
@@ -621,7 +631,7 @@ declare function tsconfig(envOptions: EnvTSConfigOptions): ConfigArg;
621
631
  * @returns
622
632
  * The configuration entries to be added to the resulting configuration array.
623
633
  */
624
- declare function decorators(envOptions: EnvBaseOptions): ConfigArg;
634
+ declare function decorators(envOptions: EnvDecoratorsOptions): ConfigArg;
625
635
  //#endregion
626
636
  //#region src/eslint/index.d.ts
627
637
  /**
@@ -629,8 +639,8 @@ declare function decorators(envOptions: EnvBaseOptions): ConfigArg;
629
639
  */
630
640
  export interface ProjectOptions {
631
641
  /**
632
- * The URL of the project root containing the ESLint configuration file.
633
- * Should usually be set to `import.meta.url`.
642
+ * The URL of the ESLint configuration file in the project root. Should
643
+ * usually be set to `import.meta.url`.
634
644
  */
635
645
  root: string;
636
646
  /**
@@ -685,7 +695,7 @@ export declare const env: {
685
695
  * Options for the base configuration that will be generated.
686
696
  *
687
697
  * @param configs
688
- * Additional configuration entries: Each parameter may be a callback function
698
+ * Additional configuration entries. Each entry may be a callback function
689
699
  * that will be invoked with a `PathResolver` utility.
690
700
  *
691
701
  * @returns
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":["ConfigObject","RulesConfig"],"sources":["../../src/utils/resolver.ts","../../src/utils/utils.ts","../../src/eslint/shared/env-utils.ts","../../src/eslint/core/vue.ts","../../src/eslint/shared/restricted.ts","../../src/eslint/env/node.ts","../../src/eslint/env/browser.ts","../../src/eslint/shared/unittest.ts","../../src/eslint/env/jest.ts","../../src/eslint/env/vitest.ts","../../src/eslint/env/codecept.ts","../../src/eslint/env/react.ts","../../src/eslint/env/eslint.ts","../../src/eslint/shared/rule-utils.ts","../../src/eslint/rules/project/noInvalidModules.ts","../../src/eslint/rules/project/noInvalidHierarchy.ts","../../src/eslint/env/project.ts","../../src/eslint/env/tsconfig.ts","../../src/eslint/env/decorators.ts","../../src/eslint/index.ts"],"mappings":";;;;;;;;;;cASa;;EAKC,YAAA;;;;;MASR;;;;;;;;;;EAaJ,KAAK;;;;KC7BK,aAAa,KAAK,+BAA+B,cAAc,aAAa;;;KCK5E,SAASA,iBAAe,oBAAoB,OAAO,SAAS,SAAS,WAAW;KAEhF,YAAY,aAAa;;;;UAOpB;;;;;;EAOf,cAAc,OAAO;;;;;;;;;EAUrB;;;;;UAae;;;;;EAMf;;;;EAKA;;;;;UAae;;;;EAKf;;;;EAKA;;;;EAKA;;;;EAKA;;;;;UAMe;;;;;;;;;;EAWf;;;;;;;EAQA,kBAAkB;;;;;;;;;;;;EAalB;;;;;;;;EASA;;;;;;;;;;;;;;EAeA;;;;;;;;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;;;UCJe;;;;EAKf;;;;;EAMA;;;;;;;;;;EAWA;;KAKU,gCAAgC,eAAe;;;;;;UC1B1C,0BAA0B;;;;EAKzC,QAAQ;;;;EAKR,WAAW;;;;EAKX,YAAY;;;;;;;;;;;iBAcU,QAAQ,YAAY,oBAAoB;;;;;;UCjC/C,2BAA2B;;;;EAK1C;;;;;;;;;;;iBAcsB,SAAS,YAAY,qBAAqB;;;;;;;;;;;;;;;;iBCA1C,WAAW,YAAY,iBAAiB;;;;;;iBCc/C;;;;;EAMf;;;;EAKA;;;;;EAMA;;;;EAKA,WAAW;;;;EAKX,WAAW;;;;EAKX,YAAY;;;;EAKZ,MAAM;;;;EAKN,QAAQ;;;;;qBAQG;;;;;;;;;;;;;;;;;;;;;;;;;;wBA6BG,aAAa,SAAS,mBAAmB,SAAS,MAAM,cAAc,UAAU,iBAAiB,cAAc"}
1
+ {"version":3,"file":"index.d.mts","names":["ConfigObject","RulesConfig"],"sources":["../../src/utils/resolver.ts","../../src/utils/utils.ts","../../src/eslint/shared/env-utils.ts","../../src/eslint/core/vue.ts","../../src/eslint/shared/restricted.ts","../../src/eslint/env/node.ts","../../src/eslint/env/browser.ts","../../src/eslint/shared/unittest.ts","../../src/eslint/env/jest.ts","../../src/eslint/env/vitest.ts","../../src/eslint/env/codecept.ts","../../src/eslint/env/react.ts","../../src/eslint/env/eslint.ts","../../src/eslint/shared/rule-utils.ts","../../src/eslint/rules/project/noInvalidModules.ts","../../src/eslint/rules/project/noInvalidHierarchy.ts","../../src/eslint/env/project.ts","../../src/eslint/env/tsconfig.ts","../../src/eslint/env/decorators.ts","../../src/eslint/index.ts"],"mappings":";;;;;;;;;;cASa;;EAKC,YAAA;;;;;;;MAWR;;;;;;;;;;EAaJ,KAAK;;;;KC/BK,aAAa,KAAK,+BAA+B,cAAc,aAAa;;;KCK5E,SAASA,iBAAe,oBAAoB,OAAO,SAAS,SAAS,WAAW;KAEhF,YAAY,aAAa;;;;UAOpB;;;;;;EAOf,cAAc,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;;;EAOvC;;;;;;;;EASA;;;;;;EAOA;;;;;;;;;;;;;;;;;;iBAqBsB,MAAM,YAAY,kBAAkB;;;;;;UCpD3C,yBAAyB;;;;;;;;;;;;;iBAgBlB,OAAO,YAAY,mBAAmB;;;;;;UCT7C;;;;EAKf,QAAQ;;;;;;;UCZO;;;;;;EAOf;;;;;;;;UCNe;;;;;;EAOf;;;;;EAMA;;;;;;;;;EAUA;;KAKU,gCAAgC,eAAe;;;;;;UC3B1C,0BAA0B;;;;EAKzC,QAAQ;;;;;EAMR,WAAW;;;;;EAMX,YAAY;;;;;;;;;;;iBAcU,QAAQ,YAAY,oBAAoB;;;;;;UCnC/C,2BAA2B;;;;EAK1C;;;;;;;;;;;;iBAesB,SAAS,YAAY,qBAAqB;;;;;;UClBjD,6BAA6B;;;;;;;;;;;;;iBAgBtB,WAAW,YAAY,uBAAuB;;;;;;iBCerD;;;;;EAMf;;;;EAKA;;;;;EAMA;;;;EAKA,WAAW;;;;EAKX,WAAW;;;;EAKX,YAAY;;;;EAKZ,MAAM;;;;EAKN,QAAQ;;;;;qBAQG;;;;;;;;;;;;;;;;;;;;;;;;;;wBA6BG,aAAa,SAAS,mBAAmB,SAAS,MAAM,cAAc,UAAU,iBAAiB,cAAc"}
@@ -1,4 +1,4 @@
1
- import { t as PathResolver } from "../resolver-Nkg5OKUN.mjs";
1
+ import { t as PathResolver } from "../resolver-CKKbaGEf.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import { defineConfig as defineConfig$1, globalIgnores } from "@eslint/config-helpers";
4
4
  import { dirname, extname, posix, sep } from "node:path";
@@ -67,7 +67,7 @@ function* yieldDeepArrays(...arrays) {
67
67
  * The deeply nested arrays to be flattened.
68
68
  *
69
69
  * @returns
70
- * The flattened array elements.
70
+ * A flat array with all truthy elements.
71
71
  */
72
72
  function flattenDeepArrays(...arrays) {
73
73
  return [...yieldDeepArrays(...arrays)];
@@ -136,14 +136,14 @@ const NO_IMPLICIT_COERCION_OPTIONS = {
136
136
  allow: ["!!"]
137
137
  };
138
138
  /**
139
- * Creates a glob pattern deeply matching all files with the specified file
139
+ * Creates glob patterns deeply matching all files with the specified file
140
140
  * extensions.
141
141
  *
142
142
  * @param extensions
143
- * The file extensions to be converted to a glob pattern.
143
+ * The file extensions to be converted to glob patterns.
144
144
  *
145
145
  * @returns
146
- * The glob pattern for the specified file extensions.
146
+ * The glob patterns for the specified file extensions.
147
147
  */
148
148
  function extGlob(extensions) {
149
149
  return extensions.map((ext) => "**/*." + ext);
@@ -195,12 +195,12 @@ function createConfig(name, envOptions, config, rules) {
195
195
  *
196
196
  * @param rules
197
197
  * Hard-coded rule settings to be configured by the environment itself. These
198
- * rule settings will precede the rules contained in 'envOptions', in order to
199
- * allow to override them.
198
+ * rule settings will precede the rules contained in 'envOptions', so that the
199
+ * rules in 'envOptions' can override them.
200
200
  *
201
201
  * @returns
202
- * The resulting configuration entry, if the environment options contain
203
- * custom rule settings, otherwise `undefined`.
202
+ * The resulting configuration entry, if `rules` or the environment options
203
+ * contain rule settings, otherwise `undefined`.
204
204
  */
205
205
  function customRules(name, envOptions, rules) {
206
206
  return (rules ?? envOptions.rules) && createConfig(name, envOptions, { rules: {
@@ -217,7 +217,7 @@ function customRules(name, envOptions, rules) {
217
217
  * The configuration objects to be fixed.
218
218
  *
219
219
  * @returns
220
- * The fixed configuration options.
220
+ * The fixed configuration objects.
221
221
  */
222
222
  function fixMissingFilesOption(...configs) {
223
223
  const flatConfigs = flattenDeepArrays(configs);
@@ -228,8 +228,8 @@ function fixMissingFilesOption(...configs) {
228
228
  } : config) : flatConfigs;
229
229
  }
230
230
  /**
231
- * Converts severity 'warning' of all rules in the passed configuration entry
232
- * to severity 'error'.
231
+ * Converts severity 'warn' of all rules in the passed configuration entry to
232
+ * severity 'error'.
233
233
  *
234
234
  * @template T
235
235
  * The exact type of the passed configuration.
@@ -320,7 +320,7 @@ function createRulesConfig(generator) {
320
320
  * The custom items for restricted rules to be merged.
321
321
  *
322
322
  * @returns
323
- * The rules dictionary with all needed restricted rules.
323
+ * The merged item lists.
324
324
  */
325
325
  function mergeRestrictedItems(...restrictedItems) {
326
326
  return {
@@ -350,7 +350,7 @@ function builtinRestrictedRules() {
350
350
  return createRulesConfig((key) => items[key]);
351
351
  }
352
352
  /**
353
- * Generates various 'no-restricted-?' rules from the passed configuration.
353
+ * Generates various 'no-restricted-*' rules from the passed configuration.
354
354
  *
355
355
  * @param baseName
356
356
  * Base name for the configuration objects.
@@ -521,7 +521,7 @@ function js() {
521
521
  //#endregion
522
522
  //#region src/eslint/core/ts.ts
523
523
  /**
524
- * Names of all `typescript-eslint` presets to be included
524
+ * Names of all `typescript-eslint` presets to be included.
525
525
  */
526
526
  const TSESLINT_PRESETS = ["strictTypeChecked", "stylisticTypeChecked"];
527
527
  /**
@@ -562,7 +562,6 @@ const TSESLINT_RULES = {
562
562
  "@typescript-eslint/no-redeclare": "error",
563
563
  "@typescript-eslint/no-shadow": ["error", { ignoreOnInitialization: true }],
564
564
  "@typescript-eslint/no-unnecessary-qualifier": "error",
565
- "@typescript-eslint/no-unnecessary-type-arguments": "off",
566
565
  "@typescript-eslint/no-unnecessary-type-conversion": "error",
567
566
  "@typescript-eslint/no-unnecessary-type-parameters": "off",
568
567
  "@typescript-eslint/no-unsafe-declaration-merging": "off",
@@ -640,7 +639,7 @@ function ts(rootDir) {
640
639
  * Resolved stylistic configuration options.
641
640
  *
642
641
  * @param vueOptions
643
- * Additional configuration for Vue specific rules.
642
+ * Additional configuration for Vue-specific rules.
644
643
  *
645
644
  * @returns
646
645
  * The configuration entries to be added to the resulting configuration array.
@@ -839,7 +838,7 @@ function license(path) {
839
838
  * Checks inline linter directives.
840
839
  *
841
840
  * Wraps the following packages:
842
- * - `eslint-plugin-eslint-comments`
841
+ * - `@eslint-community/eslint-plugin-eslint-comments`
843
842
  *
844
843
  * @returns
845
844
  * The configuration entries to be added to the resulting configuration array.
@@ -1263,7 +1262,8 @@ function browser(envOptions) {
1263
1262
  //#region src/eslint/shared/unittest.ts
1264
1263
  /**
1265
1264
  * Conditionally creates configuration entries for the ESLint plugins
1266
- * `eslint-plugin-jest-dom` and `eslint-plugin-testing-library`.
1265
+ * `eslint-plugin-jest-extended`, `eslint-plugin-jest-dom` and
1266
+ * `eslint-plugin-testing-library`, and relaxes JSDoc rules for test files.
1267
1267
  *
1268
1268
  * @param baseName
1269
1269
  * The base name for all configuration entries.
@@ -1354,7 +1354,7 @@ function jest(envOptions) {
1354
1354
  * tests using Vitest.
1355
1355
  *
1356
1356
  * Wraps the following packages:
1357
- * - `eslint-plugin-vitest`
1357
+ * - `@vitest/eslint-plugin`
1358
1358
  * - `eslint-plugin-jest-extended`
1359
1359
  * - `eslint-plugin-jest-dom`
1360
1360
  * - `eslint-plugin-testing-library`
@@ -1508,7 +1508,7 @@ const Schema = {
1508
1508
  }
1509
1509
  };
1510
1510
  /**
1511
- * Returns whether the passed AST node is an `Identifier `node.
1511
+ * Returns whether the passed AST node is an `Identifier` node.
1512
1512
  *
1513
1513
  * @param node
1514
1514
  * The AST node to be checked.
@@ -1542,7 +1542,7 @@ function isLiteral(node) {
1542
1542
  * The expected literal value.
1543
1543
  *
1544
1544
  * @returns
1545
- * Whether the passed AST node is a `Literal` node with a constant value.
1545
+ * Whether the passed AST node is a `Literal` node with the specified value.
1546
1546
  */
1547
1547
  function isLiteralValue(node, value) {
1548
1548
  return isLiteral(node) && node.value === value;
@@ -1610,20 +1610,16 @@ function toPosixPath(path) {
1610
1610
  * existing directories).
1611
1611
  */
1612
1612
  function isFile(path) {
1613
- try {
1614
- return lstatSync(path).isFile();
1615
- } catch {
1616
- return false;
1617
- }
1613
+ return lstatSync(path, { throwIfNoEntry: false })?.isFile() ?? false;
1618
1614
  }
1619
1615
  /**
1620
- * A wrapper for an `import` statement containing a string literal node with a
1621
- * module name, and the resulting extracted module name.
1616
+ * A wrapper for an `import` or `export` statement containing a string literal
1617
+ * node with a module name, and the resulting extracted module name.
1622
1618
  */
1623
1619
  var ImportNodeWrapper = class {
1624
1620
  /** The string literal node containing the name of the imported module. */
1625
1621
  sourceNode;
1626
- /** The original name of the imported module (with alias key). */
1622
+ /** The name of the imported module (with alias key, without query string). */
1627
1623
  moduleName;
1628
1624
  constructor(node) {
1629
1625
  this.sourceNode = node;
@@ -1647,9 +1643,6 @@ var ImportNodeWrapper = class {
1647
1643
  /**
1648
1644
  * A custom context helper for the linter rules of the preset environment
1649
1645
  * 'env.project'.
1650
- *
1651
- * @param context
1652
- * The rule context of the module currently linted.
1653
1646
  */
1654
1647
  var ProjectContext = class {
1655
1648
  /** Maps alias keys to alias paths. */
@@ -1662,6 +1655,13 @@ var ProjectContext = class {
1662
1655
  #moduleName;
1663
1656
  /** Resolver for npm packages. */
1664
1657
  #requireModule;
1658
+ /**
1659
+ * @param context
1660
+ * The rule context of the module currently linted.
1661
+ *
1662
+ * @throws {Error}
1663
+ * If the path of the linted module cannot be resolved.
1664
+ */
1665
1665
  constructor(context) {
1666
1666
  const sharedSettings = context.settings["env-project"];
1667
1667
  this.#aliasMap = new Map(Object.entries(sharedSettings?.alias ?? {}));
@@ -1690,7 +1690,8 @@ var ProjectContext = class {
1690
1690
  *
1691
1691
  * @returns
1692
1692
  * The string literal node containing the module name, and the resulting
1693
- * extracted module name.
1693
+ * extracted module name; or `undefined`, if the module name is not a string
1694
+ * literal.
1694
1695
  */
1695
1696
  resolveImportNode(node) {
1696
1697
  const sourceNodeRaw = node.type === AST_NODE_TYPES.TSExternalModuleReference ? node.expression : node.source;
@@ -1740,13 +1741,15 @@ var ProjectContext = class {
1740
1741
  return FILE_EXTENSIONS.some((ext) => isFile(resolvedPath + "." + ext));
1741
1742
  }
1742
1743
  /**
1743
- * Returns whether the passed module name is an installed npm package.
1744
+ * Returns whether the passed module name is an installed npm package, or a
1745
+ * built-in Node.js module.
1744
1746
  *
1745
1747
  * @param moduleName
1746
1748
  * The module name to be checked.
1747
1749
  *
1748
1750
  * @returns
1749
- * Whether the passed module name is an installed npm package.
1751
+ * Whether the passed module name is an installed npm package, or a built-in
1752
+ * Node.js module.
1750
1753
  */
1751
1754
  packageExists(moduleName) {
1752
1755
  this.#requireModule ??= createRequire(this.#configPath);
@@ -1813,6 +1816,7 @@ function preferDestructuringAssignment() {
1813
1816
  * Creates configuration objects with linter rules for ReactJS.
1814
1817
  *
1815
1818
  * Wraps the following packages:
1819
+ * - `@eslint-react/kit`
1816
1820
  * - `@eslint-react/eslint-plugin`
1817
1821
  * - `eslint-plugin-react-hooks`
1818
1822
  * - `eslint-plugin-react-refresh`
@@ -1840,6 +1844,7 @@ function react(envOptions) {
1840
1844
  settings
1841
1845
  }, {
1842
1846
  "@eslint-react/dom-no-unknown-property": "error",
1847
+ "@eslint-react/globals": "error",
1843
1848
  "@eslint-react/immutability": "error",
1844
1849
  "@eslint-react/jsx-no-leaked-dollar": "error",
1845
1850
  "@eslint-react/jsx-no-useless-fragment": ["error", { allowEmptyFragment: true }],
@@ -1848,15 +1853,8 @@ function react(envOptions) {
1848
1853
  "@eslint-react/no-missing-context-display-name": "error",
1849
1854
  "@eslint-react/refs": "error"
1850
1855
  }),
1851
- createConfig("env.react.recommended", envOptions, { extends: [reactKit().use(jsxShorthandBoolean).use(preferDestructuringAssignment).getConfig()] }),
1852
- createConfig("env.react.react-hooks", envOptions, convertRuleWarningsToErrors(reactHooksPlugin.configs.flat.recommended), {
1853
- "react-hooks/exhaustive-deps": "off",
1854
- "react-hooks/immutability": "off",
1855
- "react-hooks/refs": "off",
1856
- "react-hooks/rules-of-hooks": "off",
1857
- "react-hooks/set-state-in-effect": "off",
1858
- "react-hooks/set-state-in-render": "off"
1859
- }),
1856
+ createConfig("env.react.custom", envOptions, { extends: [reactKit().use(jsxShorthandBoolean).use(preferDestructuringAssignment).getConfig()] }),
1857
+ createConfig("env.react.react-hooks", envOptions, convertRuleWarningsToErrors(reactHooksPlugin.configs.flat.recommended), reactPlugin.configs["disable-conflict-eslint-plugin-react-hooks"].rules),
1860
1858
  createConfig("env.react.react-refresh", envOptions, reactRefresh.configs.vite()),
1861
1859
  createConfig("env.react.jsx-a11y", envOptions, jsxA11yPlugin.flatConfigs.recommended),
1862
1860
  customRules("env.react.rules", envOptions)
@@ -1890,8 +1888,7 @@ var noInvalidModules_default = ESLintUtils.RuleCreator.withoutDocs({
1890
1888
  meta: {
1891
1889
  type: "problem",
1892
1890
  schema: [Schema.options({ external: Schema.array(Schema.stringNE()) })],
1893
- messages: { SOURCE_FILE_NOT_FOUND: "Source file for `{{moduleName}}` not found." },
1894
- fixable: "code"
1891
+ messages: { SOURCE_FILE_NOT_FOUND: "Source file for `{{moduleName}}` not found." }
1895
1892
  },
1896
1893
  defaultOptions: [{ external: [] }],
1897
1894
  create(context, [options]) {
@@ -1924,8 +1921,7 @@ var noInvalidHierarchy_default = ESLintUtils.RuleCreator.withoutDocs({
1924
1921
  messages: {
1925
1922
  UNEXPECTED_OPTIONAL_STATIC: "Unexpected static import of optional package.",
1926
1923
  INVALID_PACKAGE_HIERARCHY: "Low-level package cannot import modules from higher-level package."
1927
- },
1928
- fixable: "code"
1924
+ }
1929
1925
  },
1930
1926
  defaultOptions: [{}],
1931
1927
  create(context, [options]) {
@@ -1994,7 +1990,8 @@ function project(envOptions) {
1994
1990
  //#endregion
1995
1991
  //#region src/eslint/env/tsconfig.ts
1996
1992
  /**
1997
- * Creates configuration objects for TypeScript projects.
1993
+ * Binds type-aware linter rules to an explicit TypeScript project
1994
+ * configuration file instead of the automatic project service.
1998
1995
  *
1999
1996
  * @param envOptions
2000
1997
  * Configuration options for the environment.
@@ -2014,8 +2011,7 @@ function tsconfig(envOptions) {
2014
2011
  * Adds support for native decorators in JavaScript source files.
2015
2012
  *
2016
2013
  * Wraps the following packages:
2017
- * - `@babel/eslint-parser`
2018
- * - `@babel/plugin-proposal-decorators`
2014
+ * - `@babel/eslint-parser` with syntax plugin `decorators`
2019
2015
  *
2020
2016
  * @param envOptions
2021
2017
  * Configuration options for the environment.
@@ -2024,7 +2020,7 @@ function tsconfig(envOptions) {
2024
2020
  * The configuration entries to be added to the resulting configuration array.
2025
2021
  */
2026
2022
  function decorators(envOptions) {
2027
- return [createConfig("core.decorators.babel", envOptions, {
2023
+ return [createConfig("env.decorators.babel", envOptions, {
2028
2024
  ignores: TS_GLOB,
2029
2025
  languageOptions: {
2030
2026
  parser: babelParser,
@@ -2037,7 +2033,7 @@ function decorators(envOptions) {
2037
2033
  }
2038
2034
  }
2039
2035
  }
2040
- }), customRules("core.decorators.rules", envOptions)];
2036
+ }), customRules("env.decorators.rules", envOptions)];
2041
2037
  }
2042
2038
  //#endregion
2043
2039
  //#region src/eslint/index.ts
@@ -2063,7 +2059,7 @@ const env = {
2063
2059
  * Options for the base configuration that will be generated.
2064
2060
  *
2065
2061
  * @param configs
2066
- * Additional configuration entries: Each parameter may be a callback function
2062
+ * Additional configuration entries. Each entry may be a callback function
2067
2063
  * that will be invoked with a `PathResolver` utility.
2068
2064
  *
2069
2065
  * @returns