Skip to content

[semi] does not detect missing semicolons in interface definitions or in/around type aliases #714

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

Closed
lucaswerkmeister opened this issue Jul 17, 2019 · 3 comments
Labels
package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin working as intended Issues that are closed as they are working as intended

Comments

@lucaswerkmeister
Copy link
Contributor

Repro

{
  "rules": {
    "semi": ["error", "always"]
  }
}
interface I {
    f(): void // <-- no comma
}

type foo = {
    bar: string // <-- no comma
    baz: number // <-- no comma
} // <-- no comma

Expected Result

Errors on all the marked lines. (I wasn’t sure whether to expect a semicolon after the type alias at first, but it looks like an assignment and the TypeScript handbook puts semicolons there.)

Actual Result

No errors.

Additional Info

This was already brought up by @bkucera in #461 (comment); @bradzacher suggested raising a concrete issue, which as far as I can tell wasn’t done so far, so here it is.

Versions

package version
@typescript-eslint/eslint-plugin 1.12.1-alpha.5
@typescript-eslint/parser 1.12.0
TypeScript 3.5.3
ESLint 6.0.1
node 12.6.0
npm 6.9.0
@lucaswerkmeister lucaswerkmeister added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Jul 17, 2019
@bradzacher bradzacher added working as intended Issues that are closed as they are working as intended and removed triage Waiting for team members to take a look labels Jul 17, 2019
@bradzacher
Copy link
Member

This is expected.

Please use @typescript-eslint/member-delimiter-style to decide what delimiters should be used within type/interfaces.
Please use @typescript-eslint/semi to support checking for semis at the end of typescript specific statements.

@lucaswerkmeister
Copy link
Contributor Author

What about the missing semicolon after the type alias? I assume that’s not covered by member-delimiter-style. (But thanks for the pointer!)

@lucaswerkmeister
Copy link
Contributor Author

I’ve also opened #715, perhaps that helps to prevent someone else from making the same mistake as me :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin working as intended Issues that are closed as they are working as intended
Projects
None yet
Development

No branches or pull requests

2 participants