-
Notifications
You must be signed in to change notification settings - Fork 27
Description
In our front, a lot of arrays and objects declarations could be wrapped on one line, but are extended on many lines.
It increases the number of lines in files
(Even if I think it's more readable (And big blocks can be wrapped/collapsed by click in IDEs), I understand the need).
Formatting can be done using IDE parameters, but we want to be objective and format the code automatically.
So, maybe a lint rule can do the job
Here: https://github.com/TERITORI/teritori-dapp/blob/main/.eslintrc.js#L93-L98
I propose to add these two rules:
"array-bracket-newline": ["error", "consistent"],
"object-curly-newline": ["error", "never"]
(Not fully tested, not tested in CI)
Then, the code is formatted automatically in CI, using our config https://github.com/TERITORI/teritori-dapp/blob/main/.github/workflows/js.yml#L25
Or manually, using our scripts: https://github.com/TERITORI/teritori-dapp/blob/main/package.json#L12-L13
==> Should we make a PR that format the tens of files after manually triggering a yarn lint-fix? Or should we make a PR that just add these rules ?
Cf this comment on a PR: #1477 (comment)

