Typescript VSCode-代码格式中的行分隔方式错误

Typescript VSCode-代码格式中的行分隔方式错误,typescript,visual-studio-code,format,Typescript,Visual Studio Code,Format,我正在使用最新版本(1.29.0)的VSCode来处理Angular 6项目(当然是typescript文件)。 当我在.ts文件中格式化代码时,“导入”命令下的每个组件都显示在单独的一行上(不管导入的组件/模块数量如何,即使只有一个) 例如: import { Component, OnInit, Input, ViewChild, ViewChildren, QueryList, ElementRef } from "@a

我正在使用最新版本(1.29.0)的VSCode来处理Angular 6项目(当然是typescript文件)。 当我在.ts文件中格式化代码时,“导入”命令下的每个组件都显示在单独的一行上(不管导入的组件/模块数量如何,即使只有一个)

例如:

import {
     Component,
     OnInit,
     Input,
     ViewChild,
     ViewChildren,
     QueryList,
     ElementRef
}
from "@angular/core";
interface myObject {
     prop1: {
          id: number;
          type: number;
          inner: {
               inner_inner: {
                    prop11: number;
                    prop22: number;
               }
          }
     }
     ;
     data: {
          id: string;
          type: string;
          groupId?: string;
          name: string;
          isSelected: boolean;
     }
     ;
}
我如何禁用它,并在一行中获得所有这些

顺便说一句,以下代码显示在一行中:

import * as Types from "@cc/my-types";
此外,在代码中的某些位置,格式化程序将“;”字符定位在对象定义后的单独一行中

例如:

import {
     Component,
     OnInit,
     Input,
     ViewChild,
     ViewChildren,
     QueryList,
     ElementRef
}
from "@angular/core";
interface myObject {
     prop1: {
          id: number;
          type: number;
          inner: {
               inner_inner: {
                    prop11: number;
                    prop22: number;
               }
          }
     }
     ;
     data: {
          id: string;
          type: string;
          groupId?: string;
          name: string;
          isSelected: boolean;
     }
     ;
}
当我在.ts文件中格式化代码时,“导入”命令下的每个组件都显示在单独的一行上

默认情况下,TypeScript和VSCode都不会执行此操作

解决方案 禁用vscode中的所有扩展,然后逐个启用它们以查找罪魁祸首。然后移除罪犯,或阅读其文档


很可能它的
vscode更漂亮

您是否安装了更漂亮的扩展(或类似的扩展)?如果是这样,请禁用它并查看是否仍在进行重新格式化。