-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
118 lines (106 loc) · 3.02 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
110
111
112
113
114
115
116
117
118
import tanstackQuery from "@tanstack/eslint-plugin-query";
import * as lit from "eslint-plugin-lit";
import { defineConfig, globalIgnores } from "eslint/config";
import * as wc from "eslint-plugin-wc";
import globals from "globals";
import ts_eslint from "typescript-eslint";
import eslint from "@eslint/js";
import { fixupPluginRules } from "@eslint/compat";
import { rules as litA11yRules, configs as litA11yConfigs } from "eslint-plugin-lit-a11y";
export default defineConfig([
globalIgnores(["**/dist/"]),
eslint.configs.recommended,
...ts_eslint.configs.recommendedTypeChecked,
wc.configs["flat/recommended"],
lit.configs["flat/recommended"],
...tanstackQuery.configs["flat/recommended"],
{
plugins: {
"lit-a11y": {
rules: fixupPluginRules(litA11yRules),
},
},
languageOptions: {
globals: {
...globals.browser,
WEAVY_SOURCE_NAME: "readonly",
WEAVY_VERSION: "readonly",
},
ecmaVersion: "latest",
sourceType: "module",
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
...litA11yConfigs.recommended.rules,
"@typescript-eslint/no-unsafe-argument": "warn",
"no-prototype-builtins": "off",
"no-console": ["warn", { allow: ["info", "warn", "error"] }],
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/unbound-method": "warn",
"@typescript-eslint/no-for-in-array": "warn",
"@typescript-eslint/no-empty-object-type": [
"error",
{
allowInterfaces: "always",
},
],
"@typescript-eslint/no-unused-expressions": [
"error",
{
allowShortCircuit: true,
},
],
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-misused-promises": [
"error",
{
checksVoidReturn: {
arguments: false,
inheritedMethods: false
}
}
],
"@tanstack/query/exhaustive-deps": "warn",
"lit-a11y/no-autofocus": "warn",
"lit-a11y/click-events-have-key-events": "warn",
"lit-a11y/anchor-is-valid": "warn",
},
},
{
files: ["cli/**/*.[mc]js", "dev/**/*.{mj,cj,j,t}s"],
languageOptions: {
globals: {
...globals.node,
},
},
},
{
files: ["lib/**/*.cjs", "utils/**/*.{mj,cj,j,t}s"],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
},
{
files: ["tests/**/*.ts"],
rules: {
"@typescript-eslint/no-unused-expressions": "off",
},
},
]);