Skip to content

Commit 31a8090

Browse files
committed
react用的tslint
1 parent f04bd1f commit 31a8090

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,6 @@
6464
* [Vue i18n工具](./gist/lang.js)
6565
* [Vue 入口main文件配置](./gist/main.js)
6666
* [Vue 统一表格注入](./gist/table.js)
67+
* [React下自己使用的TSlint](./gist/tslint.json)
6768

6869

docs/常用正则.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
用户名: /^[a-z0-9_-]{3,16}$/
2+
密码: /^[a-z0-9_-]{6,18}$/
3+
非法字符: /[^`~!@#$%^&*()_+<>?:"{},.\/;'[\]]/

gist/tslint.json

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"extends": ["tslint-config-standard", "tslint-react", "tslint-config-prettier"],
3+
"linterOptions": {
4+
"exclude": [
5+
"config/**/*.js",
6+
"node_modules/**/*.ts"
7+
]
8+
},
9+
"rules": {
10+
"no-console": false,
11+
"ordered-imports": false,
12+
"jsx-no-lambda": false,
13+
"no-unsafe-any": false,
14+
"no-unused-variable": false,
15+
"no-unused-expression": false,
16+
"use-default-type-parameter": false,
17+
"no-inferrable-types": false,
18+
"no-floating-promises": false,
19+
"no-trailing-whitespace": true,
20+
"ter-indent": [ true, 2,
21+
{
22+
"SwitchCase": 1
23+
}
24+
],
25+
"one-line": [
26+
true,
27+
"check-open-brace",
28+
"check-catch",
29+
"check-else",
30+
"check-whitespace"
31+
],
32+
"indent": [true, "spaces"],
33+
"whitespace": [
34+
true,
35+
"check-branch",
36+
"check-decl",
37+
"check-operator",
38+
"check-separator",
39+
"check-type"
40+
]
41+
}
42+
}

0 commit comments

Comments
 (0)