-
Notifications
You must be signed in to change notification settings - Fork 109
/
.eslintrc.js
44 lines (44 loc) · 941 Bytes
/
.eslintrc.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
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
// 即prettier-> eslint-config-prettier
extends: [
"airbnb",
"eslint:recommended",
"plugin:prettier/recommended",
"plugin:import/errors",
"plugin:import/typescript",
"prettier",
"plugin:storybook/recommended",
],
// 解析器支持新语法
parserOptions: {
// 指定ECMAScript的版本 或者年份
ecmaVersion: 11,
// 默认为script
sourceType: "module",
// 额外的语言特性
ecmaFeatures: {
// 启用JSX
jsx: true,
},
},
plugins: ["react", "react-hooks", "prettier"],
/**
* "off" or 0 - 关闭规则
* "warn" or 1 - 开启warning
* "error" or 2 - 开启error
*/
rules: {},
// overrides:可以为某个文件或者某组文件进行覆盖配置
overrides: [],
settings: {
react: {
pragma: "React",
version: "detect",
},
},
};