Implement ESLint/Prettier + EditorConfig
Fixes: #49 (closed)
Problem
We need a .editorconfig
and also add ESLint/Prettier rule to standardize the code smell and code style of our JavaScript and CSS files.
Solve
- Install basic package for .editorconfig and add basic rule for
.js/.css/.scss
file useidentsize = 2
- Install basic package for ESLint, I originally think about using extension like Airbnb config rule, but it will cause the whole code have to be changed, or I have to disable a lot of rule, so I just add basic rule and warn some of the rule like
"no-unused-vars":"warn"
to make sure everything is right. - Add basic
prettierrc
rule with single quote on.
It's just some basic setup, if you guys think there are any rules that needed to be add, I will update this.
Also if there's anything wrong with the way I set up, please review and I can change it. Thanks!!