WebStorm has a setting to make auto-imports absolute.
How to do the same in Neovim? By default, auto-imports in Neovim are relative:
import { Component } from '../Component'
And I need to use the paths from tsconfig.json
. I use Astrovim
I added a plugin for eslint https://www.npmjs.com/package/eslint-plugin-no-relative-import-paths
{
"plugins": ["no-relative-import-paths"],
"rules": {
"no-relative-import-paths/no-relative-import-paths": [
"error",
{ "allowSameFolder": true, "rootDir": "src", "prefix": "" }
]
}
}