@bratislava/eslint-config-react 0.5.0 → 0.5.2
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 +8 -33
- package/package.json +3 -9
package/index.js
CHANGED
|
@@ -5,26 +5,14 @@
|
|
|
5
5
|
* Extends base config with React-specific rules and plugins.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
disabledRules,
|
|
10
|
-
eslintRules,
|
|
11
|
-
simpleImportSortConfig,
|
|
12
|
-
sonarjsRules,
|
|
13
|
-
typescriptRules,
|
|
14
|
-
} from "@bratislava/eslint-config";
|
|
15
|
-
import eslint from "@eslint/js";
|
|
8
|
+
import { baseConfig } from "@bratislava/eslint-config";
|
|
16
9
|
import tanstackQuery from "@tanstack/eslint-plugin-query";
|
|
17
|
-
import prettier from "eslint-config-prettier";
|
|
18
10
|
import importPlugin from "eslint-plugin-import";
|
|
19
11
|
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
20
|
-
import noUnsanitized from "eslint-plugin-no-unsanitized";
|
|
21
12
|
import react from "eslint-plugin-react";
|
|
22
13
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
23
|
-
import security from "eslint-plugin-security";
|
|
24
|
-
import sonarjs from "eslint-plugin-sonarjs";
|
|
25
14
|
import tailwindcss from "eslint-plugin-tailwindcss";
|
|
26
15
|
import globals from "globals";
|
|
27
|
-
import tseslint from "typescript-eslint";
|
|
28
16
|
|
|
29
17
|
/**
|
|
30
18
|
* React-specific rules
|
|
@@ -106,16 +94,11 @@ export function createReactConfig(options = {}) {
|
|
|
106
94
|
const { ignores = [] } = options;
|
|
107
95
|
|
|
108
96
|
return [
|
|
109
|
-
// Base
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
simpleImportSortConfig,
|
|
115
|
-
security.configs.recommended,
|
|
116
|
-
noUnsanitized.configs.recommended,
|
|
117
|
-
sonarjs.configs.recommended,
|
|
118
|
-
tanstackQuery.configs["flat/recommended"],
|
|
97
|
+
// Base configuration (eslint, typescript, prettier, security, sonarjs, etc.)
|
|
98
|
+
...baseConfig,
|
|
99
|
+
|
|
100
|
+
// React-specific configs
|
|
101
|
+
...tanstackQuery.configs["flat/recommended"],
|
|
119
102
|
...tailwindcss.configs["flat/recommended"],
|
|
120
103
|
|
|
121
104
|
// React hooks recommended config (includes plugin and rules)
|
|
@@ -135,18 +118,16 @@ export function createReactConfig(options = {}) {
|
|
|
135
118
|
},
|
|
136
119
|
},
|
|
137
120
|
|
|
138
|
-
// Language options
|
|
121
|
+
// Language options (extend base with browser globals and JSX)
|
|
139
122
|
{
|
|
140
123
|
languageOptions: {
|
|
141
124
|
parserOptions: {
|
|
142
|
-
projectService: true,
|
|
143
125
|
ecmaFeatures: {
|
|
144
126
|
jsx: true,
|
|
145
127
|
},
|
|
146
128
|
},
|
|
147
129
|
globals: {
|
|
148
130
|
...globals.browser,
|
|
149
|
-
...globals.es2021,
|
|
150
131
|
},
|
|
151
132
|
},
|
|
152
133
|
},
|
|
@@ -160,16 +141,10 @@ export function createReactConfig(options = {}) {
|
|
|
160
141
|
},
|
|
161
142
|
},
|
|
162
143
|
|
|
163
|
-
//
|
|
144
|
+
// Frontend-specific rules
|
|
164
145
|
{
|
|
165
146
|
rules: {
|
|
166
|
-
...typescriptRules,
|
|
167
|
-
...eslintRules,
|
|
168
|
-
...sonarjsRules,
|
|
169
|
-
...disabledRules,
|
|
170
147
|
...frontendRules,
|
|
171
|
-
|
|
172
|
-
// SonarJS additional config for frontend
|
|
173
148
|
"sonarjs/different-types-comparison": "off",
|
|
174
149
|
},
|
|
175
150
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bratislava/eslint-config-react",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "ESLint configuration for React projects (without Next.js)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -29,20 +29,14 @@
|
|
|
29
29
|
"typescript": ">= 5"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@bratislava/eslint-config": "0.5.
|
|
33
|
-
"@eslint/js": "9.34.0",
|
|
32
|
+
"@bratislava/eslint-config": "0.5.2",
|
|
34
33
|
"@tanstack/eslint-plugin-query": "5.91.2",
|
|
35
|
-
"eslint-config-prettier": "10.1.8",
|
|
36
34
|
"eslint-plugin-import": "2.32.0",
|
|
37
35
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
38
|
-
"eslint-plugin-no-unsanitized": "4.1.4",
|
|
39
36
|
"eslint-plugin-react": "7.37.5",
|
|
40
37
|
"eslint-plugin-react-hooks": "5.2.0",
|
|
41
|
-
"eslint-plugin-security": "3.0.1",
|
|
42
|
-
"eslint-plugin-sonarjs": "3.0.5",
|
|
43
38
|
"eslint-plugin-tailwindcss": "3.18.2",
|
|
44
|
-
"globals": "16.5.0"
|
|
45
|
-
"typescript-eslint": "8.52.0"
|
|
39
|
+
"globals": "16.5.0"
|
|
46
40
|
},
|
|
47
41
|
"engines": {
|
|
48
42
|
"node": ">=18"
|