-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.flat.config.js
48 lines (47 loc) · 1.39 KB
/
eslint.flat.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
import globals from "globals";
import js from "@eslint/js";
import ts from "@typescript-eslint/eslint-plugin";
import svelte3 from "eslint-plugin-svelte3";
import tsParser from "@typescript-eslint/parser";
import typescript from "typescript";
/** @type {import("eslint").Linter.FlatConfig[]} */
export default [
{
ignores: [".svelte-kit/*"]
},
js.configs.recommended,
{
languageOptions: {
parser: tsParser,
parserOptions: {
sourceType: "module",
ecmaVersion: 2020
},
globals: {
...globals.node,
...globals.es2017
}
},
plugins: {
"@typescript-eslint": ts,
"svelte3": svelte3
},
settings: {
"svelte3/typescript": () => typescript
},
rules: {
...ts.configs.recommended.rules,
...ts.configs["eslint-recommended"].rules,
"indent": ["error", 4, { "SwitchCase": 4 }],
"arrow-spacing": ["error", { before: true, after: true }],
"arrow-parens": ["error", "always"],
"quotes": ["error", "double"],
"semi": ["error", "always"],
"object-curly-spacing": ["error", "always", { "objectsInObjects": false }]
}
},
{
files: ["*.svelte"],
processor: "svelte3/svelte3"
}
];