Skip to content

Commit 0c37286

Browse files
authored
chore: Update ESLint to v9 to match the latest version of this package (#369)
Upgrade to eslint v9
1 parent 2742a1a commit 0c37286

File tree

8 files changed

+2219
-1897
lines changed

8 files changed

+2219
-1897
lines changed

.eslintignore

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

.eslintrc

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

demo/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eslint.config.mjs

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import js from "@eslint/js";
2+
import prettier from "eslint-config-prettier";
3+
import importPlugin from "eslint-plugin-import";
4+
import react from "eslint-plugin-react";
5+
import reactHooks from "eslint-plugin-react-hooks";
6+
import globals from "globals";
7+
import tseslint from "typescript-eslint";
8+
9+
export default tseslint.config(
10+
{
11+
ignores: [
12+
"**/node_modules/",
13+
"**/dist/",
14+
"codemod/**/*.js",
15+
"codemod/**/*.d.ts",
16+
"demo/**/*",
17+
"eslint.config.mjs",
18+
],
19+
},
20+
importPlugin.flatConfigs.recommended,
21+
{
22+
settings: {
23+
react: { version: "19" },
24+
"import/resolver": {
25+
typescript: true,
26+
node: true,
27+
},
28+
},
29+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
30+
languageOptions: {
31+
globals: globals.browser,
32+
ecmaVersion: 2020,
33+
sourceType: "module",
34+
parserOptions: {
35+
project: "./tsconfig.eslint.json",
36+
ecmaFeatures: {
37+
jsx: true,
38+
},
39+
},
40+
},
41+
plugins: {
42+
react,
43+
"react-hooks": reactHooks,
44+
},
45+
rules: {
46+
...react.configs.recommended.rules,
47+
...react.configs["jsx-runtime"].rules,
48+
...reactHooks.configs.recommended.rules,
49+
curly: ["error", "all"],
50+
"no-console": "error",
51+
"react/function-component-definition": [
52+
"error",
53+
{
54+
namedComponents: "arrow-function",
55+
unnamedComponents: "arrow-function",
56+
},
57+
],
58+
"react/jsx-filename-extension": [
59+
"error",
60+
{
61+
extensions: [".tsx"],
62+
},
63+
],
64+
"@typescript-eslint/ban-ts-comment": "warn",
65+
"@typescript-eslint/consistent-type-imports": [
66+
"warn",
67+
{
68+
prefer: "type-imports",
69+
disallowTypeAnnotations: true,
70+
},
71+
],
72+
"@typescript-eslint/no-deprecated": "warn",
73+
"@typescript-eslint/no-unused-vars": [
74+
"error",
75+
{
76+
ignoreRestSiblings: true,
77+
},
78+
],
79+
},
80+
},
81+
{
82+
files: ["src/select/*.tsx"],
83+
rules: {
84+
"react/display-name": "off",
85+
},
86+
},
87+
{
88+
files: ["codemod/**/*.ts"],
89+
rules: {
90+
"no-console": "off",
91+
"@typescript-eslint/no-require-imports": "off",
92+
},
93+
},
94+
prettier
95+
);

0 commit comments

Comments
 (0)