-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.cjs
59 lines (59 loc) · 1.73 KB
/
eslint.config.cjs
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
/* eslint.config.cjs */
// const path = require("path");
const typescriptEslint = require("@typescript-eslint/eslint-plugin");
const typescriptParser = require("@typescript-eslint/parser");
const reactHooks = require("eslint-plugin-react-hooks");
const reactRefresh = require("eslint-plugin-react-refresh");
module.exports = [
{
ignores: ["vite.config.ts", "cypress.config.ts"],
},
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
globals: {
// Equivalent to `env: { browser: true }`
window: "readonly",
document: "readonly",
navigator: "readonly",
console: "readonly",
},
parser: typescriptParser,
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
},
plugins: {
"@typescript-eslint": typescriptEslint,
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"@typescript-eslint/no-non-null-assertion": "off",
"eol-last": "error",
"no-multiple-empty-lines": ["error", { max: 1, maxEOF: 0 }],
semi: ["error", "always"],
quotes: ["error", "double"],
"require-await": "error",
"no-shadow": "off",
"@typescript-eslint/no-shadow": [
"error",
{ builtinGlobals: true, hoist: "all" },
],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-misused-promises": [
"error",
{ checksVoidReturn: { attributes: false } },
],
"react-refresh/only-export-components": "off",
},
},
];