mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 20:59:10 +00:00
make std deno-lint clean (#6240)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
parent
ca1c2ee822
commit
d0970daacd
17 changed files with 70 additions and 30 deletions
|
@ -659,7 +659,9 @@ function readPackage(requestPath: string): PackageInfo | null {
|
|||
json = new TextDecoder().decode(
|
||||
Deno.readFileSync(path.toNamespacedPath(jsonPath))
|
||||
);
|
||||
} catch {}
|
||||
} catch {
|
||||
// pass
|
||||
}
|
||||
|
||||
if (json === undefined) {
|
||||
packageJsonCache.set(jsonPath, null);
|
||||
|
@ -839,7 +841,7 @@ function applyExports(basePath: string, expansion: string): string {
|
|||
}
|
||||
|
||||
if (typeof pkgExports === "object") {
|
||||
if (pkgExports.hasOwnProperty(mappingKey)) {
|
||||
if (Object.prototype.hasOwnProperty.call(pkgExports, mappingKey)) {
|
||||
const mapping = pkgExports[mappingKey];
|
||||
return resolveExportsTarget(
|
||||
pathToFileURL(basePath + "/"),
|
||||
|
@ -910,7 +912,6 @@ function resolveExports(
|
|||
return path.resolve(nmPath, request);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function resolveExportsTarget(
|
||||
pkgPath: URL,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
@ -959,7 +960,7 @@ function resolveExportsTarget(
|
|||
}
|
||||
} else if (typeof target === "object" && target !== null) {
|
||||
// removed experimentalConditionalExports
|
||||
if (target.hasOwnProperty("default")) {
|
||||
if (Object.prototype.hasOwnProperty.call(target, "default")) {
|
||||
try {
|
||||
return resolveExportsTarget(
|
||||
pkgPath,
|
||||
|
@ -1012,7 +1013,7 @@ const CircularRequirePrototypeWarningProxy = new Proxy(
|
|||
},
|
||||
|
||||
getOwnPropertyDescriptor(target, prop): PropertyDescriptor | undefined {
|
||||
if (target.hasOwnProperty(prop)) {
|
||||
if (Object.prototype.hasOwnProperty.call(target, prop)) {
|
||||
return Object.getOwnPropertyDescriptor(target, prop);
|
||||
}
|
||||
emitCircularRequireWarning(prop);
|
||||
|
@ -1114,7 +1115,6 @@ interface RequireResolveFunction extends RequireResolve {
|
|||
}
|
||||
|
||||
interface RequireFunction extends Require {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
resolve: RequireResolveFunction;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
extensions: { [key: string]: (module: Module, filename: string) => any };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue