-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
63 lines (60 loc) · 1.73 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 globals from "globals";
import pluginJs from "@eslint/js";
import pluginReact from "eslint-plugin-react";
export default [
{
ignores: ["**/.next/**"], // Ignorerer .next mapper globalt
},
{ files: ["**/*.{js,mjs,cjs,jsx}"] },
{
files: ["**/*.js"],
languageOptions: { sourceType: "module" },
},
{
files: ["**/*.test.js", "**/*.spec.js", "setup-jest.js"], // Test filer, der matcher Jest tests
languageOptions: {
globals: { ...globals.jest },
},
},
{
languageOptions: { globals: { ...globals.browser, ...globals.node } },
},
pluginJs.configs.recommended,
pluginReact.configs.flat.recommended,
{
settings: {
react: {
version: "detect",
},
},
rules: {
"react/react-in-jsx-scope": "off",
// These rules should probably be enabled when we have the time
"no-unused-vars": "off", //"warn",
"react/prop-types": "off",
"no-constant-condition": "off",
"no-constant-binary-expression": "off",
"no-empty": "off",
"no-unreachable": "off",
"no-loss-of-precision": "off",
"no-useless-escape": "off",
"no-func-assign": "off",
"no-unexpected-multiline": "off",
"no-extra-boolean-cast": "off",
"no-prototype-builtins": "off",
"no-self-assign": "off",
"no-useless-catch": "off",
"no-duplicate-case": "off",
"no-cond-assign": "off",
"no-fallthrough": "off",
"no-control-regex": "off",
"no-unsafe-optional-chaining": "off",
"no-regex-spaces": "off",
"no-empty-pattern": "off",
// These are the most important rules
"no-undef": "error",
"no-redeclare": "warn", // Should probably be set to error
"react/jsx-key": "error",
},
},
];