@fullstacksjs/eslint-config 13.5.0 → 13.6.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/README.md CHANGED
@@ -50,7 +50,7 @@ You can fine-tune module detection by overriding it, the `defineConfig` function
50
50
 
51
51
  ```typescript
52
52
  interface Options {
53
- react?: boolean; // controls react, react-hooks, jsx/a11y plugins
53
+ react?: boolean | { additionalEffectHooks?: string }; // controls react, react-hooks, jsx/a11y plugins
54
54
  typescript?: ParserOptions // https://typescript-eslint.io/packages/parser#configuration
55
55
  node?: boolean; // controls node plugin
56
56
  sort?: boolean; // controls perfectionist plugin
package/cjs/index.d.ts CHANGED
@@ -19,7 +19,7 @@ export interface Options extends Linter.Config {
19
19
  * Controls React plugin.
20
20
  * @default true - If you have `react` or `react-dom` in your dependencies.
21
21
  */
22
- react?: boolean;
22
+ react?: boolean | { additionalEffectHooks?: string };
23
23
  /**
24
24
  * @default true
25
25
  */
@@ -9,7 +9,7 @@ var _eslintPluginJsxA11y = _interopRequireDefault(require("eslint-plugin-jsx-a11
9
9
  var _eslintPluginReactHooks = _interopRequireDefault(require("eslint-plugin-react-hooks"));
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  /** @return { import('eslint').Linter.Config } */
12
- function react() {
12
+ function react(options = {}) {
13
13
  return {
14
14
  plugins: {
15
15
  ..._eslintPlugin.default.configs.all.plugins,
@@ -17,9 +17,12 @@ function react() {
17
17
  'jsx-a11y': _eslintPluginJsxA11y.default
18
18
  },
19
19
  settings: {
20
- react: {
20
+ 'react': {
21
21
  pragma: 'React',
22
22
  version: 'detect'
23
+ },
24
+ 'react-hooks': {
25
+ additionalEffectHooks: options.react.additionalEffectHooks
23
26
  }
24
27
  },
25
28
  rules: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullstacksjs/eslint-config",
3
- "version": "13.5.0",
3
+ "version": "13.6.0",
4
4
  "license": "MIT",
5
5
  "author": "fullstacks <fullstacksjs@gmail.com>",
6
6
  "description": "fullstacks eslint config",
@@ -35,7 +35,7 @@
35
35
  }
36
36
  },
37
37
  "dependencies": {
38
- "@eslint-react/eslint-plugin": "2.0.0",
38
+ "@eslint-react/eslint-plugin": "2.0.6",
39
39
  "@eslint/compat": "1.4.0",
40
40
  "@next/eslint-plugin-next": "15.5.4",
41
41
  "@stylistic/eslint-plugin": "5.4.0",
@@ -51,7 +51,7 @@
51
51
  "eslint-plugin-playwright": "2.2.2",
52
52
  "eslint-plugin-prettier": "5.5.4",
53
53
  "eslint-plugin-promise": "7.2.1",
54
- "eslint-plugin-react-hooks": "5.2.0",
54
+ "eslint-plugin-react-hooks": "6.1.1",
55
55
  "eslint-plugin-regexp": "2.10.0",
56
56
  "eslint-plugin-storybook": "0.12.0",
57
57
  "globals": "16.4.0",
package/src/index.d.ts CHANGED
@@ -19,7 +19,7 @@ export interface Options extends Linter.Config {
19
19
  * Controls React plugin.
20
20
  * @default true - If you have `react` or `react-dom` in your dependencies.
21
21
  */
22
- react?: boolean;
22
+ react?: boolean | { additionalEffectHooks?: string };
23
23
  /**
24
24
  * @default true
25
25
  */
@@ -3,7 +3,7 @@ import a11yPlugin from 'eslint-plugin-jsx-a11y';
3
3
  import hooksPlugin from 'eslint-plugin-react-hooks';
4
4
 
5
5
  /** @return { import('eslint').Linter.Config } */
6
- function react() {
6
+ function react(options = {}) {
7
7
  return {
8
8
  plugins: {
9
9
  ...reactPlugin.configs.all.plugins,
@@ -11,10 +11,13 @@ function react() {
11
11
  'jsx-a11y': a11yPlugin,
12
12
  },
13
13
  settings: {
14
- react: {
14
+ 'react': {
15
15
  pragma: 'React',
16
16
  version: 'detect',
17
17
  },
18
+ 'react-hooks': {
19
+ additionalEffectHooks: options.react.additionalEffectHooks,
20
+ },
18
21
  },
19
22
  rules: {
20
23
  '@eslint-react/dom/no-void-elements-with-children': 'warn',