-
Notifications
You must be signed in to change notification settings - Fork 4
/
eslint.config.mjs
63 lines (60 loc) · 2.69 KB
/
eslint.config.mjs
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
import eslintConfigPrettier from "eslint-config-prettier";
import eslintPluginSvelte from 'eslint-plugin-svelte';
import tsLint from "typescript-eslint";
import jsLint from "@eslint/js";
import vitest from "eslint-plugin-vitest";
import globals from "globals";
export default [{
ignores: ["node_modules/", "dist/", "build/", "coverage/", "public/", "svelte/vite.config.js"],
},
jsLint.configs.recommended,
...tsLint.configs.recommended,
...eslintPluginSvelte.configs['flat/recommended'],
eslintConfigPrettier,
vitest.configs.recommended,
...eslintPluginSvelte.configs["flat/prettier"],
{
rules: {
"no-bitwise": ["error"],
// there is a misconception between esLint and svelte compiler
// rules that are necessary for compiler, throw errors in esLint
// need to be revised with next version of toolchain
"svelte/no-unused-svelte-ignore": "off",
"svelte/valid-compile": "off",
// Ignore unused vars starting with _
// "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
// // Turn off the need for explicit function return types
// "@typescript-eslint/explicit-function-return-type": "off",
// // Warn when "any" type is used
"@typescript-eslint/no-explicit-any": "off",
// // Warn on @ts-ignore comments
// "@typescript-eslint/ban-ts-comment": "warn",
// // Public methods should have return types
// "@typescript-eslint/explicit-module-boundary-types": "error",
},
},
{
languageOptions: {
globals: { ...globals.browser, ...globals.es2022 },
ecmaVersion: 2022,
sourceType: "module",
parserOptions: {
extraFileExtensions: [".svelte"],
warnOnUnsupportedTypeScriptVersion: false,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: ["**/*.svelte"],
rules: {
"@typescript-eslint/no-unused-expressions": "off"
}
},
{
// temporarily ignore cypress folder
ignores: [
"**/cypress/"
]
}
];