Closed gabrielmontagne closed 7 years ago
I'm afraid I don't have much to say on the matter, just that: having a coding standard is good (you don't waste time arguing on whitespace); standardjs doesn't have many "offensive" settings (in my particular case the only thing I had to change was the space between the function name and args list); this one is easy to configure, and it has a --fix
option that facilitates the initial migration.
I'm sure there are other coding standards that are as good or bad as this one, some of them might even have great tooling... I just happened to find this one first, via @cristiano-belloni :)
Pretty much what @mamapitufo said. It's handy to agree on a standard linting that's reasonable, widely used and is maintained by not-us + it's actually useful to catch various basic code smells (like unused variables) that hide dead code or typos. I used airbnb's linting at Sky and I hated it: incredibly invasive, used semicolons and was a pain to configure. Standard is pretty much what we normally write, with an additional space between function declaration and params, and with postfix comma. It's easy to setup, you don't need a huge rc file (actually you don't need it at all if you use the provided cli) and it has an active community, so it's well-maintained.
One can never quote enough Fredkin's paradox enough,
The more equally attractive two alternatives seem, the harder it can be to choose between them—no matter that, to the same degree, the choice can only matter less
Plus zero configuration.
Description
Switch to standardjs for format and use it for linting. Lots of silly things (sont variables, etc.) cleaned up along the way. No functional or API changes at all.
Basically ran
standard --fix
until it came out empty.Motivation and Context
From @mamapitufo I learned how to stop worrying about quirky code layouts and love the bomb. In the quest for minimizing the area of code and configuration one needs to tend, this single, pre-configured setup should be the way to go! d3-utils and grid-components should get the treatment soon.
How Was This Tested?
Running all the included examples in the
examples
folder.Types of changes
Checklist: