forked from pheralb/svgl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.ts
More file actions
66 lines (62 loc) · 1.86 KB
/
eslint.config.ts
File metadata and controls
66 lines (62 loc) · 1.86 KB
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
import globals from "globals";
import { fileURLToPath } from "node:url";
import { includeIgnoreFile } from "@eslint/compat";
// Plugins:
import js from "@eslint/js";
import ts from "typescript-eslint";
import svelte from "eslint-plugin-svelte";
import prettier from "eslint-config-prettier";
// Svelte Config:
import svelteConfig from "./svelte.config.js";
// Ignore files:
const gitignorePath = fileURLToPath(new URL("./.gitignore", import.meta.url));
export default [
includeIgnoreFile(gitignorePath),
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs.recommended,
prettier,
...svelte.configs.prettier,
{
languageOptions: {
globals: { ...globals.browser, ...globals.node },
parserOptions: {
tsconfigRootDir: fileURLToPath(new URL(".", import.meta.url)),
},
},
rules: {
"no-undef": "off",
"@typescript-eslint/array-type": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/consistent-type-imports": [
"warn",
{ prefer: "type-imports", fixStyle: "inline-type-imports" },
],
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_" },
],
"@typescript-eslint/require-await": "off",
"svelte/no-navigation-without-resolve": "off",
},
},
{
files: ["**/*.svelte", "**/*.svelte.ts", "**/*.svelte.js"],
languageOptions: {
parserOptions: {
projectService: true,
extraFileExtensions: [".svelte"],
parser: ts.parser,
svelteConfig,
},
},
rules: {
"svelte/no-unused-svelte-ignore": "warn",
"svelte/no-useless-mustaches": "warn",
"svelte/require-each-key": "warn",
"svelte/no-at-html-tags": "off",
"svelte/no-navigation-without-resolve": "off",
"svelte/state_referenced_locally": "off",
},
},
];