Aircoookie / WLED

Control WS2812B and many more types of digital RGB LEDs with an ESP8266 or ESP32 over WiFi!
https://kno.wled.ge
MIT License
14.66k stars 3.15k forks source link

Improve and introduce measures for consistent code style #4094

Open Mattstir opened 1 month ago

Mattstir commented 1 month ago

I'm highly passionate about clean code and a consistent code style, so I see this as a great opportunity to enhance WLED. 😉

By introducing ESLint, we can automatically enforce code style during each CI run (and hint at problems during a local npm build), ensuring that future changes adhere to the established guidelines. For now, I've aligned the rules with the suggestions in WLED's CONTRIBUTING.md and made them mandatory. This is now only a basic start, these rules can be easily expanded in the future to include more than just style.

I've also corrected the existing style issues in the .js files and js snippets in html files.

Note: This PR is purely stylistic with no logic changes. I hope you like it! 😄

Mattstir commented 1 month ago

Also note that each style rule got introduced in its own commit so we could easily revert one of them if not wanted ;)

softhack007 commented 1 month ago

@Mattstir interesting idea 😃

Two questions come to my mind:

Mattstir commented 1 month ago

@softhack007 Thanks for your interest :D