Hacker News new | ask | show | jobs
by resters 852 days 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.

2 comments

You 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/set...

Thank you! I had been wondering if that was possible. Do you know if it can be done only for a single project / directory?
You can set workspace settings in the top-level .vscode/settings.json file of your project: https://code.visualstudio.com/docs/getstarted/settings#_work...
many (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.
Many 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.