Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to resolve path to module 'firebase-admin/app' (ESLint)

I'm was trying to connect to my Firebase app by following the docs, but ESLint is complaining. I have already checked a related question, but the solutions proposed there doesn't seem to work for me. I have the following .eslint.js file:

module.exports = {
  extends: [
    'airbnb-typescript/base',
    'eslint:recommended',
    'plugin:@typescript-eslint/recommended',
    'plugin:typescript-sort-keys/recommended',
    'plugin:import/recommended',
    'prettier'
  ],
  parser       : '@typescript-eslint/parser',
  parserOptions: {
    ecmaFeatures: {
      modules: true
    },
    ecmaVersion: 6,
    project    : './tsconfig.json',
    sourceType : 'module'
  },
  plugins: ['@typescript-eslint', 'typescript-sort-keys', 'sort-keys-fix'],
  rules  : { ... }
}
like image 739
Anthony Luzquiños Avatar asked Oct 27 '21 23:10

Anthony Luzquiños


1 Answers

As of Firebase Admin v10 it uses exports in package.json for defining entry points. eslint-plugin-import does not support exports. Until it does you'll have to disable import/no-unresolved entirely or for each violation.

// eslint-disable-next-line import/no-unresolved
like image 132
abraham Avatar answered Sep 17 '22 13:09

abraham