You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to use both flatCompat and fixupConfigRules to solve TypeError: context.getAncestors . Using the last portion of this article Introducing ESLint Compatibility Utilities.
The code from the article worked fine but started started going crazy with typescript errors.
First fixupConfigRules wouldn't accept params of the function flatCompat.
Then the eslint FlatConfig type wouldn't accept the return type of the fixupConfigRules.
I ended up jsdoc type casting it all to make it work.
What did you expect to happen?
Since these are for eslint I expected all the types to be right. Especially the return type because even if I didn't use flatCompat this whole plugin wouldn't work at all for eslint's flatConfig.
I am willing to submit a pull request for this issue.
Additional comments
Just try to use the plug in with an array of type /** @type {import("eslint").Linter.FlatConfig[]} */.
If you decide to use the sandbox go to packages/eslint-config/eslint.next.config,js
The text was updated successfully, but these errors were encountered:
Which packages are affected?
@eslint/compat
@eslint/config-array
@eslint/object-schema
Environment
Node version:
npm version: 10.5.1
ESLint version: 9.2.0
Operating System: WSL
What did you do?
I was trying to use both flatCompat and fixupConfigRules to solve TypeError: context.getAncestors . Using the last portion of this article Introducing ESLint Compatibility Utilities.
The code from the article worked fine but started started going crazy with typescript errors.
First fixupConfigRules wouldn't accept params of the function flatCompat.
Then the eslint FlatConfig type wouldn't accept the return type of the fixupConfigRules.
I ended up jsdoc type casting it all to make it work.
What did you expect to happen?
Since these are for eslint I expected all the types to be right. Especially the return type because even if I didn't use flatCompat this whole plugin wouldn't work at all for eslint's flatConfig.
What actually happened?
Types didn't work
Link to Minimal Reproducible Example
https://codesandbox.io/p/github/ChurroC/next-server-theme/main?import=true
Participation
Additional comments
Just try to use the plug in with an array of type /** @type {import("eslint").Linter.FlatConfig[]} */.
If you decide to use the sandbox go to packages/eslint-config/eslint.next.config,js
The text was updated successfully, but these errors were encountered: