-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
87 lines (82 loc) · 2.47 KB
/
Copy patheslint.config.js
File metadata and controls
87 lines (82 loc) · 2.47 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import { includeIgnoreFile } from "@eslint/compat";
import js from "@eslint/js";
import prettier from "eslint-config-prettier";
import perfectionist from "eslint-plugin-perfectionist";
import svelte from "eslint-plugin-svelte";
import globals from "globals";
import { fileURLToPath } from "node:url";
import ts from "typescript-eslint";
import svelteConfig from "./svelte.config.js";
const gitignorePath = fileURLToPath(new URL("./.gitignore", import.meta.url));
export default ts.config(
includeIgnoreFile(gitignorePath),
js.configs.recommended,
...ts.configs.strict,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
},
perfectionist.configs["recommended-alphabetical"],
{
rules: Object.fromEntries(
[
"classes",
"enums",
"exports",
"interfaces",
"imports",
"named-exports",
"modules",
"named-imports",
"object-types",
"objects",
"variable-declarations",
].map((rule) => [
`perfectionist/sort-${rule}`,
[
"error",
{
partitionByComment: "^@sort",
},
],
]),
),
},
...svelte.configs.all,
{
rules: {
"svelte/block-lang": [
"error",
{
script: ["ts"],
},
],
"svelte/consistent-selector-style": "off",
"svelte/experimental-require-strict-events": "off",
"svelte/no-inline-styles": "off",
"svelte/no-navigation-without-base": "off",
"svelte/no-top-level-browser-globals": "off",
"svelte/no-unused-class-name": "off",
"svelte/require-optimized-style-attribute": "off",
"svelte/valid-compile": "off",
},
},
{
files: ["**/*.svelte", "**/*.svelte.ts", "**/*.svelte.js"],
ignores: ["eslint.config.js", "svelte.config.js"],
languageOptions: {
parserOptions: {
extraFileExtensions: [".svelte"],
parser: ts.parser,
projectService: true,
svelteConfig,
},
},
},
prettier,
...svelte.configs.prettier,
);