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): exportplugin,parser, andconfigs that are compatible with bothdefineConfig() andtseslint.config()#11475

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

Conversation

@kirkwaiblinger
Copy link
Member

@kirkwaiblingerkirkwaiblinger commentedAug 13, 2025
edited
Loading

PR Checklist

Overview

Third time's the charm 🙃

I realized that, if we're extremely vague about what the parser, plugin, and configs are, we can easily satisfy both the expected types fromdefineConfig() andtseslint.config(), without running into the many incompatibilities I experienced during previous attempts. While this sacrifices precision, the exact shapes of those objects aren't actually important at all to users; it's only important that they be usable within their configs. So, I think this is a worthwhile tradeoff.

It's possible that some plugin authors, or downstream consumers that use our tools in some way other than in their lint configuration might experience some type errors as a result of this. Fixing these errors should be quite simple, since one can use type assertions to get the previous (also quite vague) types:

tseslint.parserasFlatConfig.Parser;tseslint.pluginasFlatConfig.Plugin;tseslint.configs['foo']asFlatConfig.Config|FlatConfig.ConfigArray

andreww2012 and kachkaev reacted with thumbs up emojicsvn and sirajulm reacted with hooray emoji
@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.

@netlify
Copy link

netlifybot commentedAug 13, 2025
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit6dd9d70
🔍 Latest deploy loghttps://app.netlify.com/projects/typescript-eslint/deploys/689cd9c9a533a20008e4b326
😎 Deploy Previewhttps://deploy-preview-11475--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: 95 (🟢 up 3 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (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-cloud
Copy link

nx-cloudbot commentedAug 13, 2025
edited
Loading

View yourCI Pipeline Execution ↗ for commit6dd9d70

CommandStatusDurationResult
nx test tsconfig-utils✅ Succeeded<1sView ↗
nx run types:build✅ Succeeded5sView ↗
nx test typescript-eslint✅ Succeeded41sView ↗
nx test utils✅ Succeeded9sView ↗
nx test eslint-plugin✅ Succeeded5sView ↗

☁️Nx Cloud last updated this comment at2025-08-13 18:40:02 UTC

@thernstig
Copy link

Shouldn't this also be updated?

<details>
<summary>Aside on ESLint's`defineConfig()`</summary>
ESLint also provides a`defineConfig()` helper similar to`tseslint.config()`.
However, there is a types incompatibility issue that causes type errors to incorrectly be reported when mixing typescript-eslint's configs and`defineConfig()`.
For now we recommend using`tseslint.config()` for use with typescript-eslint's configs.
See[typescript-eslint#10899](https://github.com/typescript-eslint/typescript-eslint/issues/10899) for more details.
</details>

Along with the example on that same page to start usingdefineConfig instead?

@kirkwaiblinger
Copy link
MemberAuthor

@thernstig

Shouldn't this also be updated?

<details>
<summary>Aside on ESLint's`defineConfig()`</summary>
ESLint also provides a`defineConfig()` helper similar to`tseslint.config()`.
However, there is a types incompatibility issue that causes type errors to incorrectly be reported when mixing typescript-eslint's configs and`defineConfig()`.
For now we recommend using`tseslint.config()` for use with typescript-eslint's configs.
See[typescript-eslint#10899](https://github.com/typescript-eslint/typescript-eslint/issues/10899) for more details.
</details>

Possibly could... Though in the name of caution it might be worth releasing the types change and waiting a week to make sure it's doesn't end up messing up people's configs too before we take down the notice. Could go either way.

Along with the example on that same page to start usingdefineConfig instead?

This will for sure not happen as part of this PR, but endorsingdefineConfig()is tracked separately as#10935

thernstig reacted with thumbs up emoji

Copy link
Member

Choose a reason for hiding this comment

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

istest-d.ts run by vitest? TIL

kirkwaiblinger reacted with laugh emoji
@bradzacherbradzacher merged commit3426f0d intotypescript-eslint:mainAug 16, 2025
114 of 121 checks passed
@kirkwaiblingerkirkwaiblinger deleted the fix-define-config-incompatibility branchAugust 16, 2025 04:12
@Martinspire
Copy link

If another way of configuring the project is supported, shouldn't the overall readme have a way to do this? I mean, if you want people to start using it, it would be nice to know how it works...

@thernstig
Copy link

If another way of configuring the project is supported, shouldn't the overall readme have a way to do this? I mean, if you want people to start using it, it would be nice to know how it works...

See#10935

Martinspire reacted with thumbs up emoji

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@bradzacherbradzacherbradzacher approved these changes

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

4 participants

@kirkwaiblinger@thernstig@Martinspire@bradzacher

[8]ページ先頭

©2009-2025 Movatter.jp