-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.js
81 lines (79 loc) · 2.22 KB
/
eslint.config.js
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import js from "@eslint/js";
import prettier from "eslint-config-prettier";
import prettierPlugin from "eslint-plugin-prettier";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tailwind from "eslint-plugin-tailwindcss";
import globals from "globals";
import ts from "typescript-eslint";
/** @type {import('eslint').Linter.FlatConfig[]} */
export default ts.config(
js.configs.recommended,
...ts.configs.recommended,
...tailwind.configs["flat/recommended"],
{
plugins: {
"@typescript-eslint": ts.plugin,
react,
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
prettier: prettierPlugin,
},
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.es2020,
},
parserOptions: {
project: ["tsconfig.json", "tsconfig.node.json", "tsconfig.app.json"],
ecmaFeatures: {
jsx: true,
},
},
},
files: ["**/*.{js,jsx,ts,tsx}"],
rules: {
...prettierPlugin.configs.recommended.rules,
...prettier.rules,
...tailwind.configs.rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"prefer-const": "error",
"prettier/prettier": ["warn", {}],
"react/jsx-curly-brace-presence": [
"warn",
{ props: "never", children: "never" },
],
"react/self-closing-comp": ["warn", { component: true, html: true }],
"tailwindcss/no-custom-classname": "warn",
"tailwindcss/classnames-order": "warn",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/consistent-type-imports": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
},
settings: {
tailwindcss: { callees: ["cn", "cva"] },
react: { version: "detect" },
},
ignores: [
"dist",
"node_modules",
".cache",
"public",
"coverage",
"eslint.config.js",
"*.esm.js",
],
}
);