79510277

Date: 2025-03-14 21:48:03
Score: 0.5
Natty:
Report link

Posting an answer here to clarify my own findings based on @Yashashri Pawar's helpful answer above.

My tsconfig.json file:

{
  "compilerOptions": {
    "module": "NodeNext",
    "esModuleInterop": true,
    "moduleResolution": "nodenext",
    "noImplicitReturns": true,
    "noUnusedLocals": true,
    "outDir": "lib",
    "sourceMap": true,
    "strict": true,
    "target": "es2017"
  },
  "compileOnSave": true,
  "include": [
    "src"
  ]
}

My .eslintrc.js file:

module.exports = {
  root: true,
  env: {
    es6: true,
    node: true,
  },
  extends: [
    "eslint:recommended",
    "plugin:import/errors",
    "plugin:import/warnings",
    "plugin:import/typescript",
    "google",
    "plugin:@typescript-eslint/recommended",
  ],
  parser: "@typescript-eslint/parser",
  parserOptions: {
    project: ["tsconfig.json", "tsconfig.dev.json"],
    sourceType: "module",
  },
  ignorePatterns: [
    "/lib/**/*", // Ignore built files.
    "/generated/**/*", // Ignore generated files.
  ],
  plugins: [
    "@typescript-eslint",
    "import",
  ],
  rules: {
    "quotes": ["error", "double"],
    "import/no-unresolved": 0,
    "indent": ["error", 2],
  },
};

...and my .vscode/settings.json file:

{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit"
  },
  "eslint.workingDirectories": [
    "./functions",
  ]
}

That setup got me going with firebase functions out of the box. Upvote the above answer for proper credits ☝️

Reasons:
  • Blacklisted phrase (0.5): Upvote
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @Yashashri
  • Low reputation (0.5):
Posted by: Maxime Franchot