-
Hey, I'm trying to get my eslint to stop complaining about the absolute imports in NextJs 10.0.3 but been struggling even with solutions I believe should be working. The application runs fine and can access all of the imported modules but eslint is showing me the following error:
Thanks ahead of time for any response and really appreciate the help. tsconfig.json
.eslintrc
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 4 replies
-
If anyone happens to run into this issue and get here I was able to solve the issue by adding the
|
Beta Was this translation helpful? Give feedback.
-
I have the same issue, but with JS, not TS. Discovered my Github Actions had been failing and cannot import using the previously, working absolute paths. Any ideas what changed in NextJS? |
Beta Was this translation helpful? Give feedback.
-
I had a similar issue, and my problem was to do with the tsconfig.json, the same thing for jsconfig.json if anybody's using JavaScript instead.
Hope it helps :) |
Beta Was this translation helpful? Give feedback.
-
Adding this line to the |
Beta Was this translation helpful? Give feedback.
-
getting the same issue Here's my
|
Beta Was this translation helpful? Give feedback.
-
I believe this is related to this stack overflow question here, which I've organized my findings in an answer here https://stackoverflow.com/a/73943138/16330123 (different from the one provided here). Hope this helps! |
Beta Was this translation helpful? Give feedback.
If anyone happens to run into this issue and get here I was able to solve the issue by adding the
src
directory in the include of mytsconfig.json
file also note this only worked if I set the following"baseUrl": ".", // removed src from baseurl "paths": { // ensure paths were updated relative to base url "@static/*": ["./public/static/*"], "@generated/*": ["./src/__generated__/*"], "@*": ["./src*"] } "include": [ "src", // add src directory to be included "next-env.d.ts", "**/*.ts", "**/*.tsx", "next.config.js", "public" ],