Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

164
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!