-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy patheslint.config.js
40 lines (37 loc) · 1012 Bytes
/
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
import path from "path";
import reactPlugin from "eslint-plugin-react";
import { includeIgnoreFile } from "@eslint/compat";
import globals from "globals";
import pluginReactHooks from "eslint-plugin-react-hooks";
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
const gitignorePath = path.resolve(import.meta.dirname, ".gitignore");
export default tseslint.config(
includeIgnoreFile(gitignorePath),
eslint.configs.recommended,
tseslint.configs.recommended,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
settings: {
react: {
version: "detect",
},
},
},
reactPlugin.configs.flat.recommended, // This is not a plugin object, but a shareable config object
reactPlugin.configs.flat["jsx-runtime"],
{
plugins: {
"react-hooks": pluginReactHooks,
},
rules: {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
},
},
);