-
Notifications
You must be signed in to change notification settings - Fork 5
/
eslint.config.js
60 lines (59 loc) · 1.46 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
import js from "@eslint/js";
import tsParser from "@typescript-eslint/parser";
import eslintPluginSvelte from "eslint-plugin-svelte";
import globals from "globals";
import svelteParser from "svelte-eslint-parser";
import tsEslint from "typescript-eslint";
export default [
js.configs.recommended,
...tsEslint.configs.strict,
...eslintPluginSvelte.configs["flat/recommended"],
...eslintPluginSvelte.configs["flat/prettier"],
{
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{ ignoreRestSiblings: true },
],
// TODO for the reason of next 2 rules see https://github.com/eslint/eslint/issues/19134#issuecomment-2480588649
"@typescript-eslint/no-unused-expressions": [
"error",
{
allowShortCircuit: true,
allowTernary: true,
},
],
"@typescript-eslint/no-empty-function": [
"error",
{ allow: ["arrowFunctions"] },
],
},
},
{
ignores: [
"dist/",
"dist.svelte/",
".svelte-kit/",
"replace-env-vars.js",
"eslint.config.js",
"svelte.config.js",
],
},
{
files: ["**/*.svelte"],
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: {
...globals.browser,
RequestInit: false,
},
parser: svelteParser,
parserOptions: {
parser: tsParser,
// project: true,
extraFileExtensions: [".svelte"],
},
},
},
];