-
-
Notifications
You must be signed in to change notification settings - Fork 169
Closed
Description
Expected behavior
imports-as-dependencies supports types defined in the exports property.
Actual behavior
imports-as-dependencies reports: import points to package which is not found in dependencies. Because the rule only looks at the types and typings properties. importsAsDependencies.js#L106
Files
package.json
{
"name": "testcase",
"dependencies": {
"eslint": "8.42.0",
"eslint-plugin-jsdoc": "46.2.4",
"playwright": "1.34.3"
},
"eslintConfig": {
"plugins": [
"jsdoc"
],
"rules": {
"jsdoc/imports-as-dependencies": "error"
}
}
}index.js
/**
* @type {import("playwright")}
*/
var playwright;Environment
- Node version: 18.16.0
- ESLint version 8.42.0
eslint-plugin-jsdocversion: 46.2.4
Additional info
There's a similar problem with ESLint rules checking imports, as they only look at the main property:
no-missing-importsdoes not support "exports" in package.json mysticatea/eslint-plugin-node#255- node/no-missing-import false positive on chalk v5 mysticatea/eslint-plugin-node#314
no-unresolvedis not aware ofexportsdefinition inpackage.jsonimport-js/eslint-plugin-import#1810- Rule
import/no-unresolvedraise false positive when there is nomainfield in thepackage.jsonimport-js/eslint-plugin-import#2132
Lalem001