分享學(xué)到的 TS 規(guī)范梭伐,以后就按這個(gè)要求自己
記得裝 tslint-config-airbnb-base
, tslint-react
(--dev)
// tslint.json
{
"extends": ["tslint-config-airbnb-base", "tslint-react"],
"rules": {
"ter-indent": [
true,
4,
{
"SwitchCase": 1,
"FunctionExpression": {
"parameters": 1,
"body": 1
}
}
],
"no-unnecessary-else": false,
"ter-max-len": false,
"no-empty": false,
"no-magic-numbers": false,
"jsx-wrap-multiline": false,
"jsx-no-multiline-js": false,
"jsx-no-lambda": false,
"jsx-alignment": false,
"jsx-no-string-ref": false,
"variable-name": false,
"ter-arrow-body-style": false,
"object-literal-sort-keys": false,
"no-console": [true, "warn", "error"],
"comment-format": [false, "check-space"],
"no-namespace": false,
"interface-name": false,
"no-shadowed-variable": false,
"one-variable-per-declaration": false,
"no-unused-expression": [true, "allow-fast-null-checks"],
"radix": false,
"only-arrow-functions": false,
"member-ordering": false,
"trailing-comma": false,
"ordered-imports": false,
"no-bitwise": false,
"no-var-requires": false,
"quotemark": [
true,
"double",
"avoid-escape"
]
}
}