ESLint reports Unable to resolve path to module
errors when using the modular admin SDK
#1359
-
When using the new modular admin SDK in a Typescript project, eslint's
This happens for every occurrance. The imports are just regular imports like this: import { DocumentReference, getFirestore, Timestamp } from 'firebase-admin/firestore'
import { getStorage } from 'firebase-admin/storage' So this seems to be a bug as I'm using it pretty straightforward. Is anyone else running into this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Does your code compile despite the lint errors? |
Beta Was this translation helpful? Give feedback.
-
It looks like But I believe this is a bug/limitation in |
Beta Was this translation helpful? Give feedback.
It looks like
import/no-unresolved
is part of a custom ESLint plugin. I had to install the NPM packageeslint-plugin-import
, and addplugin:import/recommended
to the ESLint config file for the rule to activate. With these config changes I'm able to reproduce the errors mentioned above.But I believe this is a bug/limitation in
eslint-plugin-import
(see import-js/eslint-plugin-import#1868). The code is indeed valid, and compiled bytsc
. VSCode can also successfully resolve the module entry points.