-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.js
82 lines (74 loc) · 2.04 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
import tseslint from "typescript-eslint";
// @ts-expect-error No types available
import importPlugin from "eslint-plugin-import";
import stylistic from "@stylistic/eslint-plugin";
import svelte from "eslint-plugin-svelte";
import svelteConfig from "./svelte.config.js";
export default tseslint.config([
{ ignores: [".svelte-kit/", "build/"] },
// TypeScript
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true
}
}
},
// Stylistic
...tseslint.configs.stylisticTypeChecked,
stylistic.configs.customize({
arrowParens: true,
braceStyle: "1tbs",
commaDangle: "never",
jsx: false,
quotes: "double",
semi: true
}),
// Import
importPlugin.flatConfigs.recommended, // eslint-disable-line @typescript-eslint/no-unsafe-member-access
importPlugin.flatConfigs.typescript, // eslint-disable-line @typescript-eslint/no-unsafe-member-access
{
settings: {
"import/resolver": {
typescript: {}
},
"import/parsers": {
"@typescript-eslint/parser": [".js", ".mjs", ".cjs", ".ts"]
}
}
},
// Svelte
...svelte.configs.recommended,
{
files: ["**/*.svelte", "**/*.svelte.ts", "**/*.svelte.js"],
languageOptions: {
parserOptions: {
extraFileExtensions: [".svelte"],
parser: tseslint.parser,
svelteConfig
}
}
},
// Rules
{
rules: {
// TypeScript
"@typescript-eslint/no-unused-vars": ["error", {
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_"
}],
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"no-console": "error",
// Import
"import/no-named-as-default-member": "off",
// Stylistic
"@stylistic/yield-star-spacing": ["error", "after"],
"@stylistic/multiline-ternary": "off",
"@stylistic/no-mixed-operators": "off",
"@stylistic/quote-props": ["error", "as-needed"]
}
}
]);