-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
eslint.config.ts
65 lines (61 loc) · 1.39 KB
/
eslint.config.ts
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
import type { TSESLint } from "@typescript-eslint/utils"
import type { Linter } from "eslint"
import prettierConfig from "eslint-config-prettier"
import globals from "globals"
import { dirname, resolve } from "node:path"
import { fileURLToPath } from "node:url"
import tseslint from "typescript-eslint"
import {
baseConfig,
cspellConfig,
importConfigArray,
jsxA11yConfig,
nextConfig,
perfectionistConfig,
reactConfig,
reactHooksConfig,
sharedFiles,
typescriptConfig,
} from "./.eslint"
const ignoresConfig: Linter.Config = {
name: "eslint/ignores",
ignores: ["**/.next/**", "**/node_modules/**", "**/pnpm-lock.yaml"],
}
const tsConfigPath = resolve(
dirname(fileURLToPath(import.meta.url)),
"./tsconfig.json",
)
const languageOptionConfig: TSESLint.FlatConfig.Config = {
name: "eslint/language-options",
files: sharedFiles,
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.es2015,
},
parser: tseslint.parser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 10,
project: tsConfigPath,
sourceType: "module",
},
},
}
export default tseslint.config(
ignoresConfig,
languageOptionConfig,
baseConfig,
typescriptConfig,
...importConfigArray,
cspellConfig,
perfectionistConfig,
reactConfig,
reactHooksConfig,
nextConfig,
jsxA11yConfig,
prettierConfig,
)