-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy patheslint.config.js
More file actions
54 lines (50 loc) · 1.5 KB
/
eslint.config.js
File metadata and controls
54 lines (50 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import typescriptPlugin from "@typescript-eslint/eslint-plugin";
import typescriptParser from "@typescript-eslint/parser";
import prettierPlugin from "eslint-plugin-prettier";
import reactPlugin from "eslint-plugin-react";
import reactHooksPlugin from "eslint-plugin-react-hooks";
import reactRefreshPlugin from 'eslint-plugin-react-refresh';
import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort';
export default [
{
// Ignore patterns (replaces .eslintignore)
ignores: ["node_modules/**", "dist/**"],
},
{
files: ["**/*.{ts,tsx,js,jsx}"],
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
parser: typescriptParser,
globals: {
React: "readonly",
JSX: "readonly",
},
},
plugins: {
"@typescript-eslint": typescriptPlugin,
"react": reactPlugin,
"simple-import-sort": simpleImportSortPlugin,
"react-hooks": reactHooksPlugin,
"react-refresh": reactRefreshPlugin,
"prettier": prettierPlugin,
},
rules: {
"prettier/prettier": "warn",
// TypeScript rules
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
// React hooks rules
"react-hooks/rules-of-hooks": "error",
// Import sorting
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
},
settings: {
react: {
version: "detect",
runtime: "automatic",
},
},
},
];