@abinnovision/eslint-config-react 2.0.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,27 @@
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
+
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)
19
+
20
+
21
+ ### Features
22
+
23
+ * migrate to esm ([#278](https://github.com/abinnovision/js-commons/issues/278)) ([fed850d](https://github.com/abinnovision/js-commons/commit/fed850d979f7ba83fae75adadcfd0024f2acd242))
24
+
3
25
  ## [2.0.0](https://github.com/abinnovision/js-commons/compare/eslint-config-react-v1.2.0...eslint-config-react-v2.0.0) (2023-11-03)
4
26
 
5
27
 
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 ADDED
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
+ default: () => src_default
34
+ });
35
+ module.exports = __toCommonJS(src_exports);
36
+ var import_react = __toESM(require("eslint-config-alloy/react.js"), 1);
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);
39
+ var config = [
40
+ {
41
+ files: ["**/*.{js,jsx,ts,tsx}"],
42
+ plugins: {
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
+ }
50
+ },
51
+ 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"
61
+ }
62
+ }
63
+ ];
64
+ var src_default = config;
@@ -0,0 +1,24 @@
1
+ declare const config: {
2
+ files: string[];
3
+ plugins: {
4
+ react: Plugin;
5
+ "react-hooks": Plugin;
6
+ };
7
+ settings: {
8
+ react: {
9
+ version: string;
10
+ };
11
+ };
12
+ rules: {
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";
21
+ };
22
+ }[];
23
+
24
+ export { config as default };
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,39 +1,33 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (let key of __getOwnPropNames(from))
11
- if (!__hasOwnProp.call(to, key) && key !== except)
12
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- }
14
- return to;
15
- };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- // If the importer is in node compatibility mode or this is not an ESM
18
- // file that has been converted to a CommonJS file using a Babel-
19
- // compatible transform (i.e. "__esModule" has not been set), then set
20
- // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
- mod
23
- ));
24
-
25
1
  // src/index.ts
26
- var AlloyReact = __toESM(require("eslint-config-alloy/react"));
27
- var eslintPluginReact = __toESM(require("eslint-plugin-react"));
2
+ import AlloyReact from "eslint-config-alloy/react.js";
3
+ import eslintPluginReact from "eslint-plugin-react";
4
+ import eslintPluginReactHooks from "eslint-plugin-react-hooks";
28
5
  var config = [
29
6
  {
30
7
  files: ["**/*.{js,jsx,ts,tsx}"],
31
8
  plugins: {
32
- react: eslintPluginReact
9
+ react: eslintPluginReact,
10
+ "react-hooks": eslintPluginReactHooks
11
+ },
12
+ settings: {
13
+ react: {
14
+ version: "detect"
15
+ }
33
16
  },
34
17
  rules: {
35
- ...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"
36
27
  }
37
28
  }
38
29
  ];
39
- module.exports = config;
30
+ var src_default = config;
31
+ export {
32
+ src_default as default
33
+ };
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@abinnovision/eslint-config-react",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
+ "type": "module",
4
5
  "repository": {
5
6
  "url": "https://github.com/abinnovision/js-commons"
6
7
  },
@@ -12,13 +13,13 @@
12
13
  },
13
14
  "exports": {
14
15
  ".": {
15
- "import": "./dist/index.mjs",
16
- "require": "./dist/index.js",
16
+ "import": "./dist/index.js",
17
+ "require": "./dist/index.cjs",
17
18
  "types": "./dist/index.d.ts"
18
19
  }
19
20
  },
20
- "main": "./dist/index.js",
21
- "module": "./dist/index.mjs",
21
+ "main": "./dist/index.cjs",
22
+ "module": "./dist/index.js",
22
23
  "types": "./dist/index.d.ts",
23
24
  "files": [
24
25
  "dist/"
@@ -42,20 +43,20 @@
42
43
  "prettier": "@abinnovision/prettier-config",
43
44
  "dependencies": {
44
45
  "eslint-config-alloy": "^5.1.2",
45
- "eslint-plugin-react": "^7.0.0"
46
+ "eslint-plugin-react": "^7.37.1",
47
+ "eslint-plugin-react-hooks": "^5.0.0"
46
48
  },
47
49
  "devDependencies": {
48
- "@abinnovision/prettier-config": "^2.0.0",
49
- "@types/eslint": "^8.44.6",
50
- "@typescript-eslint/eslint-plugin": "^6.9.0",
51
- "@typescript-eslint/parser": "^6.9.0",
52
- "eslint": "^8.52.0",
53
- "globals": "^13.23.0",
54
- "tsup": "^7.2.0",
55
- "typescript": "^5.2.2"
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"
56
58
  },
57
59
  "peerDependencies": {
58
- "eslint": "^8.24.0"
59
- },
60
- "packageManager": "yarn@3.4.1"
60
+ "eslint": "^9.0.0"
61
+ }
61
62
  }
package/dist/index.d.mts DELETED
@@ -1,11 +0,0 @@
1
- declare const config: {
2
- files: string[];
3
- plugins: {
4
- react: Plugin;
5
- };
6
- rules: {
7
- [x: string]: any;
8
- };
9
- }[];
10
-
11
- export { config as default };
package/dist/index.mjs DELETED
@@ -1,25 +0,0 @@
1
- var __getOwnPropNames = Object.getOwnPropertyNames;
2
- var __commonJS = (cb, mod) => function __require() {
3
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
4
- };
5
-
6
- // src/index.ts
7
- import * as AlloyReact from "eslint-config-alloy/react";
8
- import * as eslintPluginReact from "eslint-plugin-react";
9
- var require_src = __commonJS({
10
- "src/index.ts"(exports, module) {
11
- var config = [
12
- {
13
- files: ["**/*.{js,jsx,ts,tsx}"],
14
- plugins: {
15
- react: eslintPluginReact
16
- },
17
- rules: {
18
- ...AlloyReact.rules ?? {}
19
- }
20
- }
21
- ];
22
- module.exports = config;
23
- }
24
- });
25
- export default require_src();