Thanks to visit codestin.com
Credit goes to github.com

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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
({abstract method(){}})

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions packages/typescript-estree/src/check-modifiers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,18 @@ export function checkModifiers(node: ts.Node): void {
);
}
}

// There are more cases in `checkGrammarObjectLiteralExpression` in TypeScript.
// We may add more validations for them here in the future.
if (
modifier.kind === SyntaxKind.AbstractKeyword &&
node.kind === SyntaxKind.MethodDeclaration &&
node.parent.kind === SyntaxKind.ObjectLiteralExpression
) {
throwError(
modifier,
`'${ts.tokenToString(modifier.kind)}' modifier cannot be used here.`,
);
}
}
}