-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.js
100 lines (97 loc) · 2.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
// @ts-check
import globals from "globals";
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import * as svelteParser from "svelte-eslint-parser";
import eslintPluginSvelte from "eslint-plugin-svelte";
import perfectionist from "eslint-plugin-perfectionist";
import unusedImports from "eslint-plugin-unused-imports";
import * as typescriptParser from "@typescript-eslint/parser";
export default tseslint.config(
{ ignores: ["src-tauri/src/script/**/*", "script/**/*"] },
eslint.configs.recommended,
tseslint.configs.recommended,
...eslintPluginSvelte.configs["flat/recommended"],
...eslintPluginSvelte.configs["flat/prettier"],
{
files: ["**/*.svelte"],
languageOptions: {
parser: svelteParser,
parserOptions: {
parser: {
// Specify a parser for each lang.
ts: typescriptParser,
typescript: typescriptParser,
},
project: "./tsconfig.json",
extraFileExtensions: [".svelte"],
},
},
},
{
languageOptions: {
globals: {
...globals.browser,
},
},
},
{
plugins: {
perfectionist,
"unused-imports": unusedImports,
},
rules: {
"no-unused-vars": "off",
"no-undef": "off",
"unused-imports/no-unused-imports": "warn",
"unused-imports/no-unused-vars": [
"off",
{
vars: "all",
varsIgnorePattern: "^_",
args: "after-used",
argsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
args: "none",
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"perfectionist/sort-named-imports": [
"warn",
{
order: "asc",
type: "line-length",
},
],
"perfectionist/sort-named-exports": [
"warn",
{
order: "asc",
type: "line-length",
},
],
"perfectionist/sort-exports": [
"warn",
{
order: "asc",
type: "line-length",
},
],
"perfectionist/sort-imports": [
"warn",
{
order: "asc",
type: "line-length",
newlinesBetween: "always",
internalPattern: ["^~/.*"],
},
],
},
},
);