TSIndexSignature allows to output multiple parameters, this syntax is no longer valid, but typescript produces ast for it
Prettier 1.19.1
Playground link
Input:
source
type foo = {
[a: string, b: string]: string;
}
Output:
type foo = {
[a: stringb: string]: string;
};
Expected behavior:
type foo = {
[a: string, b: string]: string;
}
Additional info
https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/typescript-estree/src/ts-estree/ts-estree.ts#L1336-L1344
export interface TSIndexSignature extends BaseNode {
type: AST_NODE_TYPES.TSIndexSignature;
parameters: Parameter[];
typeAnnotation?: TSTypeAnnotation;
readonly?: boolean;
accessibility?: Accessibility;
export?: boolean;
static?: boolean;
}
TSIndexSignatureallows to output multiple parameters, this syntax is no longer valid, but typescript produces ast for itPrettier 1.19.1
Playground link
Input:
source
Output:
Expected behavior:
Additional info
https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/typescript-estree/src/ts-estree/ts-estree.ts#L1336-L1344