VRMS
VRMS copied to clipboard
Configure ESLint & Prettier for client-mvp-04
Overview
Configure ESLint & Prettier for client-mvp-04
Hi @OlgaBilogurova . Could you add information about the ESLint & Prettier configuration we are going to make for client-mvp-04
?.
Was busy this week. Hoping to make the PR by this coming Thursday 5/27
Hi @mdPial, I created this task because devs were saying that they have some warnings for v 0.4 but I didn't have them.
For this task you need:
- explore the existing configuration
- find areas for improvements
- find common configuration or other possible options
- suggest these improvements
- configure and create PR
@mdPial Please update.
@peteplass I apologize for not giving the update. I will update my PR soon.
Progress
Added new configuration from scratch. Waiting for test results from others.
Current Problem
Giving different results in different machines
Please update.
Tester | OS | Matched | Comment | Tested with latest changes |
---|---|---|---|---|
Me | Windows 10 | ✔️ | - | ✔️ |
Josh | MacOS Catalina 10.15.7 | ✔️ | - | ✔️ |
Olga | MacOS | ❌️ | No ESLint Problem | ❌️ |
David | MacOS | ❌️ | No ESLint Problem | ❌️ |
Alex | Windows | ❌️ | Got different ESLint problem which I am not getting | ❌️ |
Used Ubuntu 20.10 to make changes.
Goal | Status |
---|---|
To make ESLint config which will give the same result for everyone | ✔️ |
Airbnb configuration | ✔️ |
Prettier configuration | ✔️ (added with ESLint) |
Test Results:
Tester | OS | Matched | Comment | Tested with latest changes |
---|---|---|---|---|
Me | Windows 10 Home v2004 | ✔️ | - | ✔️ |
Me | Ubuntu 20.10 | ✔️ | - | ✔️ |
Josh | macOS Catalina 10.15.7 | ✔️ | - | ✔️ |
Glen | macOS Big Sur 11.4 | ✔️ | - | ✔️ |
David | macOS Mojave 10.14.6 | ✔️ | - | ✔️ |
Alex | Windows 10 | ❌️ | Got different ESLint problem which I am not getting | ❌️ |
Added Extra rules with Airbnb
Current Rules | Current Status | Without it Gives | With it Gives |
---|---|---|---|
no-unused-vars | warn | - | 2 warnings |
no-console | off | 13 warnings | - |
func-names | off | 1 warning | - |
no-process-exit | off | - | - |
object-shorthand | off | 3 errors | - |
class-methods-use-this | off | - | - |
react/jsx-filename-extension: [..] | warn | 49 errors | - |
prettier/prettier: [..] | error | - | 12 errors |
And gives 604 problems (602 errors, 2 warnings) |
Will add
Config | Solves |
---|---|
env: jest | 241 errors |
Need Suggestion
Adding ESLint related packes for :
- [ ] React Hook
- [ ] Jest DOM
- [ ] Testing Library
Can be turned off rules:
Rules | Status | Solves |
---|---|---|
react/jsx-curly-brace-presence | off | 149 errors |
react/prop-types | off | 44 errors |
import/order | off | 34 errors |
spaced-comment | off | 25 errors |
arrow-body-style | off | 14 errors |
import/no-named-as-default-member | off | 13 errors |
no-param-reassign | off | 7 errors |
import/no-extraneous-dependencies | off | 6 errors |
jsx-a11y/click-events-have-key-events | off | 5 errors |
jsx-a11y/no-static-element-interactions | off | 5 errors |
import/no-named-as-default | off | 5 errors |
import/prefer-default-export | off | 5 errors |
react/no-unescaped-entities | off | 4 errors |
... | ... | ... |
Update
Josh, Glen, David had tested the new configuration and they are also getting the same ESLint problems as mine. After taking opinions from the dev team on the Thursday
meeting about changing the status of the ESLint rules and which package can add. I have updated the configuration.
Now waiting again for test results from the updated configuration to ensure everything is working fine with the updated current configuration also.
Test Result Tracker:
Tester | OS | Previous Test Matched | Current Test Matched | Tested With Latest Changes |
---|---|---|---|---|
Me | Windows 10 Home v2004 | ✔️ | ✔️ | ✔️ |
Me | Ubuntu 20.10 | ✔️ | ✔️ | ✔️ |
Josh | macOS Catalina 10.15.7 | ✔️ | ✔️ | ✔️ |
Glen | macOS Big Sur 11.4 | ✔️ | ✔️ | ✔️ |
David | macOS Mojave 10.14.6 | ✔️ | ✔️ | ✔️ |
Alex | Windows 10 | - ( was busy ) |
- | ✔️ |
@piall Thanks for the update. David, Alex and josh will test by Tomorrow 7/19
@glenflorendo please let us know when you retest.
Retest results can be found here: https://github.com/hackforla/VRMS/pull/582#issuecomment-884686566
Thank you ✨ @glenflorendo 😄
I have changed more ESLint rules status. Waiting to check if have any opinion about changing this rules status.
Rules Status have Changed 👈️
ESLint Rules | Status |
---|---|
testing-library/prefer-screen-queries | warn |
jest-dom/prefer-in-document | warn |
react/no-array-index-key | warn |
jest-dom/prefer-enabled-disabled | warn |
jest/valid-expect | warn |
import/named | warn |
no-unused-expressions | warn |
testing-library/no-node-access | warn |
react/button-has-type | warn |
import/no-useless-path-segments | warn |
prefer-destructuring | warn |
jest-dom/prefer-checked | warn |
jsx-a11y/label-has-associated-control | warn |
jest/no-standalone-expect | warn |
no-return-await | warn |
In the current configuration have : 👇️
✖ 288 problems (63 errors, 225 warnings)
46 errors and 141 warnings potentially fixable with the `--fix` option.
The suggestion given by Jason
testing-library/prefer-screen-queries - off
jest-dom/prefer-in-document - warning (this is marginal, I'd be fine marking this as off as well)
jest-dom/prefer-enabled-disabled - warning (this could even be marked as error)
jest/valid-expect - warning, and I would set the alwaysAwait flag to true
In the current configuration have :point_down:
✖ 271 problems (63 errors, 208 warnings)
46 errors and 141 warnings potentially fixable with the `--fix` option.
Test Result Tracker:
Tester | OS | Matched | Output File (npm run lint ) |
---|---|---|---|
Me | Ubuntu 20.10 | ✔️ | updated-lint.txt |
Josh | macOS Catalina 10.15.7 | ||
Glen | macOS Big Sur 11.4 | ||
David | macOS Mojave 10.14.6 | ||
Alex | Windows 10 |
Update
Waiting for a final review from Alex. After I will reach out to everyone to test the PR.
Won't be able to join any meetings of this week but available for making any changes and discussion on slack or here
Hi piall, update when you get a chance, please.
Conditions for merging pull request:
please list all rules for current errors, so we can track them in the future.
make all rules warnings, not errors
listed here and on PR
🕑️ Timeline of Errors (For Tracking In Future)
Listed Rules with Errors | Lint Output | Errors |
---|---|---|
https://github.com/hackforla/VRMS/issues/491#issuecomment-880895643 | log.txt | 602 |
https://github.com/hackforla/VRMS/pull/582#issuecomment-885408035 - 1 | lint-log.txt | 114 |
https://github.com/hackforla/VRMS/pull/582#issuecomment-897516918 - 2 | updated-lint.txt | 63 |
https://github.com/hackforla/VRMS/pull/582#issuecomment-897902336 - 3 | after-rebasing-with-latest-changes-lint.txt | 1 |
After Turning all rules with errors to warn current-codebase-lint-log.txt
✖ 292 problems (0 errors, 292 warnings)
0 errors and 207 warnings potentially fixable with the `--fix` option.
@piall Thanks for the update. Congrats on the job!
@jasonwong26 will review error timeline.
Thank you Pete 😊
PR needs review
@jasonwong26 how does this issue relate to the epic issues that we worked on yesterday.
https://github.com/hackforla/VRMS/issues/653 https://github.com/hackforla/VRMS/issues/651