-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
I'm using Next.js and trying to setup aliases in my eslint.
My folder structure is:
/components/Cart.js
/pages/Home.js
/utils/addToCart.js
etc.
and I import them like:
import addToCart from '@/utils/addToCart'
Currently I have my eslint import resolver setup like this:
"settings": {
"import/resolver": {
"alias": [
["@/components", "./components"],
["@/utils", "./utils"],
["@/pages", "./pages"]
]
}
}
This works great, but I'd like to not have to create each alias individually. Instead, I'd prefer to set up a sort of root alias or wildcard alias like this:
["@/*", "./*"]
or ["@/$", "./$"]
or ["@/", "./"]
etc.
But everything I've tried has broken the imports and given me the "Unable to resolve path to module" error. Is there a correct way to handle this?
Metadata
Metadata
Assignees
Labels
No labels