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
Description
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
Labels
No labels