MelvinVermeer / eslint-plugin-no-relative-import-paths

90 stars 22 forks source link

Feature Request: fix based on tsconfig aliases #22

Open Flyrell opened 1 year ago

Flyrell commented 1 year ago

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:

  1. 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.
  2. 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.

donrep-daniil-shushpanov commented 1 year ago

any updates ?

CryUshio commented 6 months ago

any updates ?

rafa-suarez-itx commented 5 months ago

@MelvinVermeer do you need some help here? Thank you!

MelvinVermeer commented 3 months ago

I am open for PRs, option 2 feels most future proof

danigt91 commented 1 month ago

This feature would be pretty awesome