Skip to content

Commit be9636a

Browse files
committed
change eslint config
1 parent b86b21c commit be9636a

File tree

3 files changed

+97
-70
lines changed

3 files changed

+97
-70
lines changed

cypress/.eslintrc

Lines changed: 0 additions & 10 deletions
This file was deleted.

eslint.config.js

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
// eslint.config.js — ESLint 9 flat config
2+
3+
import js from "@eslint/js";
4+
import tseslint from "typescript-eslint";
5+
import kcdConfig from "kcd-scripts/eslint.js";
6+
import cypress from "eslint-plugin-cypress";
7+
8+
export default [
9+
10+
// -----------------------------
11+
// Global .eslintignore equivalent
12+
// -----------------------------
13+
{
14+
ignores: [
15+
"node_modules",
16+
"coverage",
17+
"dist",
18+
".docusaurus",
19+
"build",
20+
"typings",
21+
"test"
22+
]
23+
},
24+
25+
// -----------------------------
26+
// Base configs (JS + TS)
27+
// -----------------------------
28+
js.configs.recommended,
29+
...tseslint.configs.recommended,
30+
31+
// -----------------------------
32+
// Main project config
33+
// -----------------------------
34+
{
35+
languageOptions: {
36+
ecmaVersion: 2023,
37+
sourceType: "module",
38+
parser: tseslint.parser,
39+
parserOptions: {
40+
project: "./tsconfig.json"
41+
}
42+
},
43+
44+
settings: {
45+
"import/no-unresolved": [
46+
2,
47+
{
48+
ignore: ["^@theme"]
49+
}
50+
],
51+
"import/resolver": {
52+
node: {
53+
extensions: [".js", ".jsx", ".ts", ".tsx"]
54+
}
55+
}
56+
},
57+
58+
// Equivalent to extends: "kcd-scripts/eslint.js"
59+
...kcdConfig,
60+
61+
rules: {
62+
"react/jsx-indent": "off",
63+
"react/prop-types": "off",
64+
"max-lines-per-function": "off",
65+
"jsx-a11y/label-has-for": "off",
66+
"jsx-a11y/label-has-associated-control": "off",
67+
"jsx-a11y/autocomplete-valid": "off",
68+
"testing-library/prefer-user-event": "off",
69+
"testing-library/no-node-access": "off",
70+
"testing-library/no-container": "off",
71+
"testing-library/render-result-naming-convention": "off"
72+
}
73+
},
74+
75+
// -----------------------------
76+
// Cypress override (merged from package.json AND .eslintrc)
77+
// -----------------------------
78+
{
79+
files: ["cypress/**/*.ts", "cypress/**/*.js"],
80+
plugins: {
81+
cypress
82+
},
83+
languageOptions: {
84+
globals: {
85+
cy: "readonly",
86+
Cypress: "readonly",
87+
expect: "readonly",
88+
assert: "readonly"
89+
}
90+
},
91+
rules: {
92+
// from your package.json Cypress override
93+
"testing-library/prefer-screen-queries": "off",
94+
"testing-library/await-async-query": "off"
95+
}
96+
}
97+
];

package.json

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -134,66 +134,6 @@
134134
"start-server-and-test": "^2.1.3",
135135
"typescript": "^5.9.3"
136136
},
137-
"eslintConfig": {
138-
"parserOptions": {
139-
"ecmaVersion": 2023,
140-
"project": "./tsconfig.json",
141-
"sourceType": "module"
142-
},
143-
"settings": {
144-
"import/no-unresolved": [
145-
2,
146-
{
147-
"ignore": [
148-
"^@theme"
149-
]
150-
}
151-
],
152-
"import/resolver": {
153-
"node": {
154-
"extensions": [
155-
".js",
156-
".jsx",
157-
".ts",
158-
".tsx"
159-
]
160-
}
161-
}
162-
},
163-
"extends": "./node_modules/kcd-scripts/eslint.js",
164-
"rules": {
165-
"react/jsx-indent": "off",
166-
"react/prop-types": "off",
167-
"max-lines-per-function": "off",
168-
"jsx-a11y/label-has-for": "off",
169-
"jsx-a11y/label-has-associated-control": "off",
170-
"jsx-a11y/autocomplete-valid": "off",
171-
"testing-library/prefer-user-event": "off",
172-
"testing-library/no-node-access": "off",
173-
"testing-library/no-container": "off",
174-
"testing-library/render-result-naming-convention": "off"
175-
},
176-
"overrides": [
177-
{
178-
"files": [
179-
"cypress/**/*.js"
180-
],
181-
"rules": {
182-
"testing-library/prefer-screen-queries": "off",
183-
"testing-library/await-async-query": "off"
184-
}
185-
}
186-
]
187-
},
188-
"eslintIgnore": [
189-
"node_modules",
190-
"coverage",
191-
"dist",
192-
".docusaurus",
193-
"build",
194-
"typings",
195-
"test"
196-
],
197137
"repository": {
198138
"type": "git",
199139
"url": "https://github.com/downshift-js/downshift.git"

0 commit comments

Comments
 (0)