I am working on an Angular project in VS Code, using the "Prettier" plugin for code formatting, and the ESLint/TSLint plugins for standards enforcement.
I know this isn't an "error" but I strongly prefer clean builds and like to remove warnings whenever possible.
groupMouseDown = d => {
...
}; <--- This semicolon is the issue
The above is a function in Typescript, using the "fat arrow" syntax so that the function is inline. Notice that, at the end of the line, is a semi-colon.
I'm not here to start an argument about whether or not the semi-colon should be here, there are lots of those on the web. Rather, I just need to deal with it.
Prettier is considered an "opinionated" formatter, and their stance on the subject is that they believe it should be there. Which is fine, but they also refuse to add an option to NOT put it there, hence the "opinionated' part.
The linters on the other hand, believe that a semicolon should NOT be there, and so they flag it as an unnecessary semicolon. So far, I have not found an option to NOT report this as a warning unless I remove it for every case.
So, at the end of the day, I have to tools the disagree and leave me with no options to just ignore this and do what I want them to do, which is play nicely together.
Has anyone else come up against this? Is there a way to either: 1) Stop prettier from adding the semicolon ONLY IN THIS SPECIFIC CASE, or... 2) Stop the linters from reporting this as a warning ONLY IN THIS SPECIFIC CASE?
What I DON'T want to do is tell Prettier to not put ANY semicolons where needed, nor do I want to tell the linters to ignore ALL unnecessary semicolons.