generated from OLILHR/sveltekit-static-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
81 lines (80 loc) · 2.21 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
import js from "@eslint/js";
import tsPlugin from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import sveltePlugin from "eslint-plugin-svelte";
import svelteParser from "svelte-eslint-parser";
import prettierConfig from "eslint-config-prettier";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import importPlugin from "eslint-plugin-import";
export default [
js.configs.recommended,
{
files: ["**/*.{js,ts,svelte}"],
plugins: {
"@typescript-eslint": tsPlugin,
svelte: sveltePlugin,
"simple-import-sort": simpleImportSort,
import: importPlugin,
},
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: 2020,
sourceType: "module",
extraFileExtensions: [".svelte"],
},
globals: {
// Browser globals
window: "readonly",
document: "readonly",
console: "readonly",
fetch: "readonly",
setTimeout: "readonly",
clearTimeout: "readonly",
Blob: "readonly",
URL: "readonly",
URLSearchParams: "readonly",
HTMLDivElement: "readonly",
CustomEvent: "readonly",
// DOM types
Event: "readonly",
EventTarget: "readonly",
HTMLElement: "readonly",
HTMLInputElement: "readonly",
HTMLSelectElement: "readonly",
MouseEvent: "readonly",
// Node.js globals
process: "readonly",
},
},
rules: {
...tsPlugin.configs.recommended.rules,
...sveltePlugin.configs.recommended.rules,
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
"svelte/no-at-html-tags": "off",
"no-undef": "error",
"@typescript-eslint/no-unused-expressions": [
"error",
{
allowShortCircuit: true,
allowTernary: true,
allowTaggedTemplates: true,
},
],
},
},
{
files: ["**/*.svelte"],
languageOptions: {
parser: svelteParser,
parserOptions: {
parser: tsParser,
},
},
},
prettierConfig,
];