Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/typescript-eslint-parser/src/visitor-keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const visitorKeys = eslintVisitorKeys.unionWith({
TSLiteralType: ['literal'],
TSIntersectionType: ['types'],
TSIndexedAccessType: ['indexType', 'objectType'],
TSIndexSignature: ['typeAnnotation', 'parameters'],
TSIndexSignature: ['parameters', 'typeAnnotation'],
TSInterfaceBody: ['body'],
TSInterfaceDeclaration: ['id', 'typeParameters', 'extends', 'body'],
TSInterfaceHeritage: ['expression', 'typeParameters'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110090,7 +110090,6 @@ Object {
27,
],
"type": "TSIndexSignature",
"typeAnnotation": null,
},
],
"range": Array [
Expand Down
13 changes: 8 additions & 5 deletions packages/typescript-estree/src/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null {
return [];
}
return parameters.map(param => {
const convertedParam = convertChild(param) as ESTreeNode;
const convertedParam = convertChild(param)!;
if (!param.decorators || !param.decorators.length) {
return convertedParam;
}
Expand Down Expand Up @@ -1881,8 +1881,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null {
case SyntaxKind.JsxFragment:
Object.assign(result, {
type: AST_NODE_TYPES.JSXFragment,
openingFragment: convertChild((node as ts.JsxFragment).openingFragment),
closingFragment: convertChild((node as ts.JsxFragment).closingFragment),
openingFragment: convertChild(node.openingFragment),
closingFragment: convertChild(node.closingFragment),
children: node.children.map(convertChild)
});
break;
Expand Down Expand Up @@ -2248,10 +2248,13 @@ export default function convert(config: ConvertConfig): ESTreeNode | null {
case SyntaxKind.IndexSignature: {
Object.assign(result, {
type: AST_NODE_TYPES.TSIndexSignature,
parameters: node.parameters.map(convertChild),
typeAnnotation: node.type ? convertTypeAnnotation(node.type) : null
parameters: node.parameters.map(convertChild)
});

if (node.type) {
result.typeAnnotation = convertTypeAnnotation(node.type);
}

if (hasModifier(SyntaxKind.ReadonlyKeyword, node)) {
result.readonly = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109676,7 +109676,6 @@ Object {
27,
],
"type": "TSIndexSignature",
"typeAnnotation": null,
},
],
"range": Array [
Expand Down