-
Notifications
You must be signed in to change notification settings - Fork 14
/
eslint.config.js
132 lines (131 loc) · 3.35 KB
/
eslint.config.js
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
import jsLint from "@eslint/js";
import commentsPlugin from "eslint-plugin-eslint-comments";
import importPlugin from "eslint-plugin-import";
import litPlugin from "eslint-plugin-lit";
import prettierRecommendedConfig from "eslint-plugin-prettier/recommended";
import wcPlugin from "eslint-plugin-wc";
import { config, configs as tsLintConfigs } from "typescript-eslint";
export default config(
jsLint.configs.recommended,
...tsLintConfigs.recommendedTypeChecked,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,
litPlugin.configs["flat/recommended"],
wcPlugin.configs["flat/recommended"],
prettierRecommendedConfig,
{
ignores: ["**/*.test.ts"],
files: ["*.ts"],
},
{
languageOptions: {
parserOptions: {
tsconfigRootDir: import.meta.dirname,
project: true,
projectService: {
defaultProject: "./tsconfig.json",
allowDefaultProject: ["playground/vite.config.ts"],
},
sourceType: "module",
},
},
},
{
plugins: {
"eslint-comments": commentsPlugin,
},
rules: {
"eslint-comments/disable-enable-pair": "error",
"eslint-comments/no-aggregating-enable": "error",
"eslint-comments/no-duplicate-disable": "error",
"eslint-comments/no-unlimited-disable": "error",
"eslint-comments/no-unused-enable": "error",
"eslint-comments/no-unused-disable": "error",
},
},
{
rules: {
"no-alert": "error",
"no-console": "warn",
"prefer-const": "error",
"default-case": "error",
"eol-last": "error",
"object-shorthand": "error",
"require-atomic-updates": "error",
"no-unused-private-class-members": "warn",
"no-promise-executor-return": "error",
"no-unmodified-loop-condition": "warn",
eqeqeq: ["error", "smart"],
"no-duplicate-imports": [
"error",
{
includeExports: true,
},
],
"@typescript-eslint/unbound-method": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/consistent-type-imports": [
"error",
{
fixStyle: "inline-type-imports",
},
],
"padding-line-between-statements": [
"error",
{
blankLine: "always",
prev: [
"const",
"let",
"var",
"directive",
"import",
"function",
"class",
"block",
"block-like",
"multiline-block-like",
],
next: "*",
},
{
blankLine: "any",
prev: ["import"],
next: ["import"],
},
{
blankLine: "any",
prev: ["directive"],
next: ["directive"],
},
{
blankLine: "any",
prev: ["const", "let", "var"],
next: ["const", "let", "var"],
},
{
blankLine: "always",
prev: ["multiline-const", "multiline-let"],
next: "*",
},
],
},
settings: {
"import/resolver": {
typescript: {
project: "tsconfig.json",
},
},
},
},
{
files: ["*.js", "*.mjs"],
...tsLintConfigs.disableTypeChecked,
},
);