You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
The eslint config of webportal is out-dated for a long time. As a result, the code format and style check does not work as expected when new codes come in. It has several drawbacks include:
The code format style was not strict and fixed, so most prs have to include some format changes like space indent, new line change etc., which increases the hardness of code review and decreases code readability.
The CI process in github missed some linting errors. In fact, when I corrected the eslint config file, there are almost 2000 format errors in webportal files of master branch.
The style is hard to be consistent between new comers and existing codes.
After few days’ investigation on many open source projects, I proposed a new eslint guidline in webportal, which could improve code readability significantly. And currently the major changes are:
Update eslint version from 4.18.2 to 6.1.0. The new eslint version has several big improvement in react and javascript code style, and it also deprecates many old rules. For rule deprecation: https://eslint.org/docs/user-guide/rule-deprecation
Introduce prettier tools to format code. The prettier is the most popular and convenient tool for code format and has perfect cooperation with most editors like VS Code. Use prettier to format code and add it into eslint rules will largely improve the work productivity and save developers from formatting. More details: https://prettier.io/docs/en/index.html
Use standard style instead of google eslint config. First of all, the eslint-config-google has few activity and updates recently and few focuses and discussions. It still includes some rules which has been deprecated by eslint. And from my investigation, hardly few open source projects utilize this config. Instead, standard is a public acknowledged style which accepted by more and more major projects. More details: https://github.com/standard/eslint-config-standard . Below is the graph about google vs standard
Remove semi-colon at end of line. First of all, it has exactly no diff whether there is a semi at the end of line or not. It brings a intense debate about whether to add a semi or remove it. I don’t want to introduce all the discussion about it, however I prefer that the code is more clean without this semi. And it seems to become a trend to remove semi from javascript. If anyone has a different idea, I am happily and readily to be connected and see if we need to change this rule.
The text was updated successfully, but these errors were encountered:
The eslint config of webportal is out-dated for a long time. As a result, the code format and style check does not work as expected when new codes come in. It has several drawbacks include:
After few days’ investigation on many open source projects, I proposed a new eslint guidline in webportal, which could improve code readability significantly. And currently the major changes are:
The text was updated successfully, but these errors were encountered: