-
Notifications
You must be signed in to change notification settings - Fork 719
/
eslint.config.mjs
81 lines (79 loc) · 2.16 KB
/
eslint.config.mjs
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
// @ts-check
import { defineConfig, GLOB_TS_SRC } from "eslint-config-hyoban"
import checkI18nJson from "./plugins/eslint/eslint-check-i18n-json.js"
import noDebug from "./plugins/eslint/eslint-no-debug.js"
import recursiveSort from "./plugins/eslint/eslint-recursive-sort.js"
export default defineConfig(
{
formatting: false,
lessOpinionated: true,
ignores: [
"src/renderer/src/hono.ts",
"src/hono.ts",
"packages/shared/src/hono.ts",
"resources/**",
],
preferESM: false,
projectService: {
allowDefaultProject: ["apps/main/preload/index.d.ts"],
defaultProject: "tsconfig.json",
},
typeChecked: "essential",
},
{
files: GLOB_TS_SRC,
rules: {
"require-await": "off",
"@typescript-eslint/require-await": "warn",
"@typescript-eslint/await-thenable": "warn",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-misused-promises": "off",
},
},
{
settings: {
tailwindcss: {
whitelist: ["center"],
},
},
plugins: {
"no-debug": noDebug,
},
rules: {
"no-debug/no-debug-stack": "error",
"@eslint-react/no-clone-element": 0,
"@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": 0,
// NOTE: Disable this temporarily
"react-compiler/react-compiler": 0,
"no-restricted-syntax": 0,
"no-restricted-globals": [
"error",
{
name: "location",
message:
"Since you don't use the same router instance in electron and browser, you can't use the global location to get the route info. \n\n" +
"You can use `useLocaltion` or `getReadonlyRoute` to get the route info.",
},
],
},
},
{
files: ["**/*.tsx"],
rules: {
"@stylistic/jsx-self-closing-comp": "error",
},
},
// @ts-expect-error
{
files: ["locales/**/*.json"],
plugins: {
"recursive-sort": recursiveSort,
"check-i18n-json": checkI18nJson,
},
rules: {
"recursive-sort/recursive-sort": "error",
"check-i18n-json/valid-i18n-keys": "error",
"check-i18n-json/no-extra-keys": "error",
},
},
)