-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help us choose JS coding standards! #7
Comments
I would suggest Airbnb Javascript Style Guide.
I checked the source code and it seems that PSR-1 basic standard rules were mostly ignored, which violates requirements for PSR-2 / PSR-12. |
Hi @TheDoctor0, Thanks for the feedback! I will run, php-cs-fixer on the current code base, to make sure all code is consisted with psr-1 and psr-2. As I mentions in the contributors guidelines, I haven't really reviewed PSR-12 yet, but I hope to do so in the upcoming days. Are there any tools like php-cs-fixer that can help us fix the current JS code to match the Airbnb style guide? |
Great, I will give it a try. I have also just finished to commit all the changes that the PHP-CS-FIXER applied to the code to make it more compatible to the PSR-1+2. |
@eldadfux I also recommend, like the doctor, on
|
Thanks for the feeback @nati-levi ! seems like airbnb is the industry favourite... |
https://prettier.io/ is also a popular option. It not only lints but reformats, supporting js, css, html, markdown and even php via a plugin. |
Another point to Eslint + Airbnb style guide, most projects today i use it and seems very popular. |
Have had good success working with prettier.io as well (both for PHP and JS). |
Voting for prettier too, ever since it makes code seamless across multiple people, you can set up auto-formatting whenever someone pushes code too which at least standardizes the coding conventions! |
Hi guys! Thanks you all for the great advices! I have just formatted all of our entire JS codebase with prettier thanks to the easy integration with VS Code. The fact that it can also support our PHP codebase can be a great bonus and although the Airbnb standard seems very popular, It seems more logical to go with the open-source project standard. |
Currently we are using the PHP-FIG for our PHP coding standards but we don't have any standards to follow when it comes to JS code writing.
What in your opinion will be most suitable? It is important that the new standards we will use will be popular in the community and will have great good ecosystem around them.
The text was updated successfully, but these errors were encountered: