-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy patheslint.config.js
More file actions
90 lines (89 loc) · 2.56 KB
/
eslint.config.js
File metadata and controls
90 lines (89 loc) · 2.56 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
88
89
90
import "eslint-plugin-only-warn";
import js from "@eslint/js";
import ts from "typescript-eslint";
import prettier from "eslint-config-prettier";
import svelte from "eslint-plugin-svelte";
import globals from "globals";
export default ts.config(
{
ignores: [
".svelte-kit",
".vercel",
"build",
"node_modules",
"package",
"vite.config.ts.timestamp-*.mjs",
],
},
{
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
globals: {
...globals.browser,
sveltify: true,
hooks: true,
react: true,
},
parserOptions: {
parser: ts.parser,
extraFileExtensions: [".svelte"],
project: "tsconfig.eslint.json",
},
},
},
js.configs.recommended,
ts.configs.eslintRecommended,
...ts.configs.recommendedTypeChecked,
...ts.configs.stylisticTypeChecked,
...svelte.configs["flat/recommended"],
prettier,
...svelte.configs["flat/prettier"],
{
rules: {
"@typescript-eslint/consistent-type-definitions": ["warn", "type"],
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-shadow": "warn",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{ ignoreRestSiblings: true, argsIgnorePattern: "^_+$" },
],
curly: "warn",
eqeqeq: "warn",
"no-console": ["warn", { allow: ["info", "warn", "error"] }],
"no-useless-rename": "warn",
"object-shorthand": "warn",
"prefer-const": "off",
"prefer-template": "warn",
"svelte/block-lang": ["warn", { script: "ts" }],
"svelte/no-at-html-tags": "off",
"svelte/prefer-const": ["warn", { destructuring: "all" }],
"svelte/require-each-key": "off",
"@typescript-eslint/no-unsafe-call": 0,
"@typescript-eslint/no-unsafe-return": 0,
"@typescript-eslint/no-unsafe-argument": 0,
},
},
{
files: ["src/routes/**/*.ts", "src/routes/**/*.svelte"],
rules: {
// ESLint is not aware of the generated ./$types and reports false positives
"@typescript-eslint/no-unsafe-argument": 0,
"@typescript-eslint/no-unsafe-call": 0,
},
},
{
files: ["**/*.cjs"],
rules: {
// Allow require() in CommonJS modules.
"@typescript-eslint/no-require-imports": "off",
},
},
{
files: ["**/*.cjs", "**/*.js", "**/*.server.ts"],
languageOptions: { globals: globals.node },
},
);