Skip to content

chore: Eslint migration foundation + migrate npm/grep package #32046

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

Merged
merged 15 commits into from
Jul 28, 2025

Conversation

cacieprins
Copy link
Contributor

Additional details

This is a pared down PR related to #30892

It includes:

  • The new shared eslint config
  • A migration guide, including troubleshooting steps discovered while migrating npm/grep
  • An example migration in ./npm/grep

Steps to test

How has the user experience changed?

PR Tasks

@cacieprins cacieprins force-pushed the eslint-migration-foundation branch from 5c327f5 to 831af8d Compare July 17, 2025 13:28
@jennifer-shehane
Copy link
Member

@MikeMcC399 Might be curious to get your eyes on this (if you have time), since you've been handling eslint config in the other repos so nicely. Particularly the guide outline.

Copy link

cypress bot commented Jul 17, 2025

cypress    Run #64171

Run Properties:  status check passed Passed #64171  •  git commit 3488c406e4: lockfile
Project cypress
Branch Review eslint-migration-foundation
Run status status check passed Passed #64171
Run duration 19m 23s
Commit git commit 3488c406e4: lockfile
Committer Cacie Prins
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 11
Tests that did not run due to a developer annotating a test with .skip  Pending 1232
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 32177
View all changes introduced in this branch ↗︎
UI Coverage  45.96%
  Untested elements 189  
  Tested elements 165  
Accessibility  97.95%
  Failed rules  3 critical   8 serious   2 moderate   2 minor
  Failed elements 107  

"eslint-import-resolver-typescript": "3.8.2",
"eslint-plugin-cypress": "^4.1.0",
"eslint-plugin-import-x": "^4.6.1",
"eslint-plugin-mocha": "^10.5.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider upgrading to eslint-plugin-mocha@11

@MikeMcC399
Copy link
Contributor

@jennifer-shehane

Might be curious to get your eyes on this (if you have time), since you've been handling eslint config in the other repos so nicely. Particularly the guide outline.

I only have some general comments:

@jennifer-shehane jennifer-shehane changed the title chore: Eslint migration foundation chore: Eslint migration foundation + migrate npm/grep package Jul 18, 2025
cursor[bot]

This comment was marked as outdated.

@cacieprins
Copy link
Contributor Author

@MikeMcC399 Thank you so much for the feedback!

@cacieprins
Copy link
Contributor Author

@MikeMcC399 I'm considering whether, after the migration in this repo, switching eslint-config out to the npm package as a major version upgrade. It's not right now to allow for a progressive migration in this repo, though. Thanks for bringing that up!

},
"include": ["e2e/**/*.ts"]
"include": [
"**/*.ts",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you remember why we needed to touch the tsconfig here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To get eslint to pick up on everything. The new eslint config runs .js files through typescript linter - this helps it lint interactions between js and ts. If typescript eslint matches a file that isn't in the "default project" (e.g., not matched by the closest tsconfig), it throws an error.

"lint": "eslint"
},
"dependencies": {
"jiti": "^2.4.2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is jiti a peer dependency or something that we need to include here?

Copy link
Contributor Author

@cacieprins cacieprins Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jiti is a dependency of an updated eslint plugin, but a few dependencies of frontend-shared depend on an older version of jiti. Yarn doesn't install the version that one of the eslint pugins here needs, so node uses thet older version of jiti via hoisting. Declaring it here prevents it from using the hoisted version.


{
// rules that are gold standard, but have many violations
// these are off while developing eslint, but should eventually be enabled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in other words we need to disable these rules temporarily because there is an overwhelming amount of errors?

Copy link
Contributor Author

@cacieprins cacieprins Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, they're not currently rules that are applied to the project, but ones that would be good to turn on - they are defaulted on in the recommended rules.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as resolved.

…on - once migration is complete, this will clean up
cursor[bot]

This comment was marked as outdated.

@cacieprins cacieprins merged commit d5c8885 into develop Jul 28, 2025
90 of 92 checks passed
@cacieprins cacieprins deleted the eslint-migration-foundation branch July 28, 2025 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants