Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

no-empty raises lint error for empty blocks with a comment in it #274

Closed
Retsam opened this issue May 17, 2017 · 2 comments
Closed

no-empty raises lint error for empty blocks with a comment in it #274

Retsam opened this issue May 17, 2017 · 2 comments

Comments

@Retsam
Copy link

Retsam commented May 17, 2017

What version of TypeScript are you using?
2.2.2

What version of typescript-eslint-parser are you using?
2.1.0

What code were you trying to parse?

try {
    codeThatMightThrowAnError();
} catch(err) {
    //Intentionally swallow error
}

What did you expect to happen?
No error; no-empty doesn't error if there's a comment in the empty block, see the eslint documentation for no-empty.

What happened?
Linter failed with "error Empty block statement"

@soda0289
Copy link
Member

Thanks for the report.

This has been fixed in ESLint v4. We have moved the comment attachment logic into the new version of ESLint. This will help reduce the complexity of this parser and should allow it to behave the same as the other eslint parsers when handling comments. Check this issue for more details: #5

@JamesHenry
Copy link
Member

This should no longer be an issue in ESLint v4 (the current stable version)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants