-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add linting step to make ui for consistent code quality #1219
Comments
I want to solve this issue. |
It is meaningless to add lint in the build phase, because the build product will be compressed, and it is meaningful in the development and submission phase. At the beginning, we ran lint through husky's pre-commit phase during the submission phase, so as to ensure the agreed code style. Later, the verification was canceled due to some other reasons. |
@shuashuai Thanks for the feedback! I understand that linting in the build phase may not be as useful since the build product is compressed. However, adding linting to the build process ensures it's always run, even if developers forget to do it manually. I agree that Husky pre-commit linting is a good approach. Another idea could be to apply linting in the npm run start command, so it's automatically run during development without relying on developers to remember it. What do you think? |
You can first withdraw this solution from the previous PR and submit a separate PR, so that it will not affect the submission of the previous PR. I need to think again about how to add lint verification scheme when submitting code, because the method you mentioned above is not a standard solution, or see if other people in the community have better methods. |
@shuashuai ok |
Problem
While building the UI using the
make ui
command, the following sequence of commands is run:During development, we ran into an issue where linting was not done consistently. Specifically, I ran
npm run lint
, but other developers didn't, which made it harder to find and fix the issue, especially with Issue #1217.Suggested Solution
To improve consistency and avoid future confusion, we should add the
npm run lint
step to themake ui
process. This will ensure linting is always run as part of the build process.Proposed Update:
ui: @cd ui && pnpm pre-install && pnpm build && npm run lint && cd -
This ensures that linting is always performed after building the UI, maintaining consistent code quality across all developers.
Alternatives Considered
Impact
Adding this change will:
The text was updated successfully, but these errors were encountered: