Extension 'ESLint' cannot format '*.tsx'
See original GitHub issueHello, I’m getting this error once I save my .tsx
(react) file:
Extension 'ESLint' cannot format 'file.tsx'
@ the statusbar. The output window of eslint reports no errors / warnings, both with debug on & off.
My stuff:
- eslint config: https://github.com/sarpik/eslint-config-sarpik
- vscode-eslint config: https://github.com/sarpik/eslint-config-sarpik/blob/master/README.md#with-vs-code
- full vscode’s setup: https://gist.github.com/sarpik/de9160a0602463fb752f2d84d7aa4fd8 via https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync (don’t override your own settings though)
- example repo in where this occurs: https://github.com/sarpik/turbo-schedule (
./client/
) (note that I’m using the global~/.eslintrc.js
file - I don’t have one in the project yet (though I don’t know how if CRA has it by default)).
system & vscode:
$ uname -a
Linux arch-usb 5.4.3-arch1-1 #1 SMP PREEMPT Fri, 13 Dec 2019 09:39:02 +0000 x86_64 GNU/Linux
$ vscodium --version
1.41.0
9579eda04fdb3a9bba2750f15193e5fafe16b959
x64
$ code-insiders --version
1.42.0-insider
e74405d11443c5361c31e2bc341866d146eee206
x64
.ts
files work just fine.
Edit:
Demo: https://github.com/sarpik/cra-ts-vscode-eslint-broken-demo
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Extension 'eslint' is configured as formatter but it cannot format ...
I was fighting with this for a while, turns out you need to head to Settings , under User go to Extensions >...
Read more >Auto Format with ESLint and Prettier for React TypeScript Project
This error means linter cannot resolve tsx file without .tsx extension. So if you write it with ./App.tsx , you can avoid it....
Read more >How to Format Code on Save in VS Code with ESlint
I've read my fair share of posts on what you'd think would be a simple task: how to format code on save in...
Read more >jsEnable": true ). eslint - ADocLib
Extension eslint cannot format /[id]/index.tsx files. The command to format code is not using ESLint yet, it uses VSCode's own formatter (or another...
Read more >Developers - Extension eslint cannot format .../[id]/index.tsx files -
Extension eslint cannot format . ... I use eslint as a formatter for .tsx? files but it is unable to format files that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Formatter is set correctly, as indicated by the error message
Extension 'ESLint' cannot format ...
and running
npx eslint --fix nameOfFile.ts
also works so eslint config is clearly good.And both Eslint and extension host output/logs are empty. So no idea what to do next…
ESLint itself is very sensitive when it comes to global configuration and installs. In principal the eslint module and all plugins need to be installed either globally or locally. This is why they mainly recommend local installs.
The extension should actully react to changes in the
.eslintrc
configuration file if it is part of the workspace. I tested this and it does work for me. Anything special you can remember here?The VS Code eslint plugin uses the ESLint npm module and hence is
bound
to their behavior and I don’t want to change this. Major reason is that otherwise linting in VS Code will produce other results than linting in the terminal.Bottom line: if it works in the terminal but not in VS Code it is a bug. If it doesn’t work in both it is expected 😃.