VRMS icon indicating copy to clipboard operation
VRMS copied to clipboard

Configure ESLint & Prettier for client-mvp-04

Open OlgaBilogurova opened this issue 4 years ago • 24 comments

Overview

Configure ESLint & Prettier for client-mvp-04

OlgaBilogurova avatar Feb 12 '21 01:02 OlgaBilogurova

Hi @OlgaBilogurova . Could you add information about the ESLint & Prettier configuration we are going to make for client-mvp-04?.

piall avatar May 20 '21 03:05 piall

Was busy this week. Hoping to make the PR by this coming Thursday 5/27

peteplass avatar May 25 '21 02:05 peteplass

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:

  1. explore the existing configuration
  2. find areas for improvements
  3. find common configuration or other possible options
  4. suggest these improvements
  5. configure and create PR

OlgaBilogurova avatar May 25 '21 03:05 OlgaBilogurova

@mdPial Please update.

peteplass avatar Jun 15 '21 02:06 peteplass

@peteplass I apologize for not giving the update. I will update my PR soon.

piall avatar Jun 15 '21 05:06 piall

Progress

Added new configuration from scratch. Waiting for test results from others.

Current Problem

Giving different results in different machines

piall avatar Jun 17 '21 15:06 piall

Please update.

peteplass avatar Jul 13 '21 02:07 peteplass

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.

piall avatar Jul 13 '21 08:07 piall

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
... ... ...

piall avatar Jul 15 '21 17:07 piall

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 avatar Jul 19 '21 07:07 piall

@piall Thanks for the update. David, Alex and josh will test by Tomorrow 7/19

@glenflorendo please let us know when you retest.

peteplass avatar Jul 20 '21 02:07 peteplass

Retest results can be found here: https://github.com/hackforla/VRMS/pull/582#issuecomment-884686566

glenflorendo avatar Jul 22 '21 06:07 glenflorendo

Thank you ✨ @glenflorendo 😄

piall avatar Jul 22 '21 07:07 piall

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-querieswarn
jest-dom/prefer-in-documentwarn
react/no-array-index-keywarn
jest-dom/prefer-enabled-disabledwarn
jest/valid-expectwarn
import/namedwarn
no-unused-expressionswarn
testing-library/no-node-accesswarn
react/button-has-typewarn
import/no-useless-path-segmentswarn
prefer-destructuringwarn
jest-dom/prefer-checkedwarn
jsx-a11y/label-has-associated-controlwarn
jest/no-standalone-expectwarn
no-return-awaitwarn

In the current configuration have : 👇️

✖ 288 problems (63 errors, 225 warnings)
  46 errors and 141 warnings potentially fixable with the `--fix` option.

new-lint.txt

piall avatar Jul 25 '21 08:07 piall

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

piall avatar Jul 27 '21 12:07 piall

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

piall avatar Jul 27 '21 12:07 piall

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

piall avatar Aug 03 '21 01:08 piall

Hi piall, update when you get a chance, please.

peteplass avatar Aug 10 '21 02:08 peteplass

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

peteplass avatar Aug 10 '21 02:08 peteplass

🕑️ 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 avatar Aug 12 '21 19:08 piall

@piall Thanks for the update. Congrats on the job!

@jasonwong26 will review error timeline.

peteplass avatar Aug 17 '21 02:08 peteplass

Thank you Pete 😊

piall avatar Aug 17 '21 03:08 piall

PR needs review

peteplass avatar Aug 24 '21 02:08 peteplass

@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

ExperimentsInHonesty avatar Sep 14 '21 15:09 ExperimentsInHonesty