First of all, thanks for creating this plugin, it is really useful.
I'd like to report that if the tsconfig.json file does not contain the compilerOptions.baseUrl property, eslint --fix incorrectly updates affected files. For instance, for the following config:
And the following import in .src/tests/test/test.ts to import ./src/routers/userRouter.ts:
import { userRouter } from '../../routers/userRouter';
When you run eslint, it shows the error Update import to ~/uters/userRouter, that is, it cuts off the first 2 characters from the alias. Running eslint --fix then updates the file with the wrong and invalid import { userRouter } from '~/uters/userRouter'; import statement. The workaround is to set a baseUrl field so paths under paths can be absolute; however, it's not ideal because baseUrl has other side effects, such as potential module resolution conflicts with node_modules.
First of all, thanks for creating this plugin, it is really useful.
I'd like to report that if the
tsconfig.json
file does not contain thecompilerOptions.baseUrl
property,eslint --fix
incorrectly updates affected files. For instance, for the following config:And the following import in
.src/tests/test/test.ts
to import./src/routers/userRouter.ts
:When you run
eslint
, it shows the error Update import to ~/uters/userRouter, that is, it cuts off the first 2 characters from the alias. Runningeslint --fix
then updates the file with the wrong and invalidimport { userRouter } from '~/uters/userRouter';
import statement. The workaround is to set abaseUrl
field so paths underpaths
can be absolute; however, it's not ideal becausebaseUrl
has other side effects, such as potential module resolution conflicts withnode_modules
.