Skip to content
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

fix flat config types #17

Merged
merged 1 commit into from
Jan 11, 2025

Conversation

PrettyCoffee
Copy link
Contributor

Hey, I just noticed that the types of the flat config are currently lacking in specificity, resulting in IDEs not being able to provide auto complete suggestions and showing a warning:

const preferFC = require("eslint-plugin-react-prefer-function-component/config")

module.exports = [
  preferFC.configs.recommended
  //       ^^^ Unresolved variable configs
]

This could be fixed by using the satisfies keyword of typescript instead of explicitly setting the type.

With this change, typescript will be able to keep the most specific version of the type and the IDE will be able to show suggestions.

Before:
image

After:
image

Thanks a lot for the plugin btw! :)

Copy link

codecov bot commented Jan 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (48caca6) to head (4fcd420).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #17   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           31        31           
  Branches         7         7           
=========================================
  Hits            31        31           

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

@tatethurston
Copy link
Owner

Yes, thank you for fixing this!

@tatethurston tatethurston merged commit d12ffa8 into tatethurston:main Jan 11, 2025
3 checks passed
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.

2 participants