Skip to content

Commit

Permalink
chore: update deno_lint binary used in CI to v0.5.0 (#10652)
Browse files Browse the repository at this point in the history
  • Loading branch information
magurotuna authored and piscisaureus committed May 31, 2021
1 parent f3108e7 commit 226ce4b
Show file tree
Hide file tree
Showing 51 changed files with 59 additions and 69 deletions.
1 change: 0 additions & 1 deletion cli/dts/lib.deno.shared_globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,6 @@ declare class CustomEvent<T = any> extends Event {

interface ErrorConstructor {
/** See https://v8.dev/docs/stack-trace-api#stack-trace-collection-for-custom-exceptions. */
// eslint-disable-next-line @typescript-eslint/ban-types
captureStackTrace(error: Object, constructor?: Function): void;
// TODO(nayeemrmn): Support `Error.prepareStackTrace()`. We currently use this
// internally in a way that makes it unavailable for users.
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/018_async_catch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ async function call(): Promise<void> {
console.log("before await fn()");
await fn();
console.log("after await fn()");
} catch (error) {
} catch (_error) {
console.log("catch");
}
console.log("after try-catch");
Expand Down
1 change: 0 additions & 1 deletion cli/tests/038_checkjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
consol.log("hello world!");

// the following error should be ignored and not output to the console
// eslint-disable-next-line
const foo = new Foo();
4 changes: 2 additions & 2 deletions cli/tests/038_checkjs.js.out
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ consol.log("hello world!");
TS2552 [ERROR]: Cannot find name 'Foo'. Did you mean 'foo'?
const foo = new Foo();
~~~
at [WILDCARD]tests/038_checkjs.js:6:17
at [WILDCARD]tests/038_checkjs.js:5:17

'foo' is declared here.
const foo = new Foo();
~~~
at [WILDCARD]tests/038_checkjs.js:6:7
at [WILDCARD]tests/038_checkjs.js:5:7

Found 2 errors.
1 change: 0 additions & 1 deletion cli/tests/048_media_types_jsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { loaded as loadedJsx3 } from "http://localhost:4545/cli/tests/subdir/mt_
import { loaded as loadedJsx4 } from "http://localhost:4545/cli/tests/subdir/mt_application_x_javascript_jsx.j4.jsx";

declare global {
// deno-lint-ignore no-namespace
namespace JSX {
interface IntrinsicElements {
// deno-lint-ignore no-explicit-any
Expand Down
4 changes: 2 additions & 2 deletions cli/tests/067_test_no_run_type_error.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[WILDCARD]error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'.
const a: string = 1;
^
const _a: string = 1;
~~
at [WILDCARD]foo_test.ts[WILDCARD]
6 changes: 3 additions & 3 deletions cli/tests/076_info_json_deps_order.out
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"code": "file://[WILDCARD]/cli/tests/recursive_imports/A.ts"
}
],
"size": 46,
"size": 81,
"mediaType": "TypeScript",
"local": "[WILDCARD]076_info_json_deps_order.ts",
"checksum": "88b144f362d31ac42263648aadef727dd36d039d3b8ac0248fdaff25d4de415a"
"checksum": "5dd40fe33e5924cca513489ce568e86c9b9fe318a87975403c8923629018680d"
},
{
"specifier": "file://[WILDCARD]/cli/tests/recursive_imports/A.ts",
Expand Down Expand Up @@ -81,5 +81,5 @@
"checksum": "01b595d69514bfd001ba2cf421feabeaef559513f10697bf1a22781f8a8ed7f0"
}
],
"size": 440
"size": 475
}
1 change: 1 addition & 0 deletions cli/tests/076_info_json_deps_order.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// deno-lint-ignore no-unused-vars
import { A } from "./recursive_imports/A.ts";
2 changes: 1 addition & 1 deletion cli/tests/091_use_define_for_class_fields.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class A {
class _A {
b = this.a;
constructor(public a: unknown) {}
}
1 change: 0 additions & 1 deletion cli/tests/deno_doc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** Some JSDoc */
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
export function foo() {
}
1 change: 0 additions & 1 deletion cli/tests/error_004_missing_module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line
import * as badModule from "./bad-module.ts";

console.log(badModule);
2 changes: 1 addition & 1 deletion cli/tests/error_004_missing_module.ts.out
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[WILDCARD]error: Cannot resolve module "file:///[WILDCARD]cli/tests/bad-module.ts" from "file:///[WILDCARD]cli/tests/error_004_missing_module.ts".
at file:///[WILDCARD]cli/tests/error_004_missing_module.ts:2:0
at file:///[WILDCARD]cli/tests/error_004_missing_module.ts:1:0
3 changes: 1 addition & 2 deletions cli/tests/error_005_missing_dynamic_import.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
(async (): Promise<void> => {
// eslint-disable-next-line
const badModule = await import("./bad-module.ts");
const _badModule = await import("./bad-module.ts");
})();
6 changes: 3 additions & 3 deletions cli/tests/error_005_missing_dynamic_import.ts.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: Uncaught (in promise) TypeError: Cannot resolve module "[WILDCARD]/cli/tests/bad-module.ts".
const badModule = await import("./bad-module.ts");
^
at async file://[WILDCARD]/error_005_missing_dynamic_import.ts:3:21
const _badModule = await import("./bad-module.ts");
^
at async file://[WILDCARD]/error_005_missing_dynamic_import.ts:2:22
1 change: 0 additions & 1 deletion cli/tests/error_008_checkjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
consol.log("hello world!");

// the following error should be ignored and not output to the console
// eslint-disable-next-line
const foo = new Foo();
1 change: 0 additions & 1 deletion cli/tests/error_011_bad_module_specifier.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line
import * as badModule from "bad-module.ts";

console.log(badModule);
3 changes: 1 addition & 2 deletions cli/tests/error_012_bad_dynamic_import_specifier.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
(async (): Promise<void> => {
// eslint-disable-next-line
const badModule = await import("bad-module.ts");
const _badModule = await import("bad-module.ts");
})();
6 changes: 3 additions & 3 deletions cli/tests/error_012_bad_dynamic_import_specifier.ts.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Check [WILDCARD]error_012_bad_dynamic_import_specifier.ts
error: Uncaught (in promise) TypeError: relative import path "bad-module.ts" not prefixed with / or ./ or ../ Imported from "[WILDCARD]/error_012_bad_dynamic_import_specifier.ts"
const badModule = await import("bad-module.ts");
^
at async file:///[WILDCARD]/error_012_bad_dynamic_import_specifier.ts:3:21
const _badModule = await import("bad-module.ts");
^
at async file:///[WILDCARD]/error_012_bad_dynamic_import_specifier.ts:2:22
2 changes: 1 addition & 1 deletion cli/tests/file_exists.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
try {
await Deno.open(Deno.args[0]);
Deno.exit(0);
} catch (e) {
} catch (_e) {
Deno.exit(1);
}
1 change: 1 addition & 0 deletions cli/tests/heapstats.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function allocTest(alloc, allocAssert, deallocAssert) {
const t1 = sample();

// Alloc
// deno-lint-ignore no-unused-vars
let x = alloc();
const t2 = sample();
allocAssert(delta(t1, t2));
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/no_validate_asm.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// V8 logs any asmjs validation errors to stdout, but it shows line numbers that
// are non-existent in the source.

const asmJsModule = function () {
const _asmJsModule = function () {
"use asm";

function func(
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/resolve_dns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ console.log(JSON.stringify(txt));

try {
await Deno.resolveDns("not-found-example.com", "A", nameServer);
} catch (e) {
} catch (_e) {
console.log("Error thrown for not-found-example.com");
}
2 changes: 1 addition & 1 deletion cli/tests/test/unhandled_rejection.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
new Promise((resolve, reject) => {
new Promise((_resolve, reject) => {
reject(new Error("rejection"));
});
2 changes: 1 addition & 1 deletion cli/tests/test_type_error/foo_test.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
const a: string = 1;
const _a: string = 1;
2 changes: 1 addition & 1 deletion cli/tests/unit/opcall_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ unitTest(async function sendAsyncStackTrace() {
declare global {
namespace Deno {
// deno-lint-ignore no-explicit-any
var core: any; // eslint-disable-line no-var
var core: any;
}
}

Expand Down
2 changes: 1 addition & 1 deletion cli/tests/workers/bench_large_message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function oneWorker(i: number) {
new URL("worker_large_message.js", import.meta.url).href,
{ type: "module" },
);
worker.onmessage = (e): void => {
worker.onmessage = (_e): void => {
if (countDown > 0) {
countDown--;
return;
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/workers/permissions_blob_local.ts.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: Uncaught (in worker "") Requires read access to "[WILDCARD]local_file.ts", run again with the --allow-read flag
at blob:null/[WILDCARD]:1:0
error: Uncaught (in promise) Error: Unhandled error event reached main worker.
at Worker.#poll (deno:runtime/js/11_workers.js:246:23)
at Worker.#poll (deno:runtime/js/11_workers.js:245:23)
2 changes: 1 addition & 1 deletion cli/tests/workers/permissions_blob_remote.ts.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: Uncaught (in worker "") Requires net access to "example.com", run again with the --allow-net flag
at blob:null/[WILDCARD]:1:0
error: Uncaught (in promise) Error: Unhandled error event reached main worker.
at Worker.#poll (deno:runtime/js/11_workers.js:246:23)
at Worker.#poll (deno:runtime/js/11_workers.js:245:23)
2 changes: 1 addition & 1 deletion cli/tests/workers/permissions_data_local.ts.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: Uncaught (in worker "") Requires read access to "[WILDCARD]local_file.ts", run again with the --allow-read flag
at data:application/javascript;base64,[WILDCARD]:1:0
error: Uncaught (in promise) Error: Unhandled error event reached main worker.
at Worker.#poll (deno:runtime/js/11_workers.js:246:23)
at Worker.#poll (deno:runtime/js/11_workers.js:245:23)
2 changes: 1 addition & 1 deletion cli/tests/workers/permissions_data_remote.ts.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: Uncaught (in worker "") Requires net access to "example.com", run again with the --allow-net flag
at data:application/javascript;base64,aW1wb3J0ICJodHRwczovL2V4YW1wbGUuY29tL3NvbWUvZmlsZS50cyI7:1:0
error: Uncaught (in promise) Error: Unhandled error event reached main worker.
at Worker.#poll (deno:runtime/js/11_workers.js:246:23)
at Worker.#poll (deno:runtime/js/11_workers.js:245:23)
2 changes: 1 addition & 1 deletion cli/tests/workers/permissions_dynamic_remote.ts.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ await import("https://example.com/some/file.ts");
^
at async http://localhost:4545/cli/tests/workers/dynamic_remote.ts:2:1
[WILDCARD]error: Uncaught (in promise) Error: Unhandled error event reached main worker.
at Worker.#poll (deno:runtime/js/11_workers.js:246:23)
at Worker.#poll (deno:runtime/js/11_workers.js:245:23)
2 changes: 1 addition & 1 deletion cli/tests/workers/permissions_remote_remote.ts.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: Uncaught (in worker "") Requires net access to "example.com", run again with the --allow-net flag
at http://localhost:4545/cli/tests/workers/static_remote.ts:2:0
error: Uncaught (in promise) Error: Unhandled error event reached main worker.
at Worker.#poll (deno:runtime/js/11_workers.js:246:23)
at Worker.#poll (deno:runtime/js/11_workers.js:245:23)
4 changes: 2 additions & 2 deletions cli/tests/workers/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ Deno.test({
{ type: "module" },
);

racyWorker.onmessage = (e): void => {
racyWorker.onmessage = (_e): void => {
setTimeout(() => {
promise.resolve();
}, 100);
Expand Down Expand Up @@ -353,7 +353,7 @@ Deno.test({
);
const arr: number[] = [];
w.addEventListener("message", () => arr.push(1));
w.onmessage = (e): void => {
w.onmessage = (_e): void => {
arr.push(2);
};
w.addEventListener("message", () => arr.push(3));
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/workers/worker_large_message.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const dataSmall = "";
const dataLarge = "x".repeat(10 * 1024);

onmessage = function (e) {
onmessage = function (_e) {
for (let i = 0; i <= 10; i++) {
if (i % 2 == 0) {
postMessage(dataLarge);
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/workers/worker_with_top_level_await.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function delay(ms: number): Promise<void> {
});
}

onmessage = (e: MessageEvent) => {
onmessage = (_e: MessageEvent) => {
postMessage("triggered worker handler");
close();
};
Expand Down
2 changes: 0 additions & 2 deletions cli/tsc/compiler.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import * as _ts from "../dts/typescript";

declare global {
// deno-lint-ignore no-namespace
namespace ts {
var libs: string[];
var libMap: Map<string, string>;
Expand All @@ -22,7 +21,6 @@ declare global {
var performance: Performance;
}

// deno-lint-ignore no-namespace
namespace ts {
export = _ts;
}
Expand Down
2 changes: 1 addition & 1 deletion extensions/fetch/21_formdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/// <reference lib="esnext" />
"use strict";

((window) => {
((_window) => {
const webidl = globalThis.__bootstrap.webidl;
const { Blob, File, _byteSequence } = globalThis.__bootstrap.file;

Expand Down
6 changes: 3 additions & 3 deletions extensions/fetch/23_request.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
const { HTTP_TOKEN_CODE_POINT_RE, byteUpperCase } = window.__bootstrap.infra;
const { URL } = window.__bootstrap.url;
const { guardFromHeaders } = window.__bootstrap.headers;
const { InnerBody, mixinBody, extractBody } = window.__bootstrap.fetchBody;
const { mixinBody, extractBody } = window.__bootstrap.fetchBody;
const { getLocationHref } = window.__bootstrap.location;
const mimesniff = window.__bootstrap.mimesniff;
const {
Expand All @@ -38,7 +38,7 @@
* @property {() => string} url
* @property {() => string} currentUrl
* @property {[string, string][]} headerList
* @property {null | InnerBody} body
* @property {null | typeof __window.bootstrap.fetchBody.InnerBody} body
* @property {"follow" | "error" | "manual"} redirectMode
* @property {number} redirectCount
* @property {string[]} urlList
Expand All @@ -61,7 +61,7 @@
* @param {string} method
* @param {string} url
* @param {[string, string][]} headerList
* @param {InnerBody} body
* @param {typeof __window.bootstrap.fetchBody.InnerBody} body
* @returns
*/
function newInnerRequest(method, url, headerList = [], body = null) {
Expand Down
4 changes: 2 additions & 2 deletions extensions/fetch/23_response.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
((window) => {
const webidl = window.__bootstrap.webidl;
const { HTTP_TAB_OR_SPACE, regexMatcher } = window.__bootstrap.infra;
const { InnerBody, extractBody, mixinBody } = window.__bootstrap.fetchBody;
const { extractBody, mixinBody } = window.__bootstrap.fetchBody;
const { getLocationHref } = window.__bootstrap.location;
const mimesniff = window.__bootstrap.mimesniff;
const { URL } = window.__bootstrap.url;
Expand Down Expand Up @@ -47,7 +47,7 @@
* @property {number} status
* @property {string} statusMessage
* @property {[string, string][]} headerList
* @property {null | InnerBody} body
* @property {null | typeof __window.bootstrap.fetchBody.InnerBody} body
* @property {string} [error]
*/

Expand Down
1 change: 1 addition & 0 deletions extensions/file/01_file.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
});
}

// deno-lint-ignore no-this-alias
const O = this;
/** @type {number} */
let relativeStart;
Expand Down
1 change: 0 additions & 1 deletion extensions/timers/01_timers.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@
opStartGlobalTimer(timeout);
await opWaitGlobalTimer();
pendingEvents--;
// eslint-disable-next-line @typescript-eslint/no-use-before-define
prepareReadyTimers();
}

Expand Down
2 changes: 1 addition & 1 deletion extensions/web/02_event.js
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@
for (let i = 0; i < handlers.length; i++) {
const listener = handlers[i];

let capture, once, passive, signal;
let capture, once, passive;
if (typeof listener.options === "boolean") {
capture = listener.options;
once = false;
Expand Down
2 changes: 1 addition & 1 deletion extensions/web/08_text_encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -4474,7 +4474,7 @@
return ((validLen + placeHoldersLen) * 3) / 4 - placeHoldersLen;
}

function _byteLength(b64, validLen, placeHoldersLen) {
function _byteLength(_b64, validLen, placeHoldersLen) {
return ((validLen + placeHoldersLen) * 3) / 4 - placeHoldersLen;
}

Expand Down
1 change: 0 additions & 1 deletion extensions/webidl/00_webidl.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@

function isArrayBufferDetached(V) {
try {
// eslint-disable-next-line no-new
new Uint8Array(V);
return false;
} catch {
Expand Down
1 change: 0 additions & 1 deletion runtime/js/11_workers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
const { getLocationHref } = window.__bootstrap.location;
const { log, pathFromURL } = window.__bootstrap.util;
const { defineEventHandler } = window.__bootstrap.webUtil;
const build = window.__bootstrap.build.build;

function createWorker(
specifier,
Expand Down
1 change: 1 addition & 0 deletions runtime/js/40_http.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
}

[Symbol.asyncIterator]() {
// deno-lint-ignore no-this-alias
const httpConn = this;
return {
async next() {
Expand Down
Loading

0 comments on commit 226ce4b

Please sign in to comment.