forked from equinor/witsml-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
68 lines (66 loc) · 1.98 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
const eslint = require("@eslint/js");
const tsEslint = require("typescript-eslint");
const globals = require("globals");
const tsEslintParser = require("@typescript-eslint/parser");
const tsEslintPlugin = require("@typescript-eslint/eslint-plugin");
const reactPlugin = require("eslint-plugin-react");
module.exports = tsEslint.config(
eslint.configs.recommended,
...tsEslint.configs.recommended,
{
settings: {
react: {
version: "detect"
}
},
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
parser: tsEslintParser,
globals: {
...globals.browser,
...globals.node,
...globals.jest,
React: "readonly",
HeadersInit: "readonly",
RequestInit: "readonly",
NodeJS: "readonly",
JSX: "readonly",
vi: "readonly"
}
},
files: ["**/*.ts", "**/*.tsx"],
plugins: {
"@typescript-eslint": tsEslintPlugin,
"react": reactPlugin
},
rules: {
"react-hooks/exhaustive-deps": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-duplicate-enum-values": "off",
"no-unused-vars": "off", //we want to ignore this and handle unused vars by @typescript-eslint plugin rule
"no-console": ["error", { allow: ["warn", "error"] }],
"react/prop-types": 1,
"no-empty-pattern": "off"
}
},
// standalone global ignores config due to default behaviour of minimal matching strategy
{
ignores: [
"**/*.config.js",
"**/*.config.ts",
"node_modules",
"**/bin",
"**/.idea",
"**/dist",
"**/out",
"**/obj"
]
}
);