Question:
Is there an ESLint rule to enforce usage of */index on imports.
Example:
File structure:
utils/
- index.js
- a.js
- b.js
main.js
main.js
// WRONG
import utils from "./utils";
// OK
import utils from "./utils/index";
Why
I need this because my project is using tscpaths to replace absolute paths with relative paths after typescript compilation, but, for some reason, it doesn't replace when the */index is not present.
Alternative
If the rule doesn't exist, is there a vscode setting that would automatically add the index in auto imports?