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
JavaScript
x
3
1
import { AzureFunction, Context } from "@azure/functions";
2
import { SentMessageInfo } from "nodemailer";
3
.eslintrc.js
JavaScript
1
39
39
1
module.exports = {
2
root: true,
3
env: {
4
es6: true,
5
node: true,
6
},
7
extends: [
8
"eslint:recommended",
9
"plugin:@typescript-eslint/recommended",
10
"plugin:import/errors",
11
"plugin:import/warnings",
12
"plugin:import/typescript",
13
"google",
14
],
15
parser: "@typescript-eslint/parser",
16
parserOptions: {
17
project: ["tsconfig.json", "tsconfig.dev.json"],
18
sourceType: "module",
19
},
20
ignorePatterns: [
21
"/lib/**/*", // Ignore built files.
22
],
23
plugins: [
24
"@typescript-eslint",
25
"import",
26
],
27
rules: {
28
"require-jsdoc": ["error", {
29
"require": {
30
"FunctionDeclaration": false,
31
"MethodDefinition": false,
32
"ClassDeclaration": false,
33
"ArrowFunctionExpression": false,
34
"FunctionExpression": false,
35
},
36
}],
37
},
38
};
39
folder structure
JavaScript
1
4
1
|__ .eslintrc.js
2
|__ az
3
|__ index.ts
4
Advertisement
Answer
Do import { AzureFunction, Context } from "@azure/functions/Interfaces.d"
I checked the code in node_modules
and found that there is no index file