Skip to content

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

@strutcode

Description

@strutcode

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancement: new base rule extensionNew base rule extension required to handle a TS specific casepackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions