@wowlab/eslint-config 0.1.1 → 0.1.2

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.
@@ -1,4 +1,5 @@
1
1
  import eslintReact from "@eslint-react/eslint-plugin";
2
+ import reactHooks from "eslint-plugin-react-hooks";
2
3
  import { typescript as typescriptPreset } from "./typescript.js";
3
4
  const JAVASCRIPT_FILES = ["**/*.{js,jsx,mjs,cjs}"];
4
5
  const TYPESCRIPT_FILES = ["**/*.{ts,tsx,mts,cts}"];
@@ -8,6 +9,7 @@ export function react({ files = JAVASCRIPT_FILES, tsconfigRootDir, typeChecked =
8
9
  : "recommended";
9
10
  const recommendedConfig = eslintReact.configs.recommended;
10
11
  const typescriptConfig = eslintReact.configs[typescriptConfigName];
12
+ const hooksConfig = reactHooks.configs.flat.recommended;
11
13
  const javascriptConfig = {
12
14
  ...recommendedConfig,
13
15
  files,
@@ -19,11 +21,17 @@ export function react({ files = JAVASCRIPT_FILES, tsconfigRootDir, typeChecked =
19
21
  },
20
22
  name: "wowlab/react/recommended",
21
23
  };
24
+ const javascriptHooksConfig = {
25
+ ...hooksConfig,
26
+ files,
27
+ name: "wowlab/react/hooks",
28
+ };
22
29
  if (!typescript && !typeChecked) {
23
- return [javascriptConfig];
30
+ return [javascriptConfig, javascriptHooksConfig];
24
31
  }
25
32
  return [
26
33
  javascriptConfig,
34
+ javascriptHooksConfig,
27
35
  ...typescriptPreset({
28
36
  files: typescriptFiles,
29
37
  tsconfigRootDir,
@@ -34,5 +42,10 @@ export function react({ files = JAVASCRIPT_FILES, tsconfigRootDir, typeChecked =
34
42
  files: typescriptFiles,
35
43
  name: `wowlab/react/typescript/${typescriptConfigName}`,
36
44
  },
45
+ {
46
+ ...hooksConfig,
47
+ files: typescriptFiles,
48
+ name: "wowlab/react/typescript/hooks",
49
+ },
37
50
  ];
38
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wowlab/eslint-config",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Composable ESLint flat configs for JavaScript and TypeScript",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -49,6 +49,7 @@
49
49
  "@stylistic/eslint-plugin": "^5.10.0",
50
50
  "@tanstack/eslint-plugin-query": "^5.100.14",
51
51
  "eslint-plugin-perfectionist": "^5.9.0",
52
+ "eslint-plugin-react-hooks": "^7.1.1",
52
53
  "eslint-plugin-sonarjs": "^4.0.3",
53
54
  "eslint-plugin-switch-case": "^4.0.0",
54
55
  "eslint-plugin-unicorn": "^64.0.0",