@sb1/eslint-config-ffe 8.1.6 → 9.0.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.
Files changed (2) hide show
  1. package/README.md +71 -0
  2. package/package.json +9 -9
package/README.md CHANGED
@@ -19,3 +19,74 @@ Create `.eslintsrc` in the same directory as your `package.json` and extend this
19
19
  ```
20
20
 
21
21
  NB: If you are not using React see `@sb1/eslint-config-ffe-base`.
22
+
23
+ ## Migration Guide for ESLint 9
24
+
25
+ Version 9.0.0 of this package upgrades to ESLint 9, which requires Node.js 18 or later and includes significant changes to the configuration system.
26
+
27
+ ESLint 9 introduces the new flat config system as the default and removes support for the legacy config format. Here's how to migrate your project:
28
+
29
+ ### 1. Update your ESLint configuration
30
+
31
+ Create an `eslint.config.js` file (instead of `.eslintrc.js`) in your project root:
32
+
33
+ ```js
34
+ // eslint.config.js
35
+ import ffeConfig from '@sb1/eslint-config-ffe';
36
+
37
+ export default [
38
+ ...ffeConfig,
39
+ // Your project-specific overrides here
40
+ ];
41
+ ```
42
+
43
+ ### 2. Use ES modules syntax
44
+
45
+ ESLint 9 requires ES module syntax. Make sure your config file uses `import`/`export` instead of `require`/`module.exports`.
46
+
47
+ ### 3. Update structure of custom rules
48
+
49
+ If you have custom rules, migrate them to the flat config format:
50
+
51
+ ```js
52
+ // Old format
53
+ {
54
+ rules: {
55
+ 'react/prop-types': 'off'
56
+ },
57
+ globals: {
58
+ window: true
59
+ }
60
+ }
61
+
62
+ // New format
63
+ {
64
+ rules: {
65
+ 'react/prop-types': 'off'
66
+ },
67
+ languageOptions: {
68
+ globals: {
69
+ window: true
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ ### 4. Update dependencies
76
+
77
+ Make sure your `package.json` has updated peer dependencies:
78
+
79
+ ```diff
80
+ - "eslint": "^8.0.0",
81
+ + "eslint": "^9.0.0",
82
+ ```
83
+
84
+ ### 5. Prettier compatibility
85
+
86
+ If you're using Prettier, update to the latest eslint-config-prettier for compatibility with flat configs.
87
+
88
+ For more information, refer to the [ESLint 9 migration guide](https://eslint.org/docs/latest/use/configure/migration-guide).
89
+
90
+ ## Contribute
91
+
92
+ Contributions are welcome. Please check out our [contribution guide](../../CONTRIBUTING.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/eslint-config-ffe",
3
- "version": "8.1.6",
3
+ "version": "9.0.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": "SpareBank 1",
@@ -8,16 +8,17 @@
8
8
  "rules",
9
9
  "*.js"
10
10
  ],
11
- "main": "index.js",
11
+ "main": "index.mjs",
12
12
  "repository": {
13
13
  "type": "git",
14
14
  "url": "ssh://git@github.com:SpareBank1/designsystem.git"
15
15
  },
16
16
  "scripts": {
17
- "lint": "eslint ."
17
+ "lint": "echo \"Skipping lint for linting config\" && true",
18
+ "lint:fix": "echo \"Skipping lint:fix for linting config\" && true"
18
19
  },
19
20
  "dependencies": {
20
- "@sb1/eslint-config-ffe-base": "^3.0.7"
21
+ "@sb1/eslint-config-ffe-base": "^3.0.9"
21
22
  },
22
23
  "devDependencies": {
23
24
  "eslint": "^9.22.0",
@@ -27,14 +28,13 @@
27
28
  "eslint-plugin-react-hooks": "^5.2.0"
28
29
  },
29
30
  "peerDependencies": {
30
- "eslint": "*",
31
- "eslint-plugin-jsx-a11y": "*",
32
- "eslint-plugin-react": "*",
31
+ "eslint": ">=9.7.0",
32
+ "eslint-plugin-jsx-a11y": ">=6.0.0",
33
+ "eslint-plugin-react": ">=7.0.0",
33
34
  "eslint-plugin-react-hooks": "^5.0.0"
34
35
  },
35
36
  "publishConfig": {
36
37
  "access": "public"
37
38
  },
38
- "type": "module",
39
- "gitHead": "61e0e1ffb823447811627196398c7818d0e8cea3"
39
+ "gitHead": "12c17b17efaecc8943ccaef202c7243e43083d52"
40
40
  }