This repository was archived by the owner on Jan 19, 2019. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 75
Class body has invalid range that breaks brace-style rule #152
Labels
Comments
This also effects typescript 2.0.3 with master. Will submit pull request with fix. |
Thanks so much for your efforts, @soda0289! I've been so swamped in January but things are set to improve from next week. |
soda0289
added a commit
to soda0289/typescript-eslint-parser
that referenced
this issue
Feb 1, 2017
The range of a class body should be from the opening brace to the closing brace. To find the opening brace the ast converter parses over modifiers of the class declaration and assumes it is the last token after the last node modifier. This assumption is not always true when the class is exported. This commit ensures we only skip over modifiers which are after the class name or heritage clause.
soda0289
added a commit
to soda0289/typescript-eslint-parser
that referenced
this issue
Feb 1, 2017
The range of a class body should be from the opening brace to the closing brace. To find the opening brace the ast converter parses over modifiers of the class declaration and assumes it is the last token after the last node modifier. This assumption is not always true when the class is exported. This commit ensures we only skip over modifiers which are after the class name or heritage clause.
soda0289
added a commit
to soda0289/typescript-eslint-parser
that referenced
this issue
Feb 7, 2017
…) (eslint#153) The range of a class body should be from the opening brace to the closing brace. To find the opening brace the ast converter parses over modifiers of the class declaration and assumes it is the last token after the last node modifier. This assumption is not always true when the class is exported. This commit ensures we only skip over modifiers which are after the class name or heritage clause.
soda0289
added a commit
to soda0289/typescript-eslint-parser
that referenced
this issue
Feb 7, 2017
…slint#152) When a class with a generic definition is exported we must take the type parameters into account when finding the opening brace. This continues the fix of pull request eslint#153 and handles the case of exporting a class with generics. We now find the last type parameter and use the succeeding token as the opening brace.
soda0289
added a commit
to soda0289/typescript-eslint-parser
that referenced
this issue
Feb 7, 2017
…slint#152) When a class with a generic definition is exported we must take the type parameters into account when finding the opening brace. This continues the fix of pull request eslint#153 and handles the case of exporting a class with generics. We now find the last type parameter and use the succeeding token as the opening brace.
soda0289
added a commit
to soda0289/typescript-eslint-parser
that referenced
this issue
Feb 7, 2017
…nt#152) When a class with a generic definition is exported we must take the type parameters into account when finding the opening brace. This continues the fix of pull request eslint#153 and handles the case of exporting a class with generics. We now find the last type parameter and use the succeeding token as the opening brace.
soda0289
added a commit
to soda0289/typescript-eslint-parser
that referenced
this issue
Feb 7, 2017
…nt#152) When a class with a generic definition is exported we must take the type parameters into account when finding the opening brace. This continues the fix of pull request eslint#153 and handles the case of exporting a class with generics. We now find the last type parameter and use the succeeding token as the opening brace.
JamesHenry
pushed a commit
that referenced
this issue
Feb 10, 2017
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I noticed on the newer version of eslint (3.14) that the brace style rule fails on exported classes. The opening brace variable used in the rule is incorrect since it is pointing to the identifier 'hello'. I believe the class body node's range is wrong and is still including the identifier. Have not tested on typescript 2.0.3. Will try and submit pr with fix.
What version of TypeScript are you using?
2.1.3
What version of
typescript-eslint-parser
are you using?ts-2.1
What code were you trying to parse?
What did you expect to happen?
Should parse correctly with brace-style 1tbs
What happened?
Failed with error:
2:14 error Statement inside of curly braces should be on next line brace-style
The text was updated successfully, but these errors were encountered: