Socket
Socket
Sign inDemoInstall

eslint-plugin-jsdoc

Package Overview
Dependencies
Maintainers
0
Versions
655
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-jsdoc - npm Package Compare versions

Comparing version 48.2.13 to 48.2.14

3

package.json

@@ -14,2 +14,3 @@ {

"esquery": "^1.5.0",
"parse-imports": "^2.0.0",
"semver": "^7.6.2",

@@ -144,3 +145,3 @@ "spdx-expression-parse": "^4.0.0"

},
"version": "48.2.13"
"version": "48.2.14"
}

@@ -1,4 +0,2 @@

import iterateJsdoc, {
parseComment,
} from '../iterateJsdoc.js';
import { parseImportsSync } from 'parse-imports';
import {

@@ -10,2 +8,5 @@ getJSDocComment,

} from '@es-joy/jsdoccomment';
import iterateJsdoc, {
parseComment,
} from '../iterateJsdoc.js';

@@ -113,3 +114,3 @@ const extraTypes = [

const typedefDeclarations = sourceCode.getAllComments()
const comments = sourceCode.getAllComments()
.filter((comment) => {

@@ -120,3 +121,5 @@ return (/^\*\s/u).test(comment.value);

return parseComment(commentNode, '');
})
});
const typedefDeclarations = comments
.flatMap((doc) => {

@@ -133,2 +136,47 @@ 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 = [];

@@ -200,2 +248,3 @@

.concat(typedefDeclarations)
.concat(importTags)
.concat(definedTypes)

@@ -202,0 +251,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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc