-
-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] not working with eslint 6 #870
Comments
Need this ASAP! |
any luck on this? it's a critical issue to be honest |
I’ve ended up removing the extension and I am using https://github.com/prettier/eslint-plugin-prettier instead. |
running |
Maybe change to |
@jimblue Where is that In
|
I tried creating a fresh project to reproduce, and I'm now getting a different error message:
eslintrc:
Running with |
Oh, this seems to be caused by a known issue with |
As mentioned above, there is an upstream dependancy on the prettier eslint module. It is not yet compatible with eslint 6. see: prettier/prettier-eslint#222 |
After investigating these issues we are considering removing support for linters in version 2.0.0. Instead of incorporating the linters into this extension the proposal is to use the ESLint or TSLint extensions along with this extension. Please let us know what you think by commenting on #901. By using the official extensions issues like these will be centralized and fixed more quickly as the authors of those extensions are focusing solely on those linters. |
Here is a good article explaining the type of setup that is recommended going forward: https://dorshinar.me/linting-your-react+typescript-project-with-eslint-and-prettier |
More discussion also in #922 |
Until this is fixed in the extension if anyone is relying on the eslint-vscode extension and wishes to setup a keybinding to "format" (well, fixing with eslint, but in most cases it's formatting anyway) you could set a keybindg in your vscode with for more info about this refeer to |
How I've sorted it after having super huge frustrations with Prettier stopping working.
This sorted the problem for me magically. It looks that VS Code had other options for formatting not only Prettier but did not show any error or notification so you can choose from. I hope it helps others too! |
3.6.0 and 3.7.0 are ok! But it seems like the same problem is back in 3.8.0 today. Or even a similar problem. Can you guys take a look? Output with 3.6.0 and 3.7.0:
Output with 3.8.0:
|
Same problem with 3.11.0 here. |
ESLint 6 is NOT supported by this extension at the moment. I won’t spend time on this until the upstream libraries officially support ESLint 6. Once prettier/prettier-eslint#222 is resolved I will work on this bug. |
|
Then I add This is my current config, tested on MacOS with: VSCode: 1.41.1 {
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"editor.action.formatDocument": true
}
} |
I can't thank you enough. I was going almost crazy with the settings. It actually magically solved it. Thank you x100 |
It seems like |
I couldn't get @kebot's workaround to work on the latest extension and vscode versions. So I published a small extension to run 'Format Document' as a codeAction: https://github.com/rohit-gohri/vscode-format-code-action/ Along with the latest VS Code update, which allows setting order of Example here: #1277 (comment) |
This comment has been minimized.
This comment has been minimized.
Linting integration has been removed from this extension. If you want to run prettier and ESlint together you should use the ESLint extension instead. See: https://github.com/prettier/prettier-vscode#linter-integration |
Hi,
When using the option eslint-integration, Prettier is not working and output the following error:
ENOENT/home/dev/frontend/webpacker/app/index.js:: no such file or directory, open '/home/dev/projects/frontend/node_modules/eslint/lib/linter.js'
I've check in my node_modules and effectively,
linter.js
doesn't exist.It was previously working with eslint version 5 because
linter.js
did exist at this path here.But in eslint version 6, linter.js has been moved in a subfolder here.
That's why it's actually broken.
So basically all you have to do is to modify the require:
from:
to:
Cheers
The text was updated successfully, but these errors were encountered: