-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to resolve typescript alias path #2765
Comments
I tried
|
Unfortunately, this plugin does not fix the issue with my monorepo setup. |
same issue and the plugin does not fix mine too |
You'd better provide a runnable reproduction. |
I don't know if this is the same issue, but This is a monorepo with pnpm, but I guess it should be the same with any other tool, I have a package with the next app So I added this setting to my eslintrc.js: And that fixes the issue, since it is now correctly parsing my tsconfig.json for that monorepo package and it seems smart enough to recognise my defined path there: Update: For this to work fine in a new project, I also needed to install: Hope it works for you 👍 |
@ottodevs For those who are in the same situation, I'm sharing my settings: My dependencies version:
settings: {
"import/resolver": {
typescript: {
alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
project: __dirname,
},
node: true,
},
},
"baseUrl": ".",
"paths": {
"~/*": ["./app/*"],
"@routes/*": ["./app/routes/*"]
},
import { vitePlugin as remix } from "@remix-run/dev";
import { installGlobals } from "@remix-run/node";
import { defineConfig } from "vite";
import { vercelPreset } from "@vercel/remix/vite";
import tsconfigPaths from "vite-tsconfig-paths";
installGlobals();
export default defineConfig({
plugins: [remix({ presets: [vercelPreset()] }), tsconfigPaths()],
}); |
Unfortunately not working in eslint v9 for me. |
I have this eslint config:
whenever I use an alias path I get an error like
Unable to resolve the path to module '@features/products/product.routes'.
I added the paths to
tsconfig.json
and I installedeslint-import-resolver-custom-alias
or eslint-import-resolver-typescript but it does not fix the issue.eslint-plugin-import: v2.26.0.
The text was updated successfully, but these errors were encountered: