@open-xchange/linter-presets 0.8.1 → 0.8.3

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,13 @@
1
1
  # Changelog
2
2
 
3
+ ## `0.8.3` – 2024-Sep-13
4
+
5
+ - chore: bump dependencies
6
+
7
+ ## `0.8.2` – 2024-Sep-09
8
+
9
+ - chore: bump dependencies
10
+
3
11
  ## `0.8.1` – 2024-Sep-04
4
12
 
5
13
  - change: (ESLint) relax a few strict rules of `@typescript-eslint`
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  import { type LanguageOptions } from "../shared/env-utils.js";
3
3
  /**
4
4
  * Defines standard module settings and additional rules targeting JavaScript
@@ -13,4 +13,4 @@ import { type LanguageOptions } from "../shared/env-utils.js";
13
13
  * @returns
14
14
  * An array of configuration objects to be added to the flat configuration.
15
15
  */
16
- export default function base(options: Required<LanguageOptions>): TSESLint.FlatConfig.ConfigArray;
16
+ export default function base(options: Required<LanguageOptions>): Linter.Config[];
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  /**
3
3
  * Checks inline linter directives.
4
4
  *
@@ -8,4 +8,4 @@ import type { TSESLint } from "@typescript-eslint/utils";
8
8
  * @returns
9
9
  * An array of configuration objects to be added to the flat configuration.
10
10
  */
11
- export default function directives(): TSESLint.FlatConfig.ConfigArray;
11
+ export default function directives(): Linter.Config[];
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  import type { LanguageOptions } from "../shared/env-utils.js";
3
3
  /**
4
4
  * Adds linter rules for `import` and `export` statements.
@@ -12,4 +12,4 @@ import type { LanguageOptions } from "../shared/env-utils.js";
12
12
  * @returns
13
13
  * An array of configuration objects to be added to the flat configuration.
14
14
  */
15
- export default function importConfig(options: Required<LanguageOptions>): TSESLint.FlatConfig.ConfigArray;
15
+ export default function importConfig(options: Required<LanguageOptions>): Linter.Config[];
@@ -41,12 +41,16 @@ export default function importConfig(options) {
41
41
  espree: jsExtensions,
42
42
  "@typescript-eslint/parser": tsExtensions,
43
43
  },
44
+ "import/resolver": {
45
+ typescript: true,
46
+ node: true,
47
+ },
44
48
  },
45
49
  // reconfigure plugin rules
46
50
  rules: {
47
51
  // recommended rules
48
- ...importPlugin.configs.recommended.rules,
49
- ...importPlugin.configs.typescript.rules,
52
+ ...importPlugin.flatConfigs.recommended.rules,
53
+ ...importPlugin.flatConfigs.typescript.rules,
50
54
  // change or disable a few recommended rules
51
55
  "import/default": "off",
52
56
  "import/no-duplicates": "error",
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  /**
3
3
  * Defines additional standard rules targeting JavaScript but _not_ TypeScript
4
4
  * source files.
@@ -6,4 +6,4 @@ import type { TSESLint } from "@typescript-eslint/utils";
6
6
  * @returns
7
7
  * An array of configuration objects to be added to the flat configuration.
8
8
  */
9
- export default function js(): TSESLint.FlatConfig.ConfigArray;
9
+ export default function js(): Linter.Config[];
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  /**
3
3
  * Checks the JSDoc comments in source files.
4
4
  *
@@ -8,4 +8,4 @@ import type { TSESLint } from "@typescript-eslint/utils";
8
8
  * @returns
9
9
  * An array of configuration objects to be added to the flat configuration.
10
10
  */
11
- export default function jsdoc(): TSESLint.FlatConfig.ConfigArray;
11
+ export default function jsdoc(): Linter.Config[];
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  import type { StylisticOptions } from "../shared/env-utils.js";
3
3
  /**
4
4
  * Defines standard linting rules for JSON files.
@@ -12,4 +12,4 @@ import type { StylisticOptions } from "../shared/env-utils.js";
12
12
  * @returns
13
13
  * An array of configuration objects to be added to the flat configuration.
14
14
  */
15
- export default function json(options: Required<StylisticOptions>): TSESLint.FlatConfig.ConfigArray;
15
+ export default function json(options: Required<StylisticOptions>): Linter.Config[];
@@ -27,6 +27,12 @@ export default function json(options) {
27
27
  "jsonc/no-octal-escape": "error",
28
28
  },
29
29
  },
30
+ {
31
+ files: ["**/tsconfig.json", "**/tsconfig.*.json"],
32
+ rules: {
33
+ "jsonc/no-comments": "off",
34
+ },
35
+ },
30
36
  ];
31
37
  // add missing "files" property in configurations with rules (otherwise, plugin conflicts with "@eslint/markdown")
32
38
  const files = configs.find(config => config.files)?.files;
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  /**
3
3
  * Checks the existence of license headers in source files.
4
4
  *
@@ -11,4 +11,4 @@ import type { TSESLint } from "@typescript-eslint/utils";
11
11
  * @returns
12
12
  * An array of configuration objects to be added to the flat configuration.
13
13
  */
14
- export default function license(path: string): TSESLint.FlatConfig.ConfigArray;
14
+ export default function license(path: string): Linter.Config[];
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  /**
3
3
  * Defines standard linting rules for Markdown files.
4
4
  *
@@ -8,4 +8,4 @@ import type { TSESLint } from "@typescript-eslint/utils";
8
8
  * @returns
9
9
  * An array of configuration objects to be added to the flat configuration.
10
10
  */
11
- export default function markdown(): TSESLint.FlatConfig.ConfigArray;
11
+ export default function markdown(): Linter.Config[];
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  /**
3
3
  * Checks for correct usage of native promises.
4
4
  *
@@ -8,4 +8,4 @@ import type { TSESLint } from "@typescript-eslint/utils";
8
8
  * @returns
9
9
  * An array of configuration objects to be added to the flat configuration.
10
10
  */
11
- export default function promises(): TSESLint.FlatConfig.ConfigArray;
11
+ export default function promises(): Linter.Config[];
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  import type { StylisticOptions } from "../shared/env-utils.js";
3
3
  /**
4
4
  * Defines standard (opinionated) linter rules for source code style.
@@ -13,4 +13,4 @@ import type { StylisticOptions } from "../shared/env-utils.js";
13
13
  * @returns
14
14
  * An array of configuration objects to be added to the flat configuration.
15
15
  */
16
- export default function stylistic(options: Required<StylisticOptions>): TSESLint.FlatConfig.ConfigArray;
16
+ export default function stylistic(options: Required<StylisticOptions>): Linter.Config[];
@@ -19,7 +19,7 @@ export default function stylistic(options) {
19
19
  const { indent, semi, quotes, dangle } = options;
20
20
  return [
21
21
  // globally disable all deprecated stylistic core rules
22
- stylisticPlugin.configs["disable-legacy"],
22
+ stylisticPlugin.configs["disable-legacy"], // outdated typings in plugin
23
23
  // "@stylistic" plugin
24
24
  {
25
25
  // do not lint markdown files
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  /**
3
3
  * Defines standard rules for TypeScript source files.
4
4
  *
@@ -8,4 +8,4 @@ import type { TSESLint } from "@typescript-eslint/utils";
8
8
  * @returns
9
9
  * An array of configuration objects to be added to the flat configuration.
10
10
  */
11
- export default function ts(): TSESLint.FlatConfig.ConfigArray;
11
+ export default function ts(): Linter.Config[];
@@ -76,5 +76,5 @@ export default function ts() {
76
76
  "@typescript-eslint/consistent-type-imports": ["error", { prefer: "no-type-imports", disallowTypeAnnotations: false }],
77
77
  "@typescript-eslint/no-extraneous-class": "off",
78
78
  },
79
- });
79
+ }); // TODO: type incompatibility between Linter and TSESLint
80
80
  }
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  import type { StylisticOptions } from "../shared/env-utils.js";
3
3
  /**
4
4
  * Defines standard linting rules for YAML files.
@@ -12,4 +12,4 @@ import type { StylisticOptions } from "../shared/env-utils.js";
12
12
  * @returns
13
13
  * An array of configuration objects to be added to the flat configuration.
14
14
  */
15
- export default function yaml(options: Required<StylisticOptions>): TSESLint.FlatConfig.ConfigArray;
15
+ export default function yaml(options: Required<StylisticOptions>): Linter.Config[];
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  import type { EnvRestrictedOptions } from "../shared/restricted.js";
3
3
  /**
4
4
  * Configuration options for the environment preset "env.browser".
@@ -19,4 +19,4 @@ export interface EnvBrowserOptions extends EnvRestrictedOptions {
19
19
  * @returns
20
20
  * An array of configuration objects to be added to the flat configuration.
21
21
  */
22
- export default function browser(envOptions: EnvBrowserOptions): TSESLint.FlatConfig.ConfigArray;
22
+ export default function browser(envOptions: EnvBrowserOptions): Linter.Config[];
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  import type { EnvBaseOptions } from "../shared/env-utils.js";
3
3
  /**
4
4
  * Configuration options for the environment preset "env.codecept".
@@ -19,4 +19,4 @@ export interface EnvCodeceptOptions extends EnvBaseOptions {
19
19
  * @returns
20
20
  * An array of configuration objects to be added to the flat configuration.
21
21
  */
22
- export default function codecept(envOptions: EnvCodeceptOptions): TSESLint.FlatConfig.ConfigArray;
22
+ export default function codecept(envOptions: EnvCodeceptOptions): Linter.Config[];
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  import type { EnvBaseOptions } from "../shared/env-utils.js";
3
3
  /**
4
4
  * Configuration options for the environment preset "env.eslint".
@@ -17,4 +17,4 @@ export interface EnvEslintOptions extends EnvBaseOptions {
17
17
  * @returns
18
18
  * An array of configuration objects to be added to the flat configuration.
19
19
  */
20
- export default function eslint(envOptions: EnvEslintOptions): TSESLint.FlatConfig.ConfigArray;
20
+ export default function eslint(envOptions: EnvEslintOptions): Linter.Config[];
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  import { type EnvUnitTestOptions } from "../shared/unittest.js";
3
3
  /**
4
4
  * Configuration options for the environment preset "env.jest".
@@ -19,4 +19,4 @@ export interface EnvJestOptions extends EnvUnitTestOptions {
19
19
  * @returns
20
20
  * An array of configuration objects to be added to the flat configuration.
21
21
  */
22
- export default function jest(envOptions: EnvJestOptions): TSESLint.FlatConfig.ConfigArray;
22
+ export default function jest(envOptions: EnvJestOptions): Linter.Config[];
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  import type ts from "typescript";
3
3
  import type { LanguageOptions } from "../shared/env-utils.js";
4
4
  import { type EnvRestrictedOptions } from "../shared/restricted.js";
@@ -45,4 +45,4 @@ export interface EnvNodeOptions extends EnvRestrictedOptions {
45
45
  * @returns
46
46
  * An array of configuration objects to be added to the flat configuration.
47
47
  */
48
- export default function node(envOptions: EnvNodeOptions): TSESLint.FlatConfig.ConfigArray;
48
+ export default function node(envOptions: EnvNodeOptions): Linter.Config[];
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  import type { EnvBaseOptions } from "../shared/env-utils.js";
3
3
  import type { SharedRuleSettings } from "../shared/rule-utils.js";
4
4
  import { type RuleNoInvalidModulesOptions } from "../rules/no-invalid-modules.js";
@@ -29,4 +29,4 @@ export interface EnvProjectOptions extends EnvBaseOptions {
29
29
  * @returns
30
30
  * An array of configuration objects to be added to the flat configuration.
31
31
  */
32
- export default function project(envOptions: EnvProjectOptions): TSESLint.FlatConfig.ConfigArray;
32
+ export default function project(envOptions: EnvProjectOptions): Linter.Config[];
@@ -22,7 +22,7 @@ export default function project(envOptions) {
22
22
  "no-amd-module-directive": noAmdModuleDirective,
23
23
  "no-invalid-modules": noInvalidModules,
24
24
  "no-invalid-hierarchy": noInvalidHierarchy,
25
- },
25
+ }, // TODO
26
26
  },
27
27
  },
28
28
  settings: {
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  import { type EnvBaseOptions } from "../shared/env-utils.js";
3
3
  /**
4
4
  * Configuration options for the environment preset "env.react".
@@ -26,4 +26,4 @@ export interface EnvReactOptions extends EnvBaseOptions {
26
26
  * @returns
27
27
  * An array of configuration objects to be added to the flat configuration.
28
28
  */
29
- export default function react(envOptions: EnvReactOptions): TSESLint.FlatConfig.ConfigArray;
29
+ export default function react(envOptions: EnvReactOptions): Linter.Config[];
@@ -41,22 +41,29 @@ export default function react(envOptions) {
41
41
  // recommended rules
42
42
  ...reactPlugin.configs.flat.recommended.rules,
43
43
  ...reactPlugin.configs.flat["jsx-runtime"].rules,
44
+ // custom overrides
45
+ "react/hook-use-state": "error",
46
+ "react/iframe-missing-sandbox": "error",
47
+ "react/jsx-boolean-value": "error",
48
+ "react/jsx-no-script-url": "error",
49
+ "react/jsx-no-useless-fragment": "error",
50
+ "react/jsx-props-no-spread-multi": "error",
51
+ "react/no-danger": "error",
52
+ "react/no-invalid-html-attribute": "error",
53
+ "react/no-typos": "error",
54
+ "react/prop-types": ["error", { skipUndeclared: true }],
55
+ "react/style-prop-object": "error",
56
+ "react/void-dom-elements-no-children": "error",
44
57
  },
45
58
  }),
46
- // configure other plugins and rules for all source files (JSX and TSX)
59
+ // "react-hooks" plugin
47
60
  createConfig(envOptions, {
48
61
  // register rule implementations of the plugins
49
62
  plugins: {
50
63
  "react-hooks": reactHooksPlugin,
51
- "react-refresh": reactRefreshPlugin,
52
- "jsx-expressions": fixupPluginRules(jsxExpressionsPlugin), // https://github.com/hluisson/eslint-plugin-jsx-expressions/issues/18
53
- "jsx-a11y": jsxA11yPlugin,
54
64
  },
55
65
  // recommended rules
56
- rules: {
57
- ...reactHooksPlugin.configs.recommended.rules,
58
- ...jsxA11yPlugin.flatConfigs.recommended.rules,
59
- },
66
+ rules: reactHooksPlugin.configs.recommended.rules,
60
67
  }),
61
68
  // "react-hooks-static-deps" plugin
62
69
  envOptions.staticHooks && createConfig(envOptions, {
@@ -68,30 +75,30 @@ export default function react(envOptions) {
68
75
  "react-hooks-static-deps/exhaustive-deps": ["error", { staticHooks: envOptions.staticHooks }],
69
76
  },
70
77
  }),
71
- // additional rules for TSX only
78
+ // "react-refresh" plugin
79
+ createConfig(envOptions, {
80
+ // register rule implementations of the plugins
81
+ plugins: {
82
+ "react-refresh": reactRefreshPlugin,
83
+ },
84
+ rules: {
85
+ "react-refresh/only-export-components": ["error", { allowConstantExport: true }],
86
+ },
87
+ }),
88
+ // "jsx-expressions" plugin (TSX only)
72
89
  createConfig(envOptions, {
73
90
  ignores: JS_GLOB,
91
+ // register rule implementations of the plugins
92
+ plugins: {
93
+ "jsx-expressions": fixupPluginRules(jsxExpressionsPlugin), // https://github.com/hluisson/eslint-plugin-jsx-expressions/issues/18
94
+ },
74
95
  rules: {
75
96
  // replace "react/jsx-no-leaked-render" rule with advanced alternative
76
97
  "jsx-expressions/strict-logical-expressions": "error",
77
98
  },
78
99
  }),
100
+ // "jsx-a11y" plugin
101
+ createConfig(envOptions, jsxA11yPlugin.flatConfigs.recommended),
79
102
  // custom rules
80
- customRules(envOptions, {
81
- // "react" plugin
82
- "react/hook-use-state": "error",
83
- "react/iframe-missing-sandbox": "error",
84
- "react/jsx-boolean-value": "error",
85
- "react/jsx-no-script-url": "error",
86
- "react/jsx-no-useless-fragment": "error",
87
- "react/jsx-props-no-spread-multi": "error",
88
- "react/no-danger": "error",
89
- "react/no-invalid-html-attribute": "error",
90
- "react/no-typos": "error",
91
- "react/prop-types": ["error", { skipUndeclared: true }],
92
- "react/style-prop-object": "error",
93
- "react/void-dom-elements-no-children": "error",
94
- // "react-refresh" plugin
95
- "react-refresh/only-export-components": ["error", { allowConstantExport: true }],
96
- }));
103
+ customRules(envOptions));
97
104
  }
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  import type { EnvBaseOptions } from "../shared/env-utils.js";
3
3
  /**
4
4
  * Configuration options for the environment preset "env.tsconfig".
@@ -18,4 +18,4 @@ export interface EnvTSConfigOptions extends EnvBaseOptions {
18
18
  * @returns
19
19
  * An array of configuration objects to be added to the flat configuration.
20
20
  */
21
- export default function tsconfig(envOptions: EnvTSConfigOptions): TSESLint.FlatConfig.ConfigArray;
21
+ export default function tsconfig(envOptions: EnvTSConfigOptions): Linter.Config[];
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  import { type EnvUnitTestOptions } from "../shared/unittest.js";
3
3
  /**
4
4
  * Configuration options for the environment preset "env.vitest".
@@ -20,4 +20,4 @@ export interface EnvVitestOptions extends EnvUnitTestOptions {
20
20
  * @returns
21
21
  * An array of configuration objects to be added to the flat configuration.
22
22
  */
23
- export default function vitest(envOptions: EnvVitestOptions): TSESLint.FlatConfig.ConfigArray;
23
+ export default function vitest(envOptions: EnvVitestOptions): Linter.Config[];
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  import type { LanguageOptions, StylisticOptions } from "./shared/env-utils.js";
3
3
  import node from "./env/node.js";
4
4
  import browser from "./env/browser.js";
@@ -34,7 +34,7 @@ export interface ConfigureOptions {
34
34
  /**
35
35
  * Additional linter rules to be added to the global configuration.
36
36
  */
37
- rules?: TSESLint.FlatConfig.Rules;
37
+ rules?: Linter.RulesRecord;
38
38
  }
39
39
  /**
40
40
  * A collection with all available environment presets.
@@ -60,4 +60,4 @@ export declare const env: {
60
60
  * @returns
61
61
  * An array of configuration objects to be added to the flat configuration.
62
62
  */
63
- export declare function configure(options?: ConfigureOptions): TSESLint.FlatConfig.ConfigArray;
63
+ export declare function configure(options?: ConfigureOptions): Linter.Config[];
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  /**
3
3
  * Configuration options for language and project setup.
4
4
  */
@@ -7,7 +7,7 @@ export interface LanguageOptions {
7
7
  * The ECMAScript version to be used in the project (version or year).
8
8
  * Default value is `2022`.
9
9
  */
10
- ecmaVersion?: TSESLint.ParserOptions["ecmaVersion"];
10
+ ecmaVersion?: Linter.EcmaVersion;
11
11
  /**
12
12
  * Specifies how to treat `.js`, `.jsx`, `.ts`, and `.tsx` files.
13
13
  *
@@ -82,7 +82,7 @@ export interface EnvBaseOptions extends EnvFilesOptions {
82
82
  /**
83
83
  * Additional linter rules to be added to the configuration.
84
84
  */
85
- rules?: TSESLint.FlatConfig.Rules;
85
+ rules?: Linter.RulesRecord;
86
86
  }
87
87
  /**
88
88
  * File extensions for JavaScript source files.
@@ -158,7 +158,7 @@ export declare function flatArray<T>(...entries: Array<T | T[] | false | null |
158
158
  * @returns
159
159
  * The concatenated configuration array.
160
160
  */
161
- export declare const concatConfigs: (...entries: (false | TSESLint.FlatConfig.Config | TSESLint.FlatConfig.Config[] | null | undefined)[]) => TSESLint.FlatConfig.Config[];
161
+ export declare const concatConfigs: (...entries: (false | Linter.Config<Linter.RulesRecord> | Linter.Config<Linter.RulesRecord>[] | null | undefined)[]) => Linter.Config<Linter.RulesRecord>[];
162
162
  /**
163
163
  * Creates a flat configuration object with "files" and "ignores" settings from
164
164
  * an environment's "envOptions" object.
@@ -176,7 +176,7 @@ export declare const concatConfigs: (...entries: (false | TSESLint.FlatConfig.Co
176
176
  * @returns
177
177
  * The resulting flat configuration object.
178
178
  */
179
- export declare function createConfig(envOptions: EnvFilesOptions, flatConfig: TSESLint.FlatConfig.Config, rules?: TSESLint.FlatConfig.Rules): TSESLint.FlatConfig.Config;
179
+ export declare function createConfig(envOptions: EnvFilesOptions, flatConfig: Linter.Config, rules?: Linter.RulesRecord): Linter.Config;
180
180
  /**
181
181
  * Creates a flat configuration object with "files", "ignores", and "rules"
182
182
  * settings from an environment's "envOptions" object.
@@ -194,4 +194,4 @@ export declare function createConfig(envOptions: EnvFilesOptions, flatConfig: TS
194
194
  * The resulting flat configuration object, if the environment options contain
195
195
  * custom rule settings, otherwise `undefined`.
196
196
  */
197
- export declare function customRules(envOptions: EnvBaseOptions, rules?: TSESLint.FlatConfig.Rules): TSESLint.FlatConfig.Config | undefined;
197
+ export declare function customRules(envOptions: EnvBaseOptions, rules?: Linter.RulesRecord): Linter.Config | undefined;
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  import type { LanguageOptions, EnvFilesOptions, EnvBaseOptions } from "../shared/env-utils.js";
3
3
  /**
4
4
  * Configuration for a single banned global or import.
@@ -82,7 +82,7 @@ export interface EnvRestrictedOptions extends EnvBaseOptions {
82
82
  * @returns
83
83
  * The rules dictionary with all needed restricted rules.
84
84
  */
85
- export declare function builtinRestrictedRules(languageOptions: LanguageOptions): TSESLint.FlatConfig.Rules;
85
+ export declare function builtinRestrictedRules(languageOptions: LanguageOptions): Linter.RulesRecord;
86
86
  /**
87
87
  * Generates various "no-restricted-?" rules from the passed configuration.
88
88
  *
@@ -96,4 +96,4 @@ export declare function builtinRestrictedRules(languageOptions: LanguageOptions)
96
96
  * @returns
97
97
  * The flat configuration objects needed to forbid the restricted items.
98
98
  */
99
- export declare function restrictedRulesConfig(envOptions: EnvRestrictedOptions, fixed?: EnvRestrictedItems): TSESLint.FlatConfig.ConfigArray;
99
+ export declare function restrictedRulesConfig(envOptions: EnvRestrictedOptions, fixed?: EnvRestrictedItems): Linter.Config[];
@@ -1,4 +1,4 @@
1
- import type { TSESLint } from "@typescript-eslint/utils";
1
+ import type { Linter } from "eslint";
2
2
  import { type EnvBaseOptions } from "./env-utils.js";
3
3
  /**
4
4
  * Shared options for environment presets for unit tests.
@@ -26,4 +26,4 @@ export interface EnvUnitTestOptions extends EnvBaseOptions {
26
26
  * @returns
27
27
  * The resulting flat configuration objects.
28
28
  */
29
- export declare function createUnitTestPluginConfigs(envOptions: EnvUnitTestOptions): TSESLint.FlatConfig.ConfigArray;
29
+ export declare function createUnitTestPluginConfigs(envOptions: EnvUnitTestOptions): Linter.Config[];
@@ -25,7 +25,7 @@ export function createUnitTestPluginConfigs(envOptions) {
25
25
  },
26
26
  // recommended rules
27
27
  rules: {
28
- ...testingLibraryPlugin.configs.react.rules,
28
+ ...testingLibraryPlugin.configs["flat/react"].rules,
29
29
  "testing-library/no-node-access": ["error", { allowContainerFirstChild: true }],
30
30
  },
31
31
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-xchange/linter-presets",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "description": "Configuration presets for ESLint and StyleLint",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,27 +26,28 @@
26
26
  "@babel/plugin-proposal-decorators": "7.24.7",
27
27
  "@eslint-community/eslint-plugin-eslint-comments": "4.4.0",
28
28
  "@eslint/compat": "1.1.1",
29
- "@eslint/js": "9.9.1",
30
- "@eslint/markdown": "6.0.0",
29
+ "@eslint/js": "9.10.0",
30
+ "@eslint/markdown": "6.1.0",
31
31
  "@stylistic/eslint-plugin": "2.3.0",
32
32
  "@stylistic/eslint-plugin-migrate": "2.3.0",
33
33
  "@stylistic/stylelint-config": "2.0.0",
34
34
  "@stylistic/stylelint-plugin": "3.0.1",
35
35
  "confusing-browser-globals": "1.0.11",
36
+ "eslint-import-resolver-typescript": "3.6.3",
36
37
  "eslint-plugin-chai-expect": "3.1.0",
37
38
  "eslint-plugin-codeceptjs": "1.3.0",
38
39
  "eslint-plugin-eslint-plugin": "6.2.0",
39
- "eslint-plugin-import": "2.29.1",
40
- "eslint-plugin-jest": "28.8.1",
40
+ "eslint-plugin-import": "2.30.0",
41
+ "eslint-plugin-jest": "28.8.3",
41
42
  "eslint-plugin-jest-dom": "5.4.0",
42
43
  "eslint-plugin-jsdoc": "50.2.2",
43
44
  "eslint-plugin-jsonc": "2.16.0",
44
- "eslint-plugin-jsx-a11y": "6.9.0",
45
+ "eslint-plugin-jsx-a11y": "6.10.0",
45
46
  "eslint-plugin-jsx-expressions": "1.3.2",
46
47
  "eslint-plugin-license-header": "0.6.1",
47
48
  "eslint-plugin-n": "17.10.2",
48
49
  "eslint-plugin-promise": "7.1.0",
49
- "eslint-plugin-react": "7.35.0",
50
+ "eslint-plugin-react": "7.36.1",
50
51
  "eslint-plugin-react-hooks": "4.6.2",
51
52
  "eslint-plugin-react-hooks-static-deps": "1.0.7",
52
53
  "eslint-plugin-react-refresh": "0.4.11",
@@ -60,19 +61,19 @@
60
61
  "stylelint-config-standard-less": "3.0.1",
61
62
  "stylelint-config-standard-scss": "13.1.0",
62
63
  "stylelint-plugin-license-header": "1.0.3",
63
- "typescript-eslint": "8.3.0"
64
+ "typescript-eslint": "8.5.0"
64
65
  },
65
66
  "devDependencies": {
66
- "@eslint/core": "0.5.0",
67
+ "@eslint/core": "0.6.0",
67
68
  "@types/confusing-browser-globals": "1.0.3",
68
69
  "@types/eslint__js": "8.42.3",
69
70
  "@types/picomatch": "3.0.1",
70
- "@typescript-eslint/utils": "8.3.0",
71
- "eslint": "9.9.1",
71
+ "@typescript-eslint/utils": "8.5.0",
72
+ "eslint": "9.10.0",
72
73
  "jest": "29.7.0",
73
74
  "rimraf": "6.0.1",
74
75
  "stylelint": "16.9.0",
75
- "typescript": "5.5.4"
76
+ "typescript": "5.6.2"
76
77
  },
77
78
  "peerDependencies": {
78
79
  "eslint": "^9.8",