-
-
Notifications
You must be signed in to change notification settings - Fork 228
/
eslint.config.mjs
77 lines (75 loc) · 2 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import eslint from "@eslint/js";
import prettierPlugin from "eslint-plugin-prettier";
import unusedImportsPlugin from "eslint-plugin-unused-imports";
import prettierExtends from "eslint-config-prettier";
import { fixupPluginRules } from "@eslint/compat";
import globals from "globals";
import tseslint from "typescript-eslint";
const globalToUse = {
...globals.browser,
...globals.serviceworker,
...globals.es2021,
...globals.worker,
...globals.node,
};
export default tseslint.config({
extends: [
{
ignores: [
"client/cypress/plugins/index.js",
".lintstagedrc.js",
".next/**/*",
"public/js/*",
".yarn/js/*",
"ui/out/**/*",
"apps/expo/ios/**/*",
"apps/expo/android/**/*",
"electron/build/**/*",
"public/*.js",
"public/*.map",
],
},
prettierExtends,
eslint.configs.recommended,
...tseslint.configs.recommended,
],
settings: {
react: { version: "detect" },
},
plugins: {
prettierPlugin,
"unused-imports": fixupPluginRules(unusedImportsPlugin),
},
rules: {
"prefer-rest-params": "off",
"prefer-const": "error",
"prefer-spread": "off",
"no-case-declarations": "off",
curly: ["error", "all"],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/consistent-type-imports": [
"error",
{
prefer: "type-imports",
},
],
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-use-before-define": ["off"],
"object-shorthand": "error",
"@typescript-eslint/no-unused-vars": [
"warn",
{ varsIgnorePattern: "^_", argsIgnorePattern: "^_", ignoreRestSiblings: true },
],
"unused-imports/no-unused-imports": "error",
},
languageOptions: {
globals: globalToUse,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
});