4 ms·
A team I'm doing some work with uses eslint and has not configured prettier, so instead of simply having everything get formatted correctly, I get red squiggly
by resters 3y ago
A team I'm doing some work with uses eslint and has not configured prettier, so instead of simply having everything get formatted correctly, I get red squiggly lines under blocks of code because of an omitted meaningless whitespace character.
There are a few linting rules that can help identify semantic errors or dead code, but only a small number of rules are needed to get all of the benefits.
Autoformatting (prettier, gofmt, etc.) is the way to go.
- kitschpatrol 3y agoYou can mellow the squiggles for stylistic errors in VS Code. Take a look at the “eslint.rules.customizations” key in this file: https://github.com/antfu/eslint-config/blob/main/.vscode/settings.json https://github.com/antfu/eslint-config/blob/main/.vscode/set...
- resters 3y agoThank you! I had been wondering if that was possible. Do you know if it can be done only for a single project / directory?
- WorldMaker 3y agoYou can set workspace settings in the top-level .vscode/settings.json file of your project: https://code.visualstudio.com/docs/getstarted/settings#_workspace-settings https://code.visualstudio.com/docs/getstarted/settings#_work...
- mcpeepants 3y agomany (most?) red squiggles are autofixable with eslint. I use eslint exactly like prettier, in that I never think about formatting and everything gets fixed/formatted on save.
- resters 3y agoMany are, but some of the "errors" are not helpful while code is in progress. Why do I need to see them while typing if they can be easily auto-fixed later? It's just more useless visual clutter to worry about.