Skip to content

Commit

Permalink
style: 增加eslint 缩进强制空格 2 格.并且修改代码
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamondYuan committed Oct 16, 2018
1 parent f4ce9c5 commit d8154d2
Show file tree
Hide file tree
Showing 42 changed files with 1,600 additions and 1,593 deletions.
66 changes: 37 additions & 29 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
module.exports = {
extends: [
'eslint-config-alloy/typescript-react',
],
globals: {
// 这里填入你的项目需要的全局变量
// 这里值为 false 表示这个全局变量不允许被重新赋值,比如:
//
// React: false,
// ReactDOM: false
extends: [
'eslint-config-alloy/typescript-react',
],
globals: {
// 这里填入你的项目需要的全局变量
// 这里值为 false 表示这个全局变量不允许被重新赋值,比如:
//
// React: false,
// ReactDOM: false
},
rules: {
parserOptions: {
ecmaFeatures: {
ts: false
}
},
rules: {
parserOptions: {
ecmaFeatures: {
ts: false
}
},
// 空行不超过一个
"no-multiple-empty-lines": [2, { "max": 1 }],
// 这里填入你的项目需要的个性化配置,比如:
//
// // @fixable 一个缩进必须用两个空格替代
// 'indent': [
// 'error',
// 2,
// {
// SwitchCase: 1,
// flatTernaryExpressions: true
// }
// ]
}
// 空行不超过一个
"no-multiple-empty-lines": [2, { "max": 1 }],
// @fixable 一个缩进必须用两个空格替代
'indent': [
'error',
2,
{
SwitchCase: 1,
flatTernaryExpressions: true
}
],
// @fixable jsx 的 children 缩进必须为两个空格
'react/jsx-indent': [
'error',
2
],
// @fixable jsx 的 props 缩进必须为两个空格
'react/jsx-indent-props': [
'error',
2
]
}
};
44 changes: 22 additions & 22 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"editor.detectIndentation": false,
"eslint.autoFixOnSave": true,
"editor.formatOnSave": true,
"eslint.trace.server": "messages",
"eslint.packageManager": "yarn",
"tslint.enable": false,
"eslint.validate": [
"javascript",
"javascriptreact",
{
"language": "typescript",
"autoFix": true
},
{
"language": "typescriptreact",
"autoFix": true
}
],
"editor.tabSize": 4,
"tslint.autoFixOnSave": true,
"tslint.configFile": "tslint.json",
"files.insertFinalNewline": true
"editor.detectIndentation": false,
"eslint.autoFixOnSave": true,
"editor.formatOnSave": true,
"eslint.trace.server": "messages",
"eslint.packageManager": "yarn",
"tslint.enable": false,
"eslint.validate": [
"javascript",
"javascriptreact",
{
"language": "typescript",
"autoFix": true
},
{
"language": "typescriptreact",
"autoFix": true
}
],
"editor.tabSize": 2,
"tslint.autoFixOnSave": true,
"tslint.configFile": "tslint.json",
"files.insertFinalNewline": true
}
Loading

0 comments on commit d8154d2

Please sign in to comment.