Visual studio code 如何配置tslint或prettier以删除if/while/for和()之间的空白?

Visual studio code 如何配置tslint或prettier以删除if/while/for和()之间的空白?,visual-studio-code,tslint,prettier,Visual Studio Code,Tslint,Prettier,我正在设置react项目,并使用tslint、prettier和tslint config prettier格式化代码。也可以使用vscode自动格式化 如何删除if/while/for和括号之间的空格,例如“if()”而不是“if()” 我在tslint和prettier中找不到与此相关的选项。但我在埃斯林特找到了。所以我希望tslint和prettier包含一些类似于关键字间距的内容 tslint.json { "extends": ["tslint:recommended", "t

我正在设置react项目,并使用tslint、prettier和tslint config prettier格式化代码。也可以使用vscode自动格式化

如何删除if/while/for和括号之间的空格,例如“if()”而不是“if()”

我在tslint和prettier中找不到与此相关的选项。但我在埃斯林特找到了。所以我希望tslint和prettier包含一些类似于关键字间距的内容

tslint.json

{
    "extends": ["tslint:recommended", "tslint-react", "tslint-config-prettier"],
    "linterOptions": {
        "exclude": [
            "config/**/*.js",
            "node_modules/**/*.ts",
            "coverage/lcov-report/*.js"
        ]
    },
    "rules": {
        "class-name": true,
        "comment-format": [true, "check-space"],
        "curly": true,
        "interface-name": false,
        "interface-over-type-literal": false,
        "jsx-boolean-value": false,
        "no-console": false,
        "no-duplicate-variable": true,
        "no-empty-interface": true,
        "no-internal-module": true,
        "no-var-keyword": true,
        "object-literal-sort-keys": false,
        "ordered-imports": false
    }
}
prettierrc先生

{
    "trailingComma": "es5",
    "tabWidth": 4,
    "semi": true,
    "singleQuote": true,
    "bracketSpacing": true,
    "quotes": true,
    "jsxSingleQuote": false
}
settings.json(在vscode中供参考)

预期:

let i: number = 0;
if(i <= 10) {
    i++;
}
设i:number=0;
如果(i)
let i: number = 0;
if(i <= 10) {
    i++;
}
let i: number = 0;
if (i <= 10) {
    i++;
}