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

90 stars 22 forks source link

Feature Request: allowParentFolder option #31

Open vittorius opened 11 months ago

vittorius commented 11 months ago

Hey, first of all, thanks for the great plugin!

What do you think about having an allowParentFolder option to allow '../Component' imports? It could be particularly useful in tests (e.g. Jest) when you have

Component/
|
|_ __tests__/
       |_ test1.js
       |_ test2.js
|_ index.js
|_ ...

and you want to conveniently import your component from test modules.

Thanks.

samhh commented 10 months ago

I'd generalise this to something like allowedDepth, which defaults to some value denoting none. This could cover both this feature request and the preexisting allowSameFolder.