Depending on project settings, it will vary a bit.
e.g. if you have env.es5
set the problem may arise.
This is my setup (I use eslint-config-google
additionally & TS, just omit TS lines if JS only)
{
"env": {
"browser": true,
"node": true
},
"extends": ["eslint:recommended", "google"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"]
}
I did not set anything to VSCode settings about formatting rules but I'm using auto format on save, check:
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"[jsonc]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"editor.formatOnPaste": true,
"editor.formatOnSave": true
}
So instead of proposed ideas like overrriding rules or bypass the whole formatting you simply have to make sure the linter knows what environment it's in and apply those rules.
Prettier isn't the issue here, but if you like to get a .prettierrc
config I've just created a helper package here:
https://github.com/artiphishle/prettierrc