I opened a js file with ES7 property initializers and am getting squiggly lines:
class AppContainer extends Component {
static propTypes = {
history: PropTypes.object.isRequired,
routes: PropTypes.object.isRequired,
store: PropTypes.object.isRequired
}
The error says:
[js] 'property declarations' can only be used in a .ts file.
I am curious how to fix this, of course. But I am more curious how to debug what is giving this error? This is one of the more frustrating parts of some editors, understanding what is deciding that your code is wrong.
Is it VS or a plugin? linter? compiler?
I did see this question, but that only seems to be for es6. Also this question is about the eslint plugin, not core vs code.
As for fixing it, I did find some advice for jsconfig.json
and tried setting the compilerOptions to target es7 (no go there). It looks like you add specific eslint settings, but again, who wins? The linter? Internal compilers?
So, the two questions:
- How do you know which extension is triggering an error (vscode, linter, jsx, etc...)?
- How do I fix this one?
Thanks