eslint-plugin-jsdoc
Advanced tools
Comparing version 48.2.14 to 48.2.15
@@ -14,3 +14,2 @@ { | ||
"esquery": "^1.5.0", | ||
"parse-imports": "^2.0.0", | ||
"semver": "^7.6.2", | ||
@@ -145,3 +144,3 @@ "spdx-expression-parse": "^4.0.0" | ||
}, | ||
"version": "48.2.14" | ||
"version": "48.2.15" | ||
} |
@@ -1,2 +0,4 @@ | ||
import { parseImportsSync } from 'parse-imports'; | ||
import iterateJsdoc, { | ||
parseComment, | ||
} from '../iterateJsdoc.js'; | ||
import { | ||
@@ -8,5 +10,2 @@ getJSDocComment, | ||
} from '@es-joy/jsdoccomment'; | ||
import iterateJsdoc, { | ||
parseComment, | ||
} from '../iterateJsdoc.js'; | ||
@@ -114,3 +113,3 @@ const extraTypes = [ | ||
const comments = sourceCode.getAllComments() | ||
const typedefDeclarations = sourceCode.getAllComments() | ||
.filter((comment) => { | ||
@@ -121,5 +120,3 @@ return (/^\*\s/u).test(comment.value); | ||
return parseComment(commentNode, ''); | ||
}); | ||
const typedefDeclarations = comments | ||
}) | ||
.flatMap((doc) => { | ||
@@ -136,47 +133,2 @@ return doc.tags.filter(({ | ||
const importTags = /** @type {string[]} */ (comments.flatMap((doc) => { | ||
return doc.tags.filter(({ | ||
tag, | ||
}) => { | ||
return tag === 'import'; | ||
}); | ||
}).flatMap((tag) => { | ||
const { | ||
type, name, description | ||
} = tag; | ||
const typePart = type ? `{${type}} `: ''; | ||
const imprt = 'import ' + (description | ||
? `${typePart}${name} ${description}` | ||
: `${typePart}${name}`); | ||
let imports; | ||
try { | ||
// Should technically await non-sync, but ESLint doesn't support sync rules; | ||
// thankfully, the Wasm load time is safely fast | ||
imports = parseImportsSync(imprt); | ||
} catch (err) { | ||
return null; | ||
} | ||
return [...imports].flatMap(({importClause}) => { | ||
/* c8 ignore next */ | ||
const {default: dflt, named, namespace} = importClause || {}; | ||
const types = []; | ||
if (dflt) { | ||
types.push(dflt); | ||
} | ||
if (namespace) { | ||
types.push(namespace); | ||
} | ||
if (named) { | ||
for (const {binding} of named) { | ||
types.push(binding); | ||
} | ||
} | ||
return types; | ||
}); | ||
}).filter(Boolean)); | ||
const ancestorNodes = []; | ||
@@ -248,3 +200,2 @@ | ||
.concat(typedefDeclarations) | ||
.concat(importTags) | ||
.concat(definedTypes) | ||
@@ -251,0 +202,0 @@ .concat(/** @type {string[]} */ (definedPreferredTypes)) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9
1844679
30397
- Removedparse-imports@^2.0.0
- Removedes-module-lexer@1.5.4(transitive)
- Removedparse-imports@2.2.1(transitive)
- Removedslashes@3.0.12(transitive)