Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/468.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何强制执行多行“;如果;使用eslint在Typescript中设置缩进条件?_Javascript_Typescript_Eslint_Typescript Eslint - Fatal编程技术网

Javascript 如何强制执行多行“;如果;使用eslint在Typescript中设置缩进条件?

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

我正在尝试用Typescript配置eslint,以支持Java的多行
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 */
  }
}