@open-xchange/linter-presets 1.10.0 → 1.11.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,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## `1.11.1` – 2025-Oct-06
4
+
5
+ - changed: (ESLint) JSDoc: do not check `@returns` in async void functions
6
+
7
+ ## `1.11.0` – 2025-Oct-03
8
+
9
+ - added: (ESLint) new option "effectHooks" for `env.react`
10
+
3
11
  ## `1.10.0` – 2025-Oct-02
4
12
 
5
13
  - chore: (ESLint) bump `@eslint-react/eslint-plugin` to v2
@@ -63,7 +63,6 @@ export default function jsdoc() {
63
63
  "jsdoc/escape-inline-tags": "error",
64
64
  "jsdoc/require-asterisk-prefix": "error",
65
65
  "jsdoc/require-jsdoc": ["error", { contexts: ["ClassDeclaration", "TSInterfaceDeclaration"] }],
66
- "jsdoc/require-returns-check": ["error", { exemptAsync: false }],
67
66
  "jsdoc/require-template": ["error", { requireSeparateTemplates: true }],
68
67
  "jsdoc/require-template-description": "error",
69
68
  "jsdoc/require-throws": "error",
@@ -3,6 +3,12 @@ import type { ConfigWithExtendsArg, EnvBaseOptions } from "../shared/env-utils.j
3
3
  * Configuration options for the environment preset "env.react".
4
4
  */
5
5
  export interface EnvReactOptions extends EnvBaseOptions {
6
+ /**
7
+ * Configuration for the rule "react-hooks/rules-of-hooks".
8
+ *
9
+ * Additional hooks that will be treated as effect hooks, like "useEffect".
10
+ */
11
+ effectHooks?: readonly string[];
6
12
  /**
7
13
  * Configuration for the rule "react-hooks-static-deps/exhaustive-deps".
8
14
  *
@@ -34,6 +34,15 @@ export default function react(envOptions) {
34
34
  },
35
35
  // register rule implementations and language settings, raise all recommended rules to "error" level
36
36
  ...convertRuleWarningsToErrors(reactPlugin.configs["recommended-type-checked"]),
37
+ // additional settings
38
+ settings: {
39
+ ...reactPlugin.configs["recommended-type-checked"].settings,
40
+ ...(envOptions.effectHooks?.length ? {
41
+ "react-hooks": {
42
+ additionalEffectHooks: `^(${envOptions.effectHooks.join("|")})$`,
43
+ },
44
+ } : undefined),
45
+ },
37
46
  }, {
38
47
  // custom overrides
39
48
  "@eslint-react/jsx-no-iife": "error",
@@ -22,6 +22,9 @@ function react(options: EnvReactOptions): Linter.Config[];
22
22
  | `files` | `Array<string\|string[]>` | _required_ | Glob patterns for source files to be included. Use embedded arrays for AND patterns. |
23
23
  | `ignores` | `string[]` | `[]` | Glob patterns for source files matching `files` to be ignored. |
24
24
  | `rules` | `Linter.RulesRecord` | `{}` | Additional linter rules to be added to the configuration. |
25
+ | `effectHooks` | `string[]` | `[]` | Additional hooks that will be treated as effect hooks, like "useEffect". |
26
+ | `additionalHooks` | `Record<string,number>` | `{}` | Additional hooks that will be checked for dependencies. |
27
+ | `staticHooks` | `Record<string,boolean\|boolean[]\|Record<string,boolean>>` | `{}` | Additional hooks that return stable values. |
25
28
 
26
29
  ## Example
27
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-xchange/linter-presets",
3
- "version": "1.10.0",
3
+ "version": "1.11.1",
4
4
  "description": "Configuration presets for ESLint and StyleLint",
5
5
  "repository": {
6
6
  "type": "git",