-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patheslint.config.js
More file actions
111 lines (110 loc) · 2.59 KB
/
eslint.config.js
File metadata and controls
111 lines (110 loc) · 2.59 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import eslint from "@eslint/js";
import prettierConfig from "eslint-config-prettier";
import importPlugin from "eslint-plugin-import";
import unusedImportsPlugin from "eslint-plugin-unused-imports";
import tseslint from "typescript-eslint";
export default tseslint.config(
{
ignores: [".yarn/**", "es/**", "cjs/**"],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
prettierConfig,
{
files: ["*.{cjs,js,ts}"],
languageOptions: {
ecmaVersion: 2020,
sourceType: "module",
parser: tseslint.parser,
parserOptions: {
ecmaFeatures: {
modules: true,
},
},
globals: {
module: "readonly",
exports: "readonly",
require: "readonly",
process: "readonly",
console: "readonly",
},
},
plugins: {
import: importPlugin,
"unused-imports": unusedImportsPlugin,
},
settings: {
"import/parsers": {
"@typescript-eslint/parser": [".ts"],
},
"import/resolver": {
typescript: {
alwaysTryTypes: true,
project: "./tsconfig.json",
},
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
},
},
rules: {
"no-empty": "warn",
"import/no-unresolved": "error",
"import/order": [
"warn",
{
"newlines-between": "never",
groups: [
"builtin",
"external",
"internal",
"object",
"parent",
"sibling",
"index",
],
alphabetize: {
order: "asc",
},
},
],
"unused-imports/no-unused-imports": "warn",
"unused-imports/no-unused-vars": "off",
"@typescript-eslint/explicit-member-accessibility": ["warn"],
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
},
},
{
files: ["**/*.js"],
rules: {
"@typescript-eslint/no-var-requires": "off",
},
},
{
files: ["**/*.test.js", "**/*.spec.ts", "**/*.test.cjs"],
languageOptions: {
globals: {
describe: "readonly",
it: "readonly",
expect: "readonly",
process: "readonly",
require: "readonly",
vi: "readonly",
beforeAll: "readonly",
afterAll: "readonly",
beforeEach: "readonly",
afterEach: "readonly",
},
},
rules: {
"@typescript-eslint/no-var-requires": "off",
},
}
);