@bratislava/eslint-config-next 0.5.2 → 6.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.
Potentially problematic release.
This version of @bratislava/eslint-config-next might be problematic. Click here for more details.
- package/index.js +19 -23
- package/package.json +3 -4
package/index.js
CHANGED
|
@@ -9,7 +9,6 @@ import { baseConfig } from "@bratislava/eslint-config";
|
|
|
9
9
|
import nextPlugin from "@next/eslint-plugin-next";
|
|
10
10
|
import tanstackQuery from "@tanstack/eslint-plugin-query";
|
|
11
11
|
import i18next from "eslint-plugin-i18next";
|
|
12
|
-
import importPlugin from "eslint-plugin-import";
|
|
13
12
|
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
14
13
|
import react from "eslint-plugin-react";
|
|
15
14
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
@@ -17,7 +16,7 @@ import tailwindcss from "eslint-plugin-tailwindcss";
|
|
|
17
16
|
import globals from "globals";
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
|
-
* React-specific rules
|
|
19
|
+
* React-specific rules overrides
|
|
21
20
|
*/
|
|
22
21
|
export const reactRules = {
|
|
23
22
|
"react/function-component-definition": [
|
|
@@ -28,6 +27,10 @@ export const reactRules = {
|
|
|
28
27
|
"react/react-in-jsx-scope": "off",
|
|
29
28
|
"react/jsx-no-useless-fragment": [2, { allowExpressions: true }],
|
|
30
29
|
"react/display-name": "off",
|
|
30
|
+
"react/no-array-index-key": "warn",
|
|
31
|
+
"react/destructuring-assignment": "warn",
|
|
32
|
+
"react/no-unused-prop-types": "warn",
|
|
33
|
+
"react/style-prop-object": "warn",
|
|
31
34
|
};
|
|
32
35
|
|
|
33
36
|
/**
|
|
@@ -44,14 +47,6 @@ export const importRules = {
|
|
|
44
47
|
"import/no-named-as-default-member": "off",
|
|
45
48
|
};
|
|
46
49
|
|
|
47
|
-
/**
|
|
48
|
-
* JSX A11y rules
|
|
49
|
-
*/
|
|
50
|
-
export const jsxA11yRules = {
|
|
51
|
-
"jsx-a11y/anchor-is-valid": "off",
|
|
52
|
-
"jsx-a11y/img-redundant-alt": "warn",
|
|
53
|
-
};
|
|
54
|
-
|
|
55
50
|
/**
|
|
56
51
|
* Next.js-specific rules
|
|
57
52
|
*/
|
|
@@ -86,6 +81,8 @@ const frontendRules = {
|
|
|
86
81
|
],
|
|
87
82
|
"@typescript-eslint/no-floating-promises": "warn",
|
|
88
83
|
"@typescript-eslint/no-confusing-void-expression": "off",
|
|
84
|
+
|
|
85
|
+
"jsx-a11y/control-has-associated-label": "warn",
|
|
89
86
|
};
|
|
90
87
|
|
|
91
88
|
/**
|
|
@@ -114,21 +111,18 @@ export function createNextConfig(options = {}) {
|
|
|
114
111
|
nextPlugin.flatConfig.recommended,
|
|
115
112
|
nextPlugin.flatConfig.coreWebVitals,
|
|
116
113
|
|
|
117
|
-
// React hooks recommended
|
|
118
|
-
reactHooks.configs
|
|
114
|
+
// React & React hooks recommended configs
|
|
115
|
+
reactHooks.configs.flat.recommended,
|
|
116
|
+
react.configs.flat.recommended,
|
|
117
|
+
react.configs.flat["jsx-runtime"], // Recommended by the docs if using React 17+
|
|
118
|
+
|
|
119
|
+
// JSX A11y recommended config
|
|
120
|
+
jsxA11y.flatConfigs.recommended,
|
|
119
121
|
|
|
120
|
-
//
|
|
122
|
+
// Import rules (plugin registered in base config)
|
|
121
123
|
{
|
|
122
|
-
plugins: {
|
|
123
|
-
react,
|
|
124
|
-
import: importPlugin,
|
|
125
|
-
"jsx-a11y": jsxA11y,
|
|
126
|
-
},
|
|
127
124
|
rules: {
|
|
128
|
-
...reactRules,
|
|
129
125
|
...importRules,
|
|
130
|
-
...jsxA11yRules,
|
|
131
|
-
...nextRules,
|
|
132
126
|
},
|
|
133
127
|
},
|
|
134
128
|
|
|
@@ -147,11 +141,13 @@ export function createNextConfig(options = {}) {
|
|
|
147
141
|
...tanstackQuery.configs["flat/recommended"],
|
|
148
142
|
...tailwindcss.configs["flat/recommended"],
|
|
149
143
|
|
|
150
|
-
// Frontend
|
|
144
|
+
// Frontend rules and overrides
|
|
151
145
|
{
|
|
152
146
|
rules: {
|
|
153
147
|
...frontendRules,
|
|
154
|
-
|
|
148
|
+
...reactRules,
|
|
149
|
+
...nextRules,
|
|
150
|
+
"sonarjs/different-types-comparison": "off", // TODO consider removing
|
|
155
151
|
},
|
|
156
152
|
},
|
|
157
153
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bratislava/eslint-config-next",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "ESLint configuration for Next.js frontend projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -31,14 +31,13 @@
|
|
|
31
31
|
"typescript": ">= 5"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@bratislava/eslint-config": "0.
|
|
34
|
+
"@bratislava/eslint-config": "6.0.0",
|
|
35
35
|
"@next/eslint-plugin-next": "15.5.2",
|
|
36
36
|
"@tanstack/eslint-plugin-query": "5.91.2",
|
|
37
37
|
"eslint-plugin-i18next": "6.1.3",
|
|
38
|
-
"eslint-plugin-import": "2.32.0",
|
|
39
38
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
40
39
|
"eslint-plugin-react": "7.37.5",
|
|
41
|
-
"eslint-plugin-react-hooks": "
|
|
40
|
+
"eslint-plugin-react-hooks": "7.0.1",
|
|
42
41
|
"eslint-plugin-tailwindcss": "3.18.2",
|
|
43
42
|
"globals": "16.5.0"
|
|
44
43
|
},
|