Skip to content

[semi] Doesn't seem to apply to class members #409

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
strutcode opened this issue Apr 5, 2019 · 1 comment · Fixed by #461
Closed

[semi] Doesn't seem to apply to class members #409

strutcode opened this issue Apr 5, 2019 · 1 comment · Fixed by #461
Labels
bug Something isn't working enhancement: new base rule extension New base rule extension required to handle a TS specific case package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@strutcode
Copy link

strutcode commented Apr 5, 2019

Repro

{
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "project": "./tsconfig.json"
  },
  "plugins": [
    "@typescript-eslint"
  ],
  "extends": [
    "airbnb-base",
    "plugin:@typescript-eslint/recommended"
  ],
  "rules": {
    "semi": ["error", "never"],
  }
}
import { FreeCamera } from 'babylonjs'

export default class PanCamera extends FreeCamera {
  public invertX: boolean = false // valid
  public invertY: boolean = false; // also valid

  public pan(deltaX: number, deltaY: number): void {
    this.position.x += deltaX * (this.invertX ? -1 : 1) // valid
    this.position.y += deltaY * (this.invertY ? -1 : 1); // invalid
  }
}

Expected Result
Error for semi on line 5 (invertY)

Actual Result
Nothing

Additional Info
I want to disallow semicolons globally in my Typescript project, but I noticed that the rule isn't being applied to class members. It works in other places in the same file but not for that specific case.

Versions

package version
@typescript-eslint/eslint-plugin 1.6.0
@typescript-eslint/parser 1.6.0
TypeScript 3.4.1
ESLint 5.3.0
node 9.11.2
npm 5.6.0
@strutcode strutcode added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Apr 5, 2019
@bradzacher
Copy link
Member

more than likely related to #123, #366

@bradzacher bradzacher added bug Something isn't working and removed triage Waiting for team members to take a look labels Apr 6, 2019
@bradzacher bradzacher added the enhancement: new base rule extension New base rule extension required to handle a TS specific case label Apr 23, 2019
@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
bug Something isn't working enhancement: new base rule extension New base rule extension required to handle a TS specific case 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