Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Description
Currently we have the following AST properties declared:
modifiers?:Modifier[]; |
modifiers?:Modifier[]; |
typescript-eslint/packages/ast-spec/src/declaration/TSInterfaceDeclaration/spec.ts
Line 14 in8329498
implements?:TSInterfaceHeritage[]; |
typescript-eslint/packages/ast-spec/src/declaration/TSInterfaceDeclaration/spec.ts
Line 15 in8329498
abstract?:boolean; |
These all represent bad code that would cause errors if one attempted to build in TS:
public enum Foo {}// 'public' modifier cannot appear on a module or namespace element.(1044)abstract namespace Bar {}// 'abstract' modifier can only appear on a class, method, or property declaration.(1242)interface Baz implements Bam {}// Interface declaration cannot have 'implements' clause.(1176)abstract interface Bam {}// 'abstract' modifier can only appear on a class, method, or property declaration.
TS parses these fine and emits a semantic error, not a syntactic error.
Our parser currently does not error on syntactically bad code, thus we also don't error on it (#1852).
We should remove these properties from the AST as it is non-sensical to include them - nobody should ever be inspecting the code that is produced on them.