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(types): fix types of flat configs#3882

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

Open
CHC383 wants to merge1 commit intojsx-eslint:master
base:master
Choose a base branch
Loading
fromCHC383:fix/flat-configs-types-3

Conversation

CHC383
Copy link

Fixes#3878

This is another attempt tofix#3878 from a different direction than#3879

@CHC383
Copy link
Author

@ljharb Since#3879 is blocked, I tried to fix the typing issue from a different angle: creating a new flatConfigs object outside of the originalconfigs. This eventually will become a breaking change but not at the moment, as the originalconfigs.flat is still kept and only marked as deprecated through JSDoc.

If we run out of ideas on#3879, maybe we can go with this one?

@codecovCodecov
Copy link

codecovbot commentedJan 25, 2025
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.71%. Comparing base(e6b5b41) to head(cd3665a).
Report is 13 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@##           master    #3882      +/-   ##==========================================+ Coverage   97.66%   97.71%   +0.04%==========================================  Files         136      133       -3       Lines        9978     9971       -7       Branches     3703     3703              ==========================================- Hits         9745     9743       -2+ Misses        233      228       -5

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

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

@ljharb
Copy link
Member

I agree this is semver-minor, but I have no desire to go with that model. I want a single configs object with eslintrc configs, and aflat on it that holds all the flat configs. If the only unsolvable issue with that is that you might need to useNonNullable<> or!, I think that's acceptable (i don't think it's unsolvable, to be clear, but i'm not willing to use what i think is a worse object layout)

@CHC383
Copy link
Author

CHC383 commentedJan 25, 2025
edited
Loading

I agree this is semver-minor, but I have no desire to go with that model. I want a single configs object with eslintrc configs, and aflat on it that holds all the flat configs. If the only unsolvable issue with that is that you might need to useNonNullable<> or!, I think that's acceptable (i don't think it's unsolvable, to be clear, but i'm not willing to use what i think is a worse object layout)

Yeah you are right, I just checked and found out ESLint supportsts config since v9.9.0, before thatNonNullable<> or! are not an option, I guess it is not a big deal then compared to using// @ts-expect-error in thejs config.

And just curious, you are also the main maintainer ofeslint-plugin-import andeslint-plugin-jsx-a11y, why is this plugin choosing this layout while the other two using the layout similar to the PR? TBH this is the only plugin among the few popular ones I used that use this layout, others either have flatConfigs as a separate object, or have the flat configs in the same level as the legacy configs (all inside the same configs object) and prefix the name withflat.

@ljharb
Copy link
Member

It's a fair point that they're not all the same; this, however, is what i would have preferred to do on the other two, i just didn't notice the difference.

Prefixing means you can't programmatically compare them, for example - munging string names isn't clean at all. A separate object, at least, is more reasonable, butconfigs is the only property under which i'd expect to find configs.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

[enhancement]: flat configs are possibly undefined
2 participants
@CHC383@ljharb

[8]ページ先頭

©2009-2025 Movatter.jp