-
Notifications
You must be signed in to change notification settings - Fork 123
/
eslint.config.js
102 lines (100 loc) · 3.45 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
// //@ts-check
import js from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import globals from "globals";
import tsEslint from "typescript-eslint";
import eslintPluginSvelte from "eslint-plugin-svelte";
// import vitest from "eslint-plugin-vitest";
import playwright from "eslint-plugin-playwright";
export default [
js.configs.recommended,
...tsEslint.configs.recommended,
...eslintPluginSvelte.configs["flat/recommended"],
eslintConfigPrettier,
{
...playwright.configs["flat/playwright"],
files: ["**/tests/**"],
},
// vitest.configs.recommended,
...eslintPluginSvelte.configs["flat/prettier"],
{
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
globals: { ...globals.node, ...globals.browser },
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
parser: tsEslint.parser,
extraFileExtensions: [".svelte"],
},
},
rules: {
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_" },
],
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
"@typescript-eslint/unbound-method": "warn",
"@typescript-eslint/require-await": "warn",
"@typescript-eslint/restrict-template-expressions": "warn",
"@typescript-eslint/no-redundant-type-constituents": "off",
"@typescript-eslint/no-unsafe-enum-comparison": "warn",
"@typescript-eslint/no-misused-promises": "warn",
"@typescript-eslint/no-duplicate-enum-values": "warn",
"@typescript-eslint/await-thenable": "warn",
"@typescript-eslint/no-implied-eval": "warn",
"@typescript-eslint/no-base-to-string": "warn",
"@typescript-eslint/no-unused-expressions": "warn",
"@typescript-eslint/no-require-imports": "warn",
},
},
{
ignores: [
"**/postcss.config.cjs",
"web-local/build/*",
"web-common/build/*",
"web-admin/build/*",
"web-common/src/components/modal/*.js",
"**/.svelte-kit/",
"**/node_modules",
"**/playwright.config.js",
"**/svelte.config.js",
"**/gen/*",
"**/.storybook/*",
// generated by nearly
"web-common/src/features/dashboards/url-state/filters/expression.cjs",
],
},
{
files: ["*.js"],
...tsEslint.configs.disableTypeChecked,
},
{
files: ["**/*.svelte"],
rules: {
// ERRORS
"svelte/no-at-debug-tags": "error",
"svelte/valid-prop-names-in-kit-pages": "error",
// WARNINGS (some will be promoted to errors)
"svelte/no-at-html-tags": "warn",
"svelte/no-target-blank": "warn",
"svelte/no-unused-svelte-ignore": "warn",
"svelte/require-each-key": "warn",
"svelte/prefer-destructured-store-props": "warn",
"svelte/require-optimized-style-attribute": "warn",
"svelte/prefer-class-directive": "warn",
"svelte/require-store-reactive-access": "warn",
// "svelte/require-event-dispatcher-types": "warn",
// "svelte/sort-attributes": "warn",
},
},
];