-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
111 lines (102 loc) · 3.55 KB
/
Copy patheslint.config.js
File metadata and controls
111 lines (102 loc) · 3.55 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
// eslint.config.js
import prettier from "eslint-config-prettier";
import unusedImports from "eslint-plugin-unused-imports";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import globals from "globals";
import js from "@eslint/js";
import ts from "typescript-eslint";
import { globalIgnores, defineConfig } from "eslint/config";
import path from "node:path";
import { fileURLToPath } from "node:url";
export default defineConfig([
globalIgnores(["dist", "node_modules"]),
{
files: ["**/*.ts", "**/*.tsx"],
extends: [prettier, js.configs.recommended, ts.configs.recommended],
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
globals: globals.browser,
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: path.dirname(fileURLToPath(import.meta.url)),
},
},
plugins: {
"unused-imports": unusedImports,
"simple-import-sort": simpleImportSort,
},
rules: {
// "no-console": "warn",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-imports": "warn",
"unused-imports/no-unused-vars": [
"warn",
{
vars: "all",
varsIgnorePattern: "^_",
args: "after-used",
argsIgnorePattern: "^_",
},
],
"simple-import-sort/exports": "warn",
"simple-import-sort/imports": "warn",
"no-var": "warn",
"object-shorthand": ["warn", "properties"],
eqeqeq: ["warn", "always", { null: "ignore" }],
"lines-between-class-members": [
"warn",
"always",
{ exceptAfterSingleLine: true },
],
"spaced-comment": [
"warn",
"always",
{
line: { markers: ["*package", "!", "/", ",", "="] },
block: {
balanced: true,
markers: [
"*package",
"!",
",",
":",
"::",
"flow-include",
],
exceptions: ["*"],
},
},
],
"no-unexpected-multiline": "warn",
"no-warning-comments": [
"warn",
{ terms: ["FIXME"], location: "anywhere" },
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
args: "after-used",
argsIgnorePattern: "^_",
ignoreRestSiblings: true,
varsIgnorePattern: "^ignored",
},
],
"@typescript-eslint/no-import-type-side-effects": "warn",
"@typescript-eslint/consistent-type-imports": [
"warn",
{
prefer: "type-imports",
disallowTypeAnnotations: true,
fixStyle: "inline-type-imports",
},
],
"@typescript-eslint/no-misused-promises": [
"warn",
{ checksVoidReturn: false },
],
// "symbol-description": "warn",
},
},
]);