@abinnovision/eslint-config-react 2.1.0 → 2.2.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,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.2.0](https://github.com/abinnovision/js-commons/compare/eslint-config-react-v2.1.0...eslint-config-react-v2.2.0) (2024-10-16)
4
+
5
+
6
+ ### Features
7
+
8
+ * add eslint-plugin-react-hooks with recommended config ([#339](https://github.com/abinnovision/js-commons/issues/339)) ([6d0a2e0](https://github.com/abinnovision/js-commons/commit/6d0a2e0dd68c7a91d3b7a8c3b116ee31c3d7871e))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * automatically detect the react version ([#352](https://github.com/abinnovision/js-commons/issues/352)) ([2e3ea1a](https://github.com/abinnovision/js-commons/commit/2e3ea1aa6b3797606e2303f4b10fc28a75440ab3))
14
+ * migrate to Linter.Config type ([#340](https://github.com/abinnovision/js-commons/issues/340)) ([30a1c19](https://github.com/abinnovision/js-commons/commit/30a1c19c3a2f4c2b94e6086486951145b399e15d))
15
+ * only support eslint v9 ([#345](https://github.com/abinnovision/js-commons/issues/345)) ([7425fdc](https://github.com/abinnovision/js-commons/commit/7425fdc9c2d8912988697ab07b9a8f42d96786d4))
16
+ * use spaces for markdown files ([#349](https://github.com/abinnovision/js-commons/issues/349)) ([eeb8b33](https://github.com/abinnovision/js-commons/commit/eeb8b335916602b55ca02cfdea352bc296fa7ffb))
17
+
3
18
  ## [2.1.0](https://github.com/abinnovision/js-commons/compare/eslint-config-react-v2.0.0...eslint-config-react-v2.1.0) (2024-08-05)
4
19
 
5
20
 
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # @abinnovision/eslint-config-react
2
2
 
3
- ESLint config specifically for React related projects. This config **must
4
- be used in conjunction with
5
- the [@abinnovision/eslint-config-base](https://github.com/abinnovision/js-commons/tree/master/packages/eslint-config-base)
6
- ESLint config**. This config is based on
7
- the [AlloyTeam ESLint Config](https://github.com/AlloyTeam/eslint-config-alloy)
8
- with some additional goodies on top.
3
+ ESLint config specifically for React related projects. This config **must be
4
+ used in conjunction with the
5
+ [@abinnovision/eslint-config-base](https://github.com/abinnovision/js-commons/tree/master/packages/eslint-config-base)
6
+ ESLint config**. This config is based on the
7
+ [AlloyTeam ESLint Config](https://github.com/AlloyTeam/eslint-config-alloy) with
8
+ some additional goodies on top.
9
9
 
10
10
  ## Installation
11
11
 
package/dist/index.cjs CHANGED
@@ -35,14 +35,29 @@ __export(src_exports, {
35
35
  module.exports = __toCommonJS(src_exports);
36
36
  var import_react = __toESM(require("eslint-config-alloy/react.js"), 1);
37
37
  var import_eslint_plugin_react = __toESM(require("eslint-plugin-react"), 1);
38
+ var import_eslint_plugin_react_hooks = __toESM(require("eslint-plugin-react-hooks"), 1);
38
39
  var config = [
39
40
  {
40
41
  files: ["**/*.{js,jsx,ts,tsx}"],
41
42
  plugins: {
42
- react: import_eslint_plugin_react.default
43
+ react: import_eslint_plugin_react.default,
44
+ "react-hooks": import_eslint_plugin_react_hooks.default
45
+ },
46
+ settings: {
47
+ react: {
48
+ version: "detect"
49
+ }
43
50
  },
44
51
  rules: {
45
- ...import_react.default.rules ?? {}
52
+ ...import_react.default.rules ?? {},
53
+ /**
54
+ * Apply the rules from the eslint-plugin-react-hooks package and use the recommended
55
+ * configuration.
56
+ *
57
+ * @see https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks
58
+ */
59
+ "react-hooks/rules-of-hooks": "error",
60
+ "react-hooks/exhaustive-deps": "warn"
46
61
  }
47
62
  }
48
63
  ];
package/dist/index.d.cts CHANGED
@@ -2,9 +2,22 @@ declare const config: {
2
2
  files: string[];
3
3
  plugins: {
4
4
  react: Plugin;
5
+ "react-hooks": Plugin;
6
+ };
7
+ settings: {
8
+ react: {
9
+ version: string;
10
+ };
5
11
  };
6
12
  rules: {
7
- [x: string]: any;
13
+ /**
14
+ * Apply the rules from the eslint-plugin-react-hooks package and use the recommended
15
+ * configuration.
16
+ *
17
+ * @see https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks
18
+ */
19
+ "react-hooks/rules-of-hooks": "error";
20
+ "react-hooks/exhaustive-deps": "warn";
8
21
  };
9
22
  }[];
10
23
 
package/dist/index.d.ts CHANGED
@@ -2,9 +2,22 @@ declare const config: {
2
2
  files: string[];
3
3
  plugins: {
4
4
  react: Plugin;
5
+ "react-hooks": Plugin;
6
+ };
7
+ settings: {
8
+ react: {
9
+ version: string;
10
+ };
5
11
  };
6
12
  rules: {
7
- [x: string]: any;
13
+ /**
14
+ * Apply the rules from the eslint-plugin-react-hooks package and use the recommended
15
+ * configuration.
16
+ *
17
+ * @see https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks
18
+ */
19
+ "react-hooks/rules-of-hooks": "error";
20
+ "react-hooks/exhaustive-deps": "warn";
8
21
  };
9
22
  }[];
10
23
 
package/dist/index.js CHANGED
@@ -1,14 +1,29 @@
1
1
  // src/index.ts
2
2
  import AlloyReact from "eslint-config-alloy/react.js";
3
3
  import eslintPluginReact from "eslint-plugin-react";
4
+ import eslintPluginReactHooks from "eslint-plugin-react-hooks";
4
5
  var config = [
5
6
  {
6
7
  files: ["**/*.{js,jsx,ts,tsx}"],
7
8
  plugins: {
8
- react: eslintPluginReact
9
+ react: eslintPluginReact,
10
+ "react-hooks": eslintPluginReactHooks
11
+ },
12
+ settings: {
13
+ react: {
14
+ version: "detect"
15
+ }
9
16
  },
10
17
  rules: {
11
- ...AlloyReact.rules ?? {}
18
+ ...AlloyReact.rules ?? {},
19
+ /**
20
+ * Apply the rules from the eslint-plugin-react-hooks package and use the recommended
21
+ * configuration.
22
+ *
23
+ * @see https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks
24
+ */
25
+ "react-hooks/rules-of-hooks": "error",
26
+ "react-hooks/exhaustive-deps": "warn"
12
27
  }
13
28
  }
14
29
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abinnovision/eslint-config-react",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "url": "https://github.com/abinnovision/js-commons"
@@ -43,20 +43,20 @@
43
43
  "prettier": "@abinnovision/prettier-config",
44
44
  "dependencies": {
45
45
  "eslint-config-alloy": "^5.1.2",
46
- "eslint-plugin-react": "^7.35.0"
46
+ "eslint-plugin-react": "^7.37.1",
47
+ "eslint-plugin-react-hooks": "^5.0.0"
47
48
  },
48
49
  "devDependencies": {
49
- "@abinnovision/prettier-config": "^2.1.0",
50
- "@types/eslint": "^9.6.0",
51
- "@typescript-eslint/eslint-plugin": "^6.21.0",
52
- "@typescript-eslint/parser": "^6.21.0",
53
- "eslint": "^9.8.0",
54
- "globals": "^15.9.0",
55
- "tsup": "^8.2.4",
56
- "typescript": "^5.5.4"
50
+ "@abinnovision/prettier-config": "^2.1.3",
51
+ "@types/eslint": "^9.6.1",
52
+ "@typescript-eslint/eslint-plugin": "^8.8.1",
53
+ "@typescript-eslint/parser": "^8.8.1",
54
+ "eslint": "^9.12.0",
55
+ "globals": "^15.11.0",
56
+ "tsup": "^8.3.0",
57
+ "typescript": "^5.6.3"
57
58
  },
58
59
  "peerDependencies": {
59
- "eslint": "^8.24.0 || ^9.0.0"
60
- },
61
- "packageManager": "yarn@3.4.1"
60
+ "eslint": "^9.0.0"
61
+ }
62
62
  }