Skip to content
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

[semi] Won't trigger on semicolons after overrides #4317

Closed
nartallax opened this issue Dec 16, 2021 · 0 comments · Fixed by #4318
Closed

[semi] Won't trigger on semicolons after overrides #4317

nartallax opened this issue Dec 16, 2021 · 0 comments · Fixed by #4318
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@nartallax
Copy link

  • [+] I have tried restarting my IDE and the issue persists.
  • [+] I have updated to the latest version of the packages.
  • [+] I have read the FAQ and my problem is not listed.

Rule @typescript-eslint/semi (and @typescript-eslint/member-delimiter-style) seem to completely ignore semicolons after method override without implementation.

.eslintrc.js:

module.exports = {
  root: true,
  parser: "@typescript-eslint/parser",
  plugins: [
    "@typescript-eslint",
  ],
  extends: [
    "eslint:recommended",
    "plugin:@typescript-eslint/recommended",
  ],
  rules: {
    // ... other rules
    "semi": "off",
    "@typescript-eslint/member-delimiter-style": ["warn", {
      multiline: {delimiter: "none"}, 
      singleline: {delimiter: "comma", requireLast: false}
    }],
    "@typescript-eslint/semi": ["warn", "never"]
  }
}

Example code:

export class Cls {
	action(): void;
	action(value: string): void;
	action(value?: string): void {
		console.log(value)
	}
}

Expected Result

All the semicolons in the example code above should trigger warning.

Actual Result
No warning is produced for any of the semicolons.

Additional Info
No errors/exceptions appear in eslint logs, other rules work fine, these two rules also work fine in other cases.

Versions

package version
@typescript-eslint/eslint-plugin 5.7.0
@typescript-eslint/parser 5.7.0
TypeScript 4.5.4
ESLint 8.4.1
node 16.13.0
@nartallax nartallax added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Dec 16, 2021
@bradzacher bradzacher added accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working and removed triage Waiting for maintainers to take a look labels Dec 16, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants