@sb1/eslint-config-ffe 8.1.5 → 8.1.6

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/index.js CHANGED
@@ -1,14 +1,75 @@
1
- module.exports = {
2
- extends: [
3
- '@sb1/eslint-config-ffe-base',
4
- './rules/jsx',
5
- './rules/jsx-a11y',
6
- ].map(require.resolve),
7
- plugins: ['react', 'jsx-a11y', 'react-hooks'],
8
- parserOptions: {
9
- ecmaFeatures: {
10
- jsx: true,
1
+ // For ESLint v9 flat config system
2
+ export default {
3
+ languageOptions: {
4
+ ecmaVersion: 2020,
5
+ sourceType: 'module',
6
+ parserOptions: {
7
+ ecmaFeatures: {
8
+ jsx: true,
9
+ },
11
10
  },
11
+ globals: {
12
+ // Browser globals
13
+ window: 'readonly',
14
+ document: 'readonly',
15
+ // Node globals
16
+ process: 'readonly',
17
+ __dirname: 'readonly',
18
+ },
19
+ },
20
+ linterOptions: {
21
+ reportUnusedDisableDirectives: true,
22
+ },
23
+ plugins: {
24
+ // Import plugins properly for ESM compatibility
25
+ react: (await import('eslint-plugin-react')).default,
26
+ 'jsx-a11y': (await import('eslint-plugin-jsx-a11y')).default,
27
+ 'react-hooks': (await import('eslint-plugin-react-hooks')).default,
28
+ import: (await import('eslint-plugin-import')).default,
29
+ },
30
+ // Core ESLint rules
31
+ rules: {
32
+ // React rules
33
+ 'react/jsx-boolean-value': ['error', 'always'],
34
+ 'react/jsx-key': ['error'],
35
+ 'react/jsx-no-duplicate-props': ['error'],
36
+ 'react/jsx-no-undef': ['error'],
37
+ 'react/jsx-pascal-case': ['error'],
38
+ 'react/jsx-uses-react': ['error'],
39
+ 'react/jsx-uses-vars': ['error'],
40
+ 'react/jsx-first-prop-new-line': ['error', 'multiline'],
41
+ 'react/jsx-closing-bracket-location': ['error'],
42
+ 'react/no-danger': ['error'],
43
+ 'react/no-did-mount-set-state': ['error'],
44
+ 'react/no-did-update-set-state': ['error'],
45
+ 'react/no-direct-mutation-state': ['error'],
46
+ 'react/no-is-mounted': ['error'],
47
+ 'react/no-multi-comp': ['error', { ignoreStateless: true }],
48
+ 'react/no-unknown-property': ['error'],
49
+ 'react/prefer-es6-class': ['error', 'always'],
50
+ 'react/prefer-stateless-function': ['error'],
51
+ 'react/react-in-jsx-scope': ['error'],
52
+ 'react/require-render-return': ['error'],
53
+ 'react/self-closing-comp': ['error'],
54
+ 'react-hooks/rules-of-hooks': 'error',
55
+ 'react-hooks/exhaustive-deps': 'warn',
56
+
57
+ // A11y rules
58
+ 'jsx-a11y/aria-props': 'error',
59
+ 'jsx-a11y/aria-proptypes': 'error',
60
+ 'jsx-a11y/aria-role': 'error',
61
+ 'jsx-a11y/aria-unsupported-elements': 'error',
62
+ 'jsx-a11y/anchor-is-valid': 'error',
63
+ 'jsx-a11y/alt-text': 'error',
64
+ 'jsx-a11y/img-redundant-alt': 'error',
65
+ 'jsx-a11y/label-has-for': ['error', { required: 'id' }],
66
+ 'jsx-a11y/mouse-events-have-key-events': 'error',
67
+ 'jsx-a11y/no-access-key': 'error',
68
+ 'jsx-a11y/interactive-supports-focus': 'error',
69
+ 'jsx-a11y/no-static-element-interactions': 'error',
70
+ 'jsx-a11y/no-noninteractive-element-interactions': 'error',
71
+ 'jsx-a11y/role-has-required-aria-props': 'error',
72
+ 'jsx-a11y/role-supports-aria-props': 'warn',
73
+ 'jsx-a11y/tabindex-no-positive': 'error',
12
74
  },
13
- rules: {},
14
75
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/eslint-config-ffe",
3
- "version": "8.1.5",
3
+ "version": "8.1.6",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": "SpareBank 1",
@@ -17,23 +17,24 @@
17
17
  "lint": "eslint ."
18
18
  },
19
19
  "dependencies": {
20
- "@sb1/eslint-config-ffe-base": "^3.0.6"
20
+ "@sb1/eslint-config-ffe-base": "^3.0.7"
21
21
  },
22
22
  "devDependencies": {
23
- "eslint": "^8.57.0",
23
+ "eslint": "^9.22.0",
24
24
  "eslint-plugin-import": "^2.29.1",
25
25
  "eslint-plugin-jsx-a11y": "^6.8.0",
26
26
  "eslint-plugin-react": "^7.0.0",
27
- "eslint-plugin-react-hooks": "^4.6.2"
27
+ "eslint-plugin-react-hooks": "^5.2.0"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "eslint": "*",
31
31
  "eslint-plugin-jsx-a11y": "*",
32
32
  "eslint-plugin-react": "*",
33
- "eslint-plugin-react-hooks": "*"
33
+ "eslint-plugin-react-hooks": "^5.0.0"
34
34
  },
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "04c486e446179c6a1a8ca15a015c4c3e008ce6d5"
38
+ "type": "module",
39
+ "gitHead": "61e0e1ffb823447811627196398c7818d0e8cea3"
39
40
  }
package/rules/jsx-a11y.js CHANGED
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  rules: {
3
3
  // Enforce all anchors to contain accessible content.
4
4
  // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-props.md
package/rules/jsx.js CHANGED
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  rules: {
3
3
  // Enforce boolean attributes notation in JSX
4
4
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md