-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy path.eslintrc.js
67 lines (61 loc) · 1.88 KB
/
.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
module.exports = {
"parser": "babel-eslint",
"extends": "airbnb",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"plugins": [
"react",
"react-native",
"jsx-a11y",
"import"
],
"rules": {
// see http://eslint.cn/docs/rules/
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"no-alert": "off",
// 不限制箭头函数体使用大括号,但是参数必须用括号包裹(arrow-parens)
"arrow-body-style": "off",
// 开启时,单参数不加括号
"arrow-parens": "off",
// 关闭限制不同操作符
"no-mixed-operators": "off",
// 非空文件末尾不强制保留一行空行
"eol-last": "off",
// 去掉块声明间距的限制
"padded-blocks": "off",
// 不禁止使用 ++ 和 --
"no-plusplus": "off",
// 按需添加基数 parseInt('071', 8)
"radix": ["error", "as-needed"],
"no-lonely-if": "off",
"no-restricted-syntax": "off",
// 不强制驼峰
"camelcase": "off",
"quote-props": "off",
// 箭头函数支持返回赋值,如ref={r => this.xx = r}
"no-return-assign": "off",
"react/require-default-props": "off",
// 无状态函数组件允许不定义props类型
"react/prop-types": "off",
"no-unused-expressions": ["error", { "allowShortCircuit": true }],
"global-require": "off",
// 允许函数声明不按顺序
"react/sort-comp": "off",
// alert
"no-undef": "off",
"no-bitwise": "off",
"no-param-reassign": "off",
// 花括号空格
"object-curly-spacing": "off",
"guard-for-in": "off",
"max-len": ["error", 120],
"import/prefer-default-export": "off",
"import/no-unresolved": "off",
}
};
// see more detail https://github.com/Kennytian/learning-react-native/blob/master/environment/react-native-eslint.md