-
-
Notifications
You must be signed in to change notification settings - Fork 169
Closed
Labels
Description
Expected behavior
When importing types defined in another file using this one liner:
/** @typedef {import('../types/foo.js').Foo} Foo */(as suggested in jsdoc/jsdoc#1645 (comment))
eslint complains about syntax error
/src/foo/file.js
6:1 warning Syntax error in type: import('../types/sometype.js').SomeType jsdoc/valid-types
Even whan the type gets imported correctly.
Actual behavior
ESlint should not complain about this kind of typedefs.
ESLint Config
{
"root": true,
"env": {
"commonjs": false,
"es2021": true,
"node": true
},
"plugins": [
"jsdoc",
"eslint-comments"
],
"extends": [
"eslint:recommended",
"plugin:jsdoc/recommended"
],
"parserOptions": {
"ecmaVersion": 13,
"sourceType": "module"
}
}ESLint sample
File types/foo.js
/**
* My Type
* @typedef {object} Foo
* @property {string} Bar - This is bar
*/File index.js
/** @typedef {import('../types/foo.js').Foo} Foo */Environment
- Node version: v18.16.0
- ESLint version v8.41.0
eslint-plugin-jsdocversion: 44.2.5