-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy patheslint.config.js
53 lines (52 loc) · 1.34 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
import globals from "globals";
import pluginJs from "@eslint/js";
import pluginReact from "eslint-plugin-react";
import pluginJest from "eslint-plugin-jest";
import pluginReactHooks from "eslint-plugin-react-hooks";
/** @type {import('eslint').Linter.Config[]} */
export default [
{ files: ["**/*.{js,mjs,cjs,jsx}"] },
{ languageOptions: { globals: globals.browser } },
{
settings: {
react: {
version: "detect",
},
},
},
pluginJs.configs.recommended,
pluginReact.configs.flat.recommended,
{
rules: {
"react/prop-types": "off",
},
},
{
plugins: {
"react-hooks": pluginReactHooks,
},
rules: {
"react/react-in-jsx-scope": "off",
...pluginReactHooks.configs.recommended.rules,
},
ignores: ["*.test.tsx"],
},
{
files: ["**/*.spec.js", "**/*.test.js"],
plugins: { jest: pluginJest },
languageOptions: {
globals: pluginJest.environments.globals.globals,
},
rules: {
"jest/no-conditional-expect": "error",
"jest/no-disabled-tests": "error",
"jest/no-done-callback": "error",
"jest/no-duplicate-hooks": "error",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "error",
"jest/prefer-todo": "error",
"jest/prefer-to-have-length": "warn",
"jest/valid-expect": "error",
},
},
];