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

fix(typescript-eslint): make exported configs/plugin compatible withdefineConfig()#11190

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

Draft
kirkwaiblinger wants to merge12 commits intotypescript-eslint:main
base:main
Choose a base branch
Loading
fromkirkwaiblinger:fix-type-incompatibility

Conversation

kirkwaiblinger
Copy link
Member

@kirkwaiblingerkirkwaiblinger commentedMay 8, 2025
edited
Loading

Warning

I'll be travelling until May 27th, and don't expect to be able to spend time on this until then. If someone else is able to resolve the remaining failing integration tests in my absence and get this over the finish line, please feel free to do so!

PR Checklist

Overview

This switches our exports to usedefineConfig()-compatible types, rather than making our type declarations compatible with eslint core's. The type declarations that we have for things likeFlatConfig.Config and such are deliberately wide/loose, since they're meant to be used as a highly permissiveparameter type fortseslint.config(). So we don't want to be exporting our configs as those types anymore.

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@kirkwaiblinger!

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 commentedMay 8, 2025
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit6730308
🔍 Latest deploy loghttps://app.netlify.com/projects/typescript-eslint/deploys/68277c2ec2e51100095c60ec
😎 Deploy Previewhttps://deploy-preview-11190--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: 62 (🔴 down 37 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 project configuration.

@nx-cloudNx Cloud
Copy link

nx-cloudbot commentedMay 8, 2025
edited
Loading

View yourCI Pipeline Execution ↗ for commit6730308.

CommandStatusDurationResult
nx typecheck ast-spec✅ Succeeded2sView ↗
nx run-many --target=build --exclude website --...✅ Succeeded2sView ↗
nx run-many --target=clean✅ Succeeded10sView ↗

☁️Nx Cloud last updated this comment at2025-05-16 18:20:58 UTC

@kirkwaiblingerkirkwaiblinger changed the titlefix(typescript-eslint): make exported types compatible withdefineConfig()fix(typescript-eslint): make exported configs/plugin compatible withdefineConfig()May 8, 2025
bradzacher
bradzacher previously approved these changesMay 8, 2025
Copy link
Member

@bradzacherbradzacher left a comment

Choose a reason for hiding this comment

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

looks like this change is a net-positive and removes a bunch of errors from the integration tests -- so don't forget to regen the snapshots.

kirkwaiblinger reacted with thumbs up emojikirkwaiblinger reacted with heart emoji

/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion -- These "unnecessary" assertions work around "requires explicit type annotation" errors. */
Copy link
Member

Choose a reason for hiding this comment

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

could this be done asconst configs = { ... } satisfies Record<string, eslintConfigHelpers.Config | eslintConfigHelpers.Config[]>?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Hmm, well, now I can no longer repro the "requires a type assertion" error at all, maybe because I ended up adding the eslint/config-helpers package in the package.json.

So looks like thesatisfies option is available to us (as well as justconst configs = { ... }). I'll switch it tosatisfies.

};
/* eslint-enable @typescript-eslint/no-unnecessary-type-assertion */

export type Config = TSESLint.FlatConfig.ConfigFile;
Copy link
Member

Choose a reason for hiding this comment

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

I can't remember -- is this the loose type or the strict type?
Perhaps we should deprecate this to rename it? Or change the type to the ESLint types?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This is a loose one; it's just aT | Promise<T> version of the type of the parameter type oftseslint.config(...configs).

I think deprecating makes sense 👍

@@ -51,6 +51,7 @@
"check-types": "npx nx typecheck"
},
"dependencies": {
"@eslint/config-helpers": "^0.2",
Copy link
Member

Choose a reason for hiding this comment

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

ugh an0.x version sucks cos it means that every minor release we'll be forced to update our version or else users will be blocked.

ESLint itself depends on this package so in some future when we drop v8 and older v9 versions -- we would be able to make this a peer dependency and just rely on the version installed that way.

@kirkwaiblingerkirkwaiblinger marked this pull request as ready for reviewMay 16, 2025 16:54
@kirkwaiblingerkirkwaiblinger requested review frombradzacher,aryaemami59 anda team and removed request foraryaemami59May 16, 2025 16:56
@codecovCodecov
Copy link

codecovbot commentedMay 16, 2025
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.92%. Comparing base(05014ff) to head(6730308).

Additional details and impacted files
@@           Coverage Diff           @@##             main   #11190   +/-   ##=======================================  Coverage   90.92%   90.92%           =======================================  Files         499      499             Lines       50845    50845             Branches     8384     8384           =======================================  Hits        46231    46231             Misses       4599     4599             Partials       15       15
FlagCoverage Δ
unittest90.92% <ø> (ø)

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

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

Copy link
Contributor

@aryaemami59aryaemami59 left a comment

Choose a reason for hiding this comment

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

Looks great! 👍

kirkwaiblinger reacted with heart emoji
@kirkwaiblinger
Copy link
MemberAuthor

ah, wait, redrafting since I forgot about the integration test failures

@kirkwaiblingerkirkwaiblinger marked this pull request as draftMay 16, 2025 17:31
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@aryaemami59aryaemami59aryaemami59 left review comments

@bradzacherbradzacherAwaiting requested review from bradzacher

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Bug: typescript-eslint config types are incompatible withdefineConfig() types
3 participants
@kirkwaiblinger@bradzacher@aryaemami59

[8]ページ先頭

©2009-2025 Movatter.jp