-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy patheslint.config.mjs
More file actions
66 lines (64 loc) · 1.78 KB
/
eslint.config.mjs
File metadata and controls
66 lines (64 loc) · 1.78 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
55
56
57
58
59
60
61
62
63
64
65
66
import js from "@eslint/js";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import unusedImports from "eslint-plugin-unused-imports";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import prettier from "eslint-config-prettier";
import globals from "globals";
export default [
{
ignores: ["dist", "node_modules"],
},
{
files: ["client/src/**/*.{ts,tsx}", "server/**/*.{ts,tsx,mjs,cjs,js}"],
...js.configs.recommended,
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
globals: globals.browser,
},
plugins: {
react,
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
"@typescript-eslint": tseslint,
"unused-imports": unusedImports,
"simple-import-sort": simpleImportSort,
},
settings: {
react: { version: "detect" },
},
rules: {
"react/react-in-jsx-scope": "off",
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
...reactHooks.configs.recommended.rules,
"unused-imports/no-unused-imports": "warn",
"unused-imports/no-unused-vars": [
"warn",
{
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
},
],
"simple-import-sort/imports": "warn",
"simple-import-sort/exports": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
},
],
},
},
prettier,
];