opendevleague / bunkernz

Open-source web RPG
http://bunker.nz
MIT License
4 stars 3 forks source link

Integrate Eslint and Style Opinion Rules #3

Closed stephencorwin closed 4 years ago

stephencorwin commented 4 years ago

I was browsing the wiki and noticed this document: https://github.com/opendevleague/bunkernz/wiki/Coding-Guidelines

Asking contributors to learn your coding style is something I will always have a problem with. Instead, write an eslint config to automatically fix (husky) and enforce these rules so that contributors can simply contribute without considering style. There is no reason in 2020 that we need to be cognizant about the specific opinions that one developer has vs another.

Side Note: The wiki itself is breaking its own guidelines in the example given.

For example, (x) => x + x is wrong but the following are correct:
x => x + x
- (x,y) => x + y
+ (x, y) => x + y
<T>(x: T, y: T) => x === y

Parenthesized constructs should have no surrounding whitespace. A single space follows commas, colons, and semicolons in those constructs. For example:

stephencorwin commented 4 years ago

Okay... I swear that this didn't exist when I started typing up this issue... 👀 image

In any case, you might want to still fix the wiki example. ¯_(ツ)_/¯