-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
89 lines (88 loc) · 2.25 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
82
83
84
85
86
87
88
89
import eslint from "@eslint/js";
import vitest from "@vitest/eslint-plugin";
import eslintPluginAstro from "eslint-plugin-astro";
import perfectionist from "eslint-plugin-perfectionist";
import react from "eslint-plugin-react";
import reactCompiler from "eslint-plugin-react-compiler";
import tailwind from "eslint-plugin-tailwindcss";
import eslintPluginUnicorn from "eslint-plugin-unicorn";
import globals from "globals";
import tsEslint from "typescript-eslint";
export default tsEslint.config(
{
ignores: ["dist/", ".astro/", "coverage/", "content/", "public/"],
},
eslint.configs.recommended,
eslintPluginUnicorn.configs["flat/recommended"],
perfectionist.configs["recommended-natural"],
...eslintPluginAstro.configs.recommended,
{
rules: {
"unicorn/filename-case": "off",
"unicorn/no-nested-ternary": "off",
"unicorn/prevent-abbreviations": "off",
},
},
{
files: ["*.js"],
languageOptions: {
globals: {
...globals.node,
},
},
},
{
extends: [...tsEslint.configs.recommendedTypeChecked],
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
warnOnUnsupportedTypeScriptVersion: false,
},
},
rules: {
"@typescript-eslint/array-type": "error",
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/consistent-type-imports": "error",
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["../*"],
message: "no relative imports outside current folder",
},
],
},
],
},
},
{
extends: [...tailwind.configs["flat/recommended"]],
files: ["**/*.tsx"],
plugins: {
react,
"react-compiler": reactCompiler,
},
rules: {
...react.configs.recommended.rules,
"react-compiler/react-compiler": "error",
"react/react-in-jsx-scope": "off",
},
settings: {
react: {
version: "detect",
},
},
},
{
files: ["src/**/?(*.)+(spec|test).[jt]s?(x)"],
plugins: {
vitest,
},
rules: {
...vitest.configs.recommended.rules,
},
},
);