Javascript 如何强制执行多行“;如果;使用eslint在Typescript中设置缩进条件?
我正在尝试用Typescript配置eslint,以支持Java的多行Javascript 如何强制执行多行“;如果;使用eslint在Typescript中设置缩进条件?,javascript,typescript,eslint,typescript-eslint,Javascript,Typescript,Eslint,Typescript Eslint,我正在尝试用Typescript配置eslint,以支持Java的多行if缩进标准 作为记录,Java标准规定用于复杂ifs的多行if条件应缩进两次: if( a>=MIN&&a=MIN&&b { "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended" ], "env": { "browser": true, "mocha": true }, "par
if
缩进标准
作为记录,Java标准规定用于复杂if
s的多行if
条件应缩进两次:
if(
a>=MIN&&a=MIN&&b
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"env": {
"browser": true,
"mocha": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2015,
"sourceType": "module",
"project": "tsconfig.json"
},
"plugins": [
"@typescript-eslint/eslint-plugin"
],
"rules": {
/* here goes more rules */
"@typescript-eslint/indent": ["warn", "tab", { "MemberExpression": 2, "CallExpression": {"arguments": 2}, "SwitchCase": 1, "FunctionExpression": {"body": 1, "parameters": 2} }]
/* more rules here too */
}
}