Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ahabhgk committed Apr 12, 2024
1 parent 0734314 commit ffda9bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/DefinePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const createHash = require("./util/createHash");
/** @typedef {import("./NormalModule")} NormalModule */
/** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */
/** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */
/** @typedef {import("./javascript/JavascriptParser").Range} Range */
/** @typedef {import("./javascript/JavascriptParser").DestructuringAssignmentProperty} DestructuringAssignmentProperty */
/** @typedef {import("./javascript/JavascriptParser").Range} Range */
/** @typedef {import("./logging/Logger").Logger} Logger */

/** @typedef {null|undefined|RegExp|Function|string|number|boolean|bigint|undefined} CodeValuePrimitive */
Expand Down
10 changes: 4 additions & 6 deletions lib/dependencies/HarmonyImportSpecifierDependency.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency {
*/
getReferencedExports(moduleGraph, runtime) {
let ids = this.getIds(moduleGraph);
if (ids.length === 0)
return this._getReferencedExportsInDestructuring(moduleGraph);
if (ids.length === 0) return this._getReferencedExportsInDestructuring();
let namespaceObjectAsContext = this.namespaceObjectAsContext;
if (ids[0] === "default") {
const selfModule = moduleGraph.getParentModule(this);
Expand All @@ -166,7 +165,7 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency {
case "default-only":
case "default-with-named":
if (ids.length === 1)
return this._getReferencedExportsInDestructuring(moduleGraph);
return this._getReferencedExportsInDestructuring();
ids = ids.slice(1);
namespaceObjectAsContext = true;
break;
Expand All @@ -184,15 +183,14 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency {
ids = ids.slice(0, -1);
}

return this._getReferencedExportsInDestructuring(moduleGraph, ids);
return this._getReferencedExportsInDestructuring(ids);
}

/**
* @param {ModuleGraph} moduleGraph module graph
* @param {string[]=} ids ids
* @returns {(string[] | ReferencedExport)[]} referenced exports
*/
_getReferencedExportsInDestructuring(moduleGraph, ids) {
_getReferencedExportsInDestructuring(ids) {
if (this.referencedPropertiesInDestructuring) {
/** @type {ReferencedExport[]} */
const refs = [];
Expand Down

0 comments on commit ffda9bf

Please sign in to comment.