create-web3-dapp icon indicating copy to clipboard operation
create-web3-dapp copied to clipboard

[DOCUMENTATION] Coding style guidelines for contributions

Open Eversmile12 opened this issue 2 years ago • 1 comments

It would be great to have fixed guidelines for common patterns and syntax.

  1. Don't think we should create new guidelines, we can borrow the ones from Google or AirBnB.
  2. Linter needs to be setup to follow the guidelines
  3. It would be great to have linter on PR request/merge -> Issue about linter and testing on PRs

Think it might be a good first issue.

Eversmile12 avatar Sep 14 '22 06:09 Eversmile12

I propose the Airbnb one: widespread, plus 95% of the rules are justified imo, and they are not so hard to follow in the end.

These guidelines are for JS, but, even if there are not any for TS from Airbnb, I guess the plugin will do the job most of the time (for a separate issue)

It's easy to setup with ESlint and also has a powerful autolinter. Might be a great idea to implement precommit hooks with possible npm run lint:fix, which won't allow you to commit if some rules aren't followed. I guess, this can work in sense of applying some style guidelines in practice lol (also for a separate issue)

butovsky avatar Sep 15 '22 20:09 butovsky

why don't we use StandardJs to follow KISS principle and it will be more easier that way... i wanted to give a suggestion

Lavishq avatar Nov 03 '22 07:11 Lavishq

Hey @Eversmile12, has someone already written the docs for this? I know some devs who'd be interested in working on this.

Thanks!

ef3n9r98 avatar Dec 02 '22 17:12 ef3n9r98