Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

165
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda