-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
55 lines (52 loc) · 1.57 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
import Fs from "node:fs";
import { fixupPluginRules } from "@eslint/compat";
import eslint from "@eslint/js";
import importPlugin from "eslint-plugin-import";
import preferLet from "eslint-plugin-prefer-let";
import reactCompiler from "eslint-plugin-react-compiler";
import { globifyGitIgnore } from "globify-gitignore";
import tseslint from "typescript-eslint";
let gitignoreContent = Fs.readFileSync(".gitignore", "utf-8");
let globs = await globifyGitIgnore(gitignoreContent);
let ignores = globs.map((glob) => glob.glob);
export default tseslint.config(
{ ignores },
eslint.configs.recommended,
...tseslint.configs.recommended,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,
{
linterOptions: {
reportUnusedDisableDirectives: "error",
},
plugins: {
"prefer-let": fixupPluginRules(preferLet),
"react-compiler": reactCompiler,
},
rules: {
"react-compiler/react-compiler": "error",
"prefer-const": "off",
"prefer-let/prefer-let": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_" },
],
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
"import/order": [
"error",
{
alphabetize: { caseInsensitive: true, order: "asc" },
groups: ["builtin", "external", "internal", "parent", "sibling"],
"newlines-between": "always",
},
],
"import/no-unresolved": ["error", { ignore: ["^virtual:"] }],
"import/no-named-as-default-member": "off",
},
settings: {
"import/resolver": {
typescript: { alwaysTryTypes: true },
},
},
},
);