Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Unnecessary semicolon issue #263

Closed
Closed
@farzadmf

Description

@farzadmf

Hi,

I'm having an issue with class-level arrow functions, e.g.:

class MyComponent extends React.Component<...> {
  doSomthing = () => {
    /* ... */
  }
}

I'm also using VSCode and prettier extension. When I run the Format Document command in VSCode, it seems that prettier is doing the formatting (or another extension), but this arrow function will end up having a semicolon at the end:

class MyComponent extends React.Component<...> {
  doSomthing = () => {
    /* ... */
  };
}

VSCode highlights this semicolon as an error, and when I run my application, it's complaining about Unnecessary semicolon.

Looking at tslint repo, I tried to change the behavior by changing my tslint.json to this:

"rules": {
    "semicolon": [true, "always", "ignore-bound-class-methods"],
}

After doing that, my VSCode editor no longer sees the semicolon as an error, but I still get the Unnecessary semicolon when running the application

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions