-
Notifications
You must be signed in to change notification settings - Fork 2
/
eslint.config.mjs
109 lines (107 loc) · 2.89 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
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
// @ts-check
import eslint from "@eslint/js";
import pluginStylistic from "@stylistic/eslint-plugin";
import pluginSimpleImportSort from "eslint-plugin-simple-import-sort";
import globals from "globals";
import tseslint from "typescript-eslint";
export default tseslint.config(
{
name: "exuanbo/languages",
languageOptions: {
ecmaVersion: 2022,
globals: globals.es2022,
},
},
{
name: "exuanbo/ignores",
ignores: [".yarn", "coverage", "dist", "docs"],
},
{
name: "exuanbo/files",
files: ["**/*.?(c|m){j,t}s"],
},
{
name: "exuanbo/eslint",
extends: [
{
name: "eslint/recommended",
...eslint.configs.recommended,
},
],
rules: {
"no-param-reassign": "error",
},
},
{
name: "exuanbo/typescript",
extends: tseslint.configs.recommendedTypeChecked,
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ["eslint.config.mjs"],
},
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"@typescript-eslint/consistent-type-exports": "error",
"@typescript-eslint/consistent-type-imports": ["error", {
fixStyle: "inline-type-imports",
}],
"@typescript-eslint/no-import-type-side-effects": "error",
"@typescript-eslint/no-namespace": ["error", {
allowDeclarations: true,
}],
// HACK: https://github.com/jsr-io/jsr/issues/780
"@typescript-eslint/no-unnecessary-type-assertion": ["error", {
typesToIgnore: ["Type<null>", "Type<undefined>"],
}],
"@typescript-eslint/no-unused-expressions": ["error", {
allowShortCircuit: true,
}],
"@typescript-eslint/no-unused-vars": ["error", {
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
}],
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-function-type": "off",
"@typescript-eslint/no-unsafe-return": "off",
"no-var": "off",
},
},
{
name: "simple-import-sort/all",
plugins: {
"simple-import-sort": pluginSimpleImportSort,
},
rules: {
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
},
},
{
name: "exuanbo/stylistic",
extends: [
{
name: "stylistic/recommended",
...pluginStylistic.configs.customize({
flat: true,
arrowParens: true,
blockSpacing: false,
jsx: false,
quotes: "double",
semi: true,
}),
},
],
rules: {
"@stylistic/object-curly-spacing": ["error", "never"],
"@stylistic/spaced-comment": ["error", "always", {
exceptions: ["@__PURE__", "@__NO_SIDE_EFFECTS__"],
}],
},
},
);