-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy patheslint.config.js
More file actions
50 lines (49 loc) · 1.31 KB
/
eslint.config.js
File metadata and controls
50 lines (49 loc) · 1.31 KB
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
const eslint = require("@eslint/js");
const { fixupPluginRules } = require("@eslint/compat");
const globals = require("globals");
const babelParser = require("@babel/eslint-parser");
const react = require("eslint-plugin-react");
const reactHooks = require("eslint-plugin-react-hooks");
const jest = require("eslint-plugin-jest");
const jestDom = require("eslint-plugin-jest-dom");
const testingLibrary = require("eslint-plugin-testing-library");
/** @type {import("eslint").Linter.FlatConfig[]} */
module.exports = [
eslint.configs.recommended,
{
files: ["**/*.{js,jsx}"],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
APP_NAME: "readonly",
APP_VERSION: "readonly",
},
parser: babelParser,
},
plugins: {
react: react,
"react-hooks": reactHooks,
},
rules: {
...react.configs.recommended.rules,
...reactHooks.configs.recommended.rules,
},
settings: {
react: {
version: "detect",
},
},
},
{
files: ["**/*.test.{js,jsx}"],
...jest.configs["flat/recommended"],
...jestDom.configs["flat/recommended"],
plugins: {
"testing-library": fixupPluginRules({ rules: testingLibrary.rules }),
},
rules: {
...testingLibrary.configs.react.rules,
},
},
];