Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore(eslint-plugin): migrate to vitest#10579

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

43081j
Copy link
Contributor

@43081j43081j commentedDec 31, 2024
edited
Loading

PR Checklist

Overview

this is just one possible PR for migrating to vitest

we need to avoid an unreviewable, giant PR, so the following has been done in this one:

  • only migrate eslint-plugin for now
  • for docs snapshots, retain a similar format rather than moving to the standard one-snapshot-per-file
  • for all other snapshots, just update the snapshot (since they only had one per file already)

Depends on#10582

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@43081j!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently onhttps://opencollective.com/typescript-eslint.

@netlifyNetlify
Copy link

netlifybot commentedDec 31, 2024
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit1ace444
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/67fd6d226c3e8200088c1f61
😎 Deploy Previewhttps://deploy-preview-10579--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 77 (🔴 down 19 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 98 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to yourNetlify site configuration.

@nx-cloudNx Cloud
Copy link

nx-cloudbot commentedDec 31, 2024
edited
Loading

View yourCI Pipeline Execution ↗ for commit1ace444.

CommandStatusDurationResult
nx test eslint-plugin✅ Succeeded6mView ↗
nx test eslint-plugin-internal✅ Succeeded11sView ↗
nx test scope-manager✅ Succeeded18sView ↗
nx run types:build✅ Succeeded1sView ↗
nx test type-utils✅ Succeeded23sView ↗
nx typecheck ast-spec✅ Succeeded4sView ↗
nx run eslint-plugin:test -- --coverage✅ Succeeded6m 28sView ↗
nx run-many --target=build --exclude website --...✅ Succeeded1m 14sView ↗
Additional runs (26)✅ Succeeded...View ↗

☁️Nx Cloud last updated this comment at2025-04-14 20:33:29 UTC

@43081j43081j mentioned this pull requestDec 31, 2024
14 tasks
@43081j43081j changed the titlechore(eslint-plugin) migrate to vitestchore(eslint-plugin): migrate to vitestDec 31, 2024
@43081j43081jforce-pushed theeslint-plugin-vitest branch 4 times, most recently froma40aad9 to4f4c6f1CompareDecember 31, 2024 17:26
Migrates from jest to vitest.The primary differences:- You must import `describe`, `it`, etc- Snapshots are not combined into one file by default- ESM test files must be `.mts` (since we're in a `commonjs` package)
Tries to keep a similar format for sake of code review.We can do a separate PR to drop this format and move to a snapshot perfile in future.
@codecovCodecov
Copy link

codecovbot commentedDec 31, 2024
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.82%. Comparing base(9531492) to head(1ace444).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@##             main   #10579      +/-   ##==========================================+ Coverage   84.31%   90.82%   +6.51%==========================================  Files         497      497                Lines       27766    50192   +22426       Branches     5075     8267    +3192     ==========================================+ Hits        23411    45588   +22177- Misses       4184     4589     +405+ Partials      171       15     -156
FlagCoverage Δ
unittest90.82% <ø> (+6.51%)⬆️

Flags with carried forward coverage won't be shown.Click here to find out more.

see 207 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JoshuaKGoldberg
Copy link
Member

This is awesome, thanks for sending@43081j! I'd really like to dive in soon and see if we can get this merged. But we're a little swamped catching up on issues after the holiday & new year break, and this is a lot of changes. So it'll probably be a little while till we can take a deep look. 😬

In the meantime, some notes:

  • eslint-plugin is one of our biggest packages. Is there a reason you wanted to start with this, and not a smaller one likeeslint-plugin-internal ortype-utils?
  • Codecov is reporting a significant % drop, which means coverage is probably not set up right with it - could you take a look please?
  • Although we all would prefer to move away from implicit globals, adding in theimport { describe, it, ... } from 'vitest' is adding a lot to the diff. Is there a reason not to enableVitestglobals for now - with a followup to remove it later?

@JoshuaKGoldbergJoshuaKGoldberg added the awaiting responseIssues waiting for a reply from the OP or another party labelJan 13, 2025
@43081j
Copy link
ContributorAuthor

eslint-plugin is one of our biggest packages. Is there a reason you wanted to start with this, and not a smaller one like eslint-plugin-internal or type-utils?

no particular reason, i just chose the package i was looking at at the time

Codecov is reporting a significant % drop, which means coverage is probably not set up right with it - could you take a look please?

ill have a look

Although we all would prefer to move away from implicit globals, adding in the import { describe, it, ... } from 'vitest' is adding a lot to the diff. Is there a reason not to enableVitest globals for now - with a followup to remove it later?

we could useglobals but i would say the diff is actually mostly from snapshot changes than it is from imports.

i think without the snapshot changes, it'd be a pretty small diff. so i'd prefer to keep them, but let me know if you don't

@43081j
Copy link
ContributorAuthor

i manually compared the coverage locally and it seems to all be right. just vite reports more statements, and there's now atools directory included which wasn't before

if you could have a look at some point too, that'd be helpful

@JoshuaKGoldberg
Copy link
Member

i think without the snapshot changes, it'd be a pretty small diff. so i'd prefer to keep them, but let me know if you don't

+1 from me on the small diff 😄. I'd prefer not to keep them. The smaller the diff the better!

if you could have a look at some point too, that'd be helpful

👍 ACK, we can help as part of the review if it's not figured out

@43081j
Copy link
ContributorAuthor

+1 from me on the small diff 😄. I'd prefer not to keep them. The smaller the diff the better!

what i meant was that the imports don't add much to the diff, since the only reason this is a "big PR" is the snapshot changes rather than those imports.

i'd rather keep the imports seeing as its where we want to be

if you diff without snapshots, its small (but of course we need those snapshot updates in this PR)

as for the coverage change, im pretty sure it is just vite doing a much better job by using v8 coverage. that and the addedtools/ directory seem to account for the difference

@ronami
Copy link
Member

ronami commentedJan 13, 2025
edited
Loading

+1 from me on having the smallest diff.

Since this is already a large change, having it be gradual is a big plus. I think that moving fromVitestglobals to using imports can be done separately on a future PR, which would help not miss anything on this PR.

@43081j
Copy link
ContributorAuthor

43081j commentedJan 13, 2025
edited
Loading

i think we're getting lost a bit here

the imports don't contribute much at all to the diff. most of the diff is from snapshot updates, maybe its worth taking another look

im happy to use globals but i think we're picking at a minor thing that actually doesn't contribute much to the diff

@43081j
Copy link
ContributorAuthor

i've now switched to using globals

we need to re-open#10582 and land#10680 before this

kirkwaiblinger reacted with thumbs up emoji

kirkwaiblinger
kirkwaiblinger previously approved these changesMar 22, 2025
Copy link
Member

@kirkwaiblingerkirkwaiblinger left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@@ -403,6 +403,18 @@ export default tseslint.config(
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
},

Choose a reason for hiding this comment

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

@kirkwaiblingerkirkwaiblinger added the 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labelMar 28, 2025
@JoshuaKGoldberg
Copy link
Member

Starting to see this once in a while:

Error: Test timed out in 5000ms.If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout".

https://cloud.nx.app/runs/EisURTJuXm/task/eslint-plugin%3Atest

Something to keep an eye on...

43081j reacted with thumbs up emoji

@JoshuaKGoldbergJoshuaKGoldberg merged commit1a3ab0d intotypescript-eslint:mainApr 14, 2025
58 of 59 checks passed
@43081j43081j deleted the eslint-plugin-vitest branchApril 14, 2025 21:50
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsApr 22, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@kirkwaiblingerkirkwaiblingerkirkwaiblinger left review comments

@aryaemami59aryaemami59aryaemami59 left review comments

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg left review comments

Assignees
No one assigned
Labels
1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@43081j@JoshuaKGoldberg@ronami@kirkwaiblinger@aryaemami59

[8]ページ先頭

©2009-2025 Movatter.jp