0

eslint complains for one of the module. The module is installed and the code works fine. Only eslint complains.

Unable to resolve path to module '@azure/functions'.eslintimport/no-unresolved

az/index.ts

import { AzureFunction, Context } from "@azure/functions";
import { SentMessageInfo } from "nodemailer";

.eslintrc.js

module.exports = {
  root: true,
  env: {
    es6: true,
    node: true,
  },
  extends: [
    "eslint:recommended",
    "plugin:@typescript-eslint/recommended",
    "plugin:import/errors",
    "plugin:import/warnings",
    "plugin:import/typescript",
    "google",
  ],
  parser: "@typescript-eslint/parser",
  parserOptions: {
    project: ["tsconfig.json", "tsconfig.dev.json"],
    sourceType: "module",
  },
  ignorePatterns: [
    "/lib/**/*", // Ignore built files.
  ],
  plugins: [
    "@typescript-eslint",
    "import",
  ],
  rules: {
    "require-jsdoc": ["error", {
      "require": {
        "FunctionDeclaration": false,
        "MethodDefinition": false,
        "ClassDeclaration": false,
        "ArrowFunctionExpression": false,
        "FunctionExpression": false,
      },
    }],
  },
};

folder structure

|__ .eslintrc.js
|__ az
    |__ index.ts
4
  • sometimes vscode lose it try eslint --cache --ignore-path .gitignore \"**/*.{js,ts,tsx}\" and see if their is an error Commented Mar 12, 2021 at 16:24
  • is '@azure/functions available in your package.json? Commented Mar 12, 2021 at 16:28
  • yes its in package.json Commented Mar 12, 2021 at 16:43
  • @evgenifotia yes it throws same error Commented Mar 12, 2021 at 16:45

1 Answer 1

2

Do import { AzureFunction, Context } from "@azure/functions/Interfaces.d" I checked the code in node_modules and found that there is no index file

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.