forked from microsoft/TypeScript-Website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.cjs
More file actions
79 lines (78 loc) · 1.72 KB
/
.eslintrc.cjs
File metadata and controls
79 lines (78 loc) · 1.72 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/* eslint-disable */
/*
yarn add --dev @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint typescript
*/
module.exports = {
"root": true,
"env": {
"browser": true,
"commonjs": true,
"es2021": true
},
"parserOptions": {
"ecmaVersion": "latest"
},
"rules": {
"@typescript-eslint/no-unused-vars": ["off"],
},
"overrides": [
{
"files": ["src/**/*.jsx", "src/**/*.mjs", "src/**/*.ts*",],
"excludedFiles": "*.test.js",
"env": {
// "browser": true,
// "es2021": true,
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"react-app",
],
"parser": "@typescript-eslint/parser",
"rules": {
"@typescript-eslint/no-unused-vars": ["off"],
"@typescript-eslint/ban-types": [
"error",
{
"types": {
/**
* 隨便給個什麼值好像就可以禁用了
*/
"{}": false
}
}
],
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/ban-ts-comment": "warn",
// 'react/react-in-jsx-scope':'off',
"no-constant-condition": "off",
"no-var": "off",
"import/first": "off",
"no-restricted-globals": "off",
},
},
{
"files": ["*.test.js",],
// "excludedFiles": "*.test.js",
"env": {
"jest": true,
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"react-app",
// "plugin:react/recommended",
// "plugin:react/jsx-runtime",
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"@typescript-eslint/no-unused-vars": ["off"],
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/ban-ts-comment": "warn",
},
}
]
}