@geops/eslint-config-react 1.4.0 → 1.5.0-beta.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.
Files changed (3) hide show
  1. package/README.md +16 -0
  2. package/flat/index.mjs +56 -0
  3. package/package.json +10 -4
package/README.md CHANGED
@@ -6,6 +6,20 @@ Run the following command to install the ESLint configuration for React projects
6
6
  npm install --save-dev @geops/eslint-config-react
7
7
  ```
8
8
 
9
+ ## Using flat config (eslint >= 9)
10
+
11
+ Then, create a `eslint.config.mjs` file in the root of your project with the following content:
12
+
13
+ ```javascript
14
+ import geopsFlatConfig from '@geops/eslint-config-react/flat';
15
+
16
+ export default [
17
+ ...geopsFlatConfig,
18
+ ];
19
+ ```
20
+
21
+ ## Using deprecated config (eslint < 9)
22
+
9
23
  Then, create a `.eslintrc.json` file in the root of your project with the following content:
10
24
 
11
25
  ```javascript
@@ -13,3 +27,5 @@ Then, create a `.eslintrc.json` file in the root of your project with the follow
13
27
  "extends": ["@geops/eslint-config-react"]
14
28
  }
15
29
  ```
30
+
31
+
package/flat/index.mjs ADDED
@@ -0,0 +1,56 @@
1
+ import { FlatCompat } from "@eslint/eslintrc";
2
+ import eslint from "@eslint/js";
3
+ import jsxA11y from "eslint-plugin-jsx-a11y";
4
+ import perfectionist from "eslint-plugin-perfectionist";
5
+ import prettier from "eslint-plugin-prettier/recommended";
6
+ import react from "eslint-plugin-react";
7
+ import tseslint from "typescript-eslint";
8
+ import pluginCypress from 'eslint-plugin-cypress/flat';
9
+ import globals from "globals";
10
+ // FlatCompat convert old definition to the new ones
11
+ const compat = new FlatCompat();
12
+
13
+ export default [
14
+ {
15
+ ignores: ["build/*", "node_modules/*"],
16
+ languageOptions: {
17
+ globals: {
18
+ ...globals.browser,
19
+ ...globals.es2020,
20
+ ...globals.node,
21
+ ...globals.jest,
22
+ ...globals.mocha,
23
+ ...globals.vitest,
24
+ ...pluginCypress.globals,
25
+ }
26
+ },
27
+ settings: {
28
+ react: { version: "detect" },
29
+ },
30
+ },
31
+ pluginCypress.configs.globals,
32
+ // jestConfig.configs['flat/recommended'],
33
+ ...tseslint.config(
34
+ eslint.configs.recommended,
35
+ tseslint.configs.strict,
36
+ tseslint.configs.stylistic,
37
+ react.configs.flat.recommended,
38
+ react.configs.flat["jsx-runtime"], // Avoid having the React-in-jsx-scope rule activated
39
+ ...compat.config({
40
+ extends: ["plugin:react-hooks/recommended"],
41
+ rules: {
42
+ "react-hooks/exhaustive-deps": "error",
43
+ },
44
+ }),
45
+ jsxA11y.flatConfigs.recommended,
46
+ perfectionist.configs["recommended-alphabetical"],
47
+ prettier,
48
+ {
49
+ rules: {
50
+ "arrow-body-style": ["error", "always"],
51
+ curly: "error",
52
+ "@typescript-eslint/no-empty-function": "off",
53
+ },
54
+ },
55
+ ),
56
+ ];
package/package.json CHANGED
@@ -1,17 +1,23 @@
1
1
  {
2
2
  "name": "@geops/eslint-config-react",
3
- "version": "1.4.0",
3
+ "version": "1.5.0-beta.1",
4
4
  "dependencies": {
5
- "@typescript-eslint/eslint-plugin": "^8.21.0",
6
- "@typescript-eslint/parser": "^8.21.0",
7
5
  "eslint-config-prettier": "^10.0.1",
8
6
  "eslint-plugin-cypress": "^4.1.0",
7
+ "eslint-plugin-jest": "^28.11.0",
9
8
  "eslint-plugin-jsx-a11y": "^6.10.2",
10
9
  "eslint-plugin-mocha": "^10.5.0",
11
10
  "eslint-plugin-perfectionist": "^4.7.0",
11
+ "eslint-plugin-prettier": "^5.2.3",
12
12
  "eslint-plugin-react": "^7.37.4",
13
13
  "eslint-plugin-react-compiler": "^19.0.0-beta-27714ef-20250124",
14
- "eslint-plugin-react-hooks": "^5.1.0"
14
+ "eslint-plugin-react-hooks": "^5.1.0",
15
+ "globals": "^15.14.0",
16
+ "typescript-eslint": "^8.22.0"
17
+ },
18
+ "exports": {
19
+ ".": "./index.js",
20
+ "./flat": "./flat/index.mjs"
15
21
  },
16
22
  "peerDependencies": {
17
23
  "eslint": "^8 || ^9",