-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
feature request: FlatConfig support #318
Comments
If you want to import I am going to implement that this weekend. |
This would be super helpful to have an example of how to use this package with the newer ESLint flat config (i.e. how do I use this package in an @JounQin The links you have reference the sister package of this one |
For // eslint.config.js
import { createImportXTypeScriptResolver } from 'eslint-import-typescript-resolver';
// ...
settings: {
'import-x/resolvers-next': [
createImportXTypeScriptResolver(options)
]
}
/// ... Note that this is still the proposal but we will be implementing this soon. |
Yes I want something like |
@melroy89 if you want the import plugin you'd need to import eslint-plugin-import; the resolver isn't same as the plugin. |
Thanks for you response! I see, I'm using my typescript project with moduleResolution set to nodenext: Meaning the plugin has difficulties finding the ps. I'm also using SWC during fast development (and tsc for production builds). |
@melroy89 You can vote up my proposal at un-ts/eslint-plugin-import-x#40 (comment) which will resolve your issue. You will be able to use |
The problem I have found ,as somebody who is not familiar with ESLint configs, is trying to wrap my head around two types of config at the same time because various plugins support, promote and document in different ways. I am setting up an ESLint config from scratch using the init tool, so I presented with the new flat file format (which took a tone of reading to work out what the difference is). I need it to support my TS aliases so thats why I'm looking at I too, like the OP, thought it needed an exported flat config module because that how all the other plugins I have implemented so far work. Digging deeper and based on @ljharb comment I assume it needs to be added to a config object though I'm not sure how. It would be helpful, at the very least, if there was an example in the readme of implementing this plugin for flat config. This is what I have so far but it doesn't seem to be working:
So I am trying to extend the import-x flat config and add the |
The flat config support for custom resolvers is implemented here at This allows you to use require/import or any js objects as the import resolver. The new resolver design of The |
The documentation for this project (eslint-import-resolver-typescript) says:
The problem is that .eslintrc is deprecated. The new way is to use eslint.config.mjs. How do we configure eslint-plugin-import with the typescript resolver to work with the new flat eslint.config files? Most people using TypeScript and ESLint will want to use the new typescript-eslint config, so examples for all of this together would be especially helpful. |
I finally got |
What
We want to start using eslint-import + eslint-import-resolver-typescript but there is no flatConfig support. It would be very beneficial for said support to be added.
Kind regards!
The text was updated successfully, but these errors were encountered: