eslint-plugin-no-relative-import-paths
eslint-plugin-no-relative-import-paths copied to clipboard
Feature Request: fix based on tsconfig aliases
Hi @MelvinVermeer and thanks for the useful plugin!
The problem: We use ESLint's auto-fixing in IDEs to run after each save. Unfortunately, we've got multiple aliases setup in tsconfig.json
and realised that the plugin doesn't work with them, so it's quite difficult to set up a single rootDir
for the whole project and/or other monorepos.
Possible solutions:
- We could add a config property which would specify the path to tsconfig file from where we can get the aliases which will be used as the
rootDir
for the auto-fix. - We could maybe check the eslint parser used for the file, if the parser is set to @eslint-typescript/parser, we can probably extract the tsconfig from there somehow and use aliases from there to set
rootDir
for the auto-fix.
Not sure if any of these solutions are possible. My question is: have you tried doing something similar? Would you be ok if we were to create a pull request for the feature like that? Thanks for the response.
any updates ?
any updates ?
@MelvinVermeer do you need some help here? Thank you!
I am open for PRs, option 2 feels most future proof