Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
64 lines (63 loc) · 2.09 KB
/
Copy patheslint.config.js
File metadata and controls
64 lines (63 loc) · 2.09 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
import js from "@eslint/js";
import ts from "typescript-eslint";
import svelte from "eslint-plugin-svelte";
import globals from "globals";
import svelteConfig from "./svelte.config.js";
// Replaces the airbnb-base setup, which has no flat-config support and is
// unmaintained, and eslint-plugin-svelte3, which does not understand Svelte 5.
// Only the rules that were customised before are carried over.
export default ts.config(
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs.recommended,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
// Substituted by Vite's `define`; declared for TS in src/vite-env.d.ts.
// no-undef is off for .ts through typescript-eslint but still on in
// .svelte, so it has to be named here too.
__GIT_COMMIT_HASH__: "readonly",
},
},
rules: {
"max-len": ["error", 170, 2, {
ignoreUrls: true,
ignoreComments: false,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
}],
"no-console": "off",
quotes: ["error", "double", { allowTemplateLiterals: true }],
"@typescript-eslint/no-explicit-any": "off",
// The only {@html} sources are this repo's own locale files and the
// legend markup built in the scale components; none of it is user input.
"svelte/no-at-html-tags": "off",
"@typescript-eslint/no-unused-vars": ["error", {
argsIgnorePattern: "^_",
varsIgnorePattern: "^_|^Sl",
}],
},
},
{
files: ["**/*.svelte", "**/*.svelte.ts"],
languageOptions: {
parserOptions: {
projectService: true,
extraFileExtensions: [".svelte"],
parser: ts.parser,
svelteConfig,
},
},
},
{
// Generated from the backend's OpenAPI schemas; not ours to lint.
ignores: ["dist/", "src/api/generated/", "functions/", "public/"],
},
{
// What a failed UI run leaves behind: Playwright's report and traces.
ignores: ["playwright-report/", "test-results/", "blob-report/"],
},
);