-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy patheslint.config.js
81 lines (80 loc) · 2.24 KB
/
eslint.config.js
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
import { fixupPluginRules } from "@eslint/compat";
import eslint from "@eslint/js";
import importPlugin from "eslint-plugin-import";
import libramPlugin from "eslint-plugin-libram";
import reactHooksPlugin from "eslint-plugin-react-hooks";
import unusedImports from "eslint-plugin-unused-imports";
import globals from "globals";
// eslint-disable-next-line import/no-unresolved
import tseslint from "typescript-eslint";
export default [
eslint.configs.recommended,
...tseslint.configs.recommended,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,
{
ignores: ["node_modules/", "build/", "types/"],
},
{
languageOptions: {
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
globals: { ...globals.browser },
},
plugins: {
"react-hooks": fixupPluginRules(reactHooksPlugin),
libram: libramPlugin,
"unused-imports": unusedImports,
},
rules: {
"block-scoped-var": "error",
curly: ["error", "multi-line"],
"eol-last": "error",
eqeqeq: "error",
"import/default": "off", // performance in editor
"import/namespace": "off", // performance in editor
"import/order": [
"error",
{
alphabetize: {
caseInsensitive: true,
order: "asc",
},
named: true,
"newlines-between": "always",
},
],
"no-trailing-spaces": "error",
"no-var": "error",
"prefer-arrow-callback": "error",
"prefer-const": "error",
"prefer-template": "error",
"spaced-comment": ["error", "always", { markers: ["/"] }],
"unused-imports/no-unused-imports": "error",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/ban-ts-comment": "off",
"react-hooks/exhaustive-deps": [
"error",
{
additionalHooks: "(useNag)",
},
],
"libram/verify-constants": "error",
},
},
{
files: ["KoLmafia/**/*.js"],
languageOptions: {
globals: {
...globals.commonjs,
},
},
rules: {
"@typescript-eslint/no-require-imports": "off",
},
},
];