-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[semi] incorrectly requires semicolon after export default interface
#123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The base rule has a specific case for We might have to override the rule for this one. Temp workaround is to define your interface separately: interface Foo {}
export default Foo; |
@bradzacher could this possibly be fixed in eslint by making the |
Probably would fix it, but the problem is:
We can bring this rule internally and extend its so that it works for TS nodes. |
I don't suppose this is related to eslint/eslint#9399 is it? I'm seeing it in my app too. export default interface AudioFactory{
getSong(id: string): Promise<Song>;
}; I get |
Fixed by #461 |
I've tried:
Unfortunately, none of which work. Is something missing? |
https://github.com/typescript-eslint/typescript-eslint/releases Hasn't been released to master yet. |
@bradzacher tried |
@bjerkins - you still have the base semi rule turned on, which is what causes the first error. the second one might be a bug, but it's hard to tell because you've clipped the code out. |
I had the same problem as @bjerkins and just confirmed adding the following from @bradzacher's link fixed it. Thanks, Brad! "semi": "off",
"@typescript-eslint/semi": ["error"] |
why have you got both?
This will ofc cause a problem because both rules are going to try and add a semi. Please read the rule doc, which tells you to explicitly NOT do this. |
sorry for deleting my last comment... just figured out what I'm messing with and didn't see someone already seen and replied lol ... |
What code were you trying to parse?
What did you expect to happen?
semi
should ignore the interface block.What actually happened?
semi
wants a semicolon after the block, which then triggers theno-extra-semi
rule.It works fine without
default
:Versions
@typescript-eslint/parser
1.0.0
TypeScript
3.2.4
ESLint
5.12.1
node
11.7.0
npm
6.5.0
The text was updated successfully, but these errors were encountered: