Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

166
Vistas
Firebase - Organize Functions Typescript Linter

The Firebase docs on how to organize your Functions (https://firebase.google.com/docs/functions/organize-functions) recommend an index.js file with the lines

const foo = require('./foo');
const bar = require('./bar');
exports.foo = foo.foo;
exports.bar = bar.bar;

However, when using Typescript, the default linter settings give the error "Require statement not part of import statement"

Changing the const variables to either import foo = require('./foo'); or import * as foo from './foo' resolves the linter error, but causes the deployed functions to reside at paths like /foo-foo rather than just /foo.

I know I can just disable the linter errors, but I'd like to know what the correct way to handle this is since I'm pretty new to TypeScript.

What is the proper way to handle these exports in typescript such that the deployed URL will be what you expect without using the exact syntax shown in Firebase doc examples?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda