Skip to content

Commit

Permalink
chore(ext/node): disable prefer-primordials on a per-file basis (deno…
Browse files Browse the repository at this point in the history
  • Loading branch information
petamoriken authored Jun 27, 2023
1 parent 814edcd commit e16b74d
Show file tree
Hide file tree
Showing 162 changed files with 539 additions and 12 deletions.
3 changes: 3 additions & 0 deletions ext/node/polyfills/_brotli.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import { zlib as constants } from "ext:deno_node/internal_binding/constants.ts";
import { TextEncoder } from "ext:deno_web/08_text_encoding.js";
import { Transform } from "ext:deno_node/stream.ts";
Expand Down
3 changes: 3 additions & 0 deletions ext/node/polyfills/_events.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

"use strict";

const kRejection = Symbol.for("nodejs.rejection");
Expand Down
3 changes: 3 additions & 0 deletions ext/node/polyfills/_fs/_fs_access.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import {
type CallbackWithError,
makeCallback,
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_appendFile.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import {
CallbackWithError,
isFd,
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_chmod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import type { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
import { getValidatedPath } from "ext:deno_node/internal/fs/utils.mjs";
import * as pathModule from "ext:deno_node/path.ts";
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_chown.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import {
type CallbackWithError,
makeCallback,
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_close.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import type { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
import { getValidatedFd } from "ext:deno_node/internal/fs/utils.mjs";

Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_common.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import {
O_APPEND,
O_CREAT,
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_copy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import type { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
import { makeCallback } from "ext:deno_node/_fs/_fs_common.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_dir.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import Dirent from "ext:deno_node/_fs/_fs_dirent.ts";
import { assert } from "ext:deno_node/_util/asserts.ts";
import { ERR_MISSING_ARGS } from "ext:deno_node/internal/errors.ts";
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_exists.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import { pathFromURL } from "ext:deno_web/00_infra.js";

type ExistsCallback = (exists: boolean) => void;
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_fdatasync.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";

export function fdatasync(
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_fstat.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import {
BigIntStats,
CFISBIS,
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_fsync.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";

export function fsync(
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_ftruncate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";

export function ftruncate(
Expand Down
3 changes: 3 additions & 0 deletions ext/node/polyfills/_fs/_fs_futimes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import type { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";

function getValidTime(
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_link.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import type { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
import { pathFromURL } from "ext:deno_web/00_infra.js";
import { promisify } from "ext:deno_node/internal/util.mjs";
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_lstat.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import {
BigIntStats,
CFISBIS,
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_mkdir.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import type { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
import { promisify } from "ext:deno_node/internal/util.mjs";
import { denoErrorToNodeError } from "ext:deno_node/internal/errors.ts";
Expand Down
3 changes: 3 additions & 0 deletions ext/node/polyfills/_fs/_fs_mkdtemp.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// Copyright Node.js contributors. All rights reserved. MIT License.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import { TextDecoder, TextEncoder } from "ext:deno_web/08_text_encoding.js";
import { existsSync } from "ext:deno_node/_fs/_fs_exists.ts";
import { mkdir, mkdirSync } from "ext:deno_node/_fs/_fs_mkdir.ts";
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_open.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import {
O_APPEND,
O_CREAT,
Expand Down
3 changes: 3 additions & 0 deletions ext/node/polyfills/_fs/_fs_opendir.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import Dir from "ext:deno_node/_fs/_fs_dir.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import {
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_read.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import { Buffer } from "ext:deno_node/buffer.ts";
import { ERR_INVALID_ARG_TYPE } from "ext:deno_node/internal/errors.ts";
import * as io from "ext:deno_io/12_io.js";
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_readFile.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import {
BinaryOptionsArgument,
FileOptionsArgument,
Expand Down
3 changes: 3 additions & 0 deletions ext/node/polyfills/_fs/_fs_readdir.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import { TextDecoder, TextEncoder } from "ext:deno_web/08_text_encoding.js";
import { asyncIterableToCallback } from "ext:deno_node/_fs/_fs_watch.ts";
import Dirent from "ext:deno_node/_fs/_fs_dirent.ts";
Expand Down
3 changes: 3 additions & 0 deletions ext/node/polyfills/_fs/_fs_readlink.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import { TextEncoder } from "ext:deno_web/08_text_encoding.js";
import {
intoCallbackAPIWithIntercept,
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_realpath.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import { promisify } from "ext:deno_node/internal/util.mjs";

type Options = { encoding: string };
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_rename.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import { pathFromURL } from "ext:deno_web/00_infra.js";
import { promisify } from "ext:deno_node/internal/util.mjs";

Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_rm.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import {
validateRmOptions,
validateRmOptionsSync,
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_rmdir.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import {
emitRecursiveRmdirWarning,
getValidatedPath,
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_stat.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import { denoErrorToNodeError } from "ext:deno_node/internal/errors.ts";
import { promisify } from "ext:deno_node/internal/util.mjs";

Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_symlink.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
import { pathFromURL } from "ext:deno_web/00_infra.js";
import { promisify } from "ext:deno_node/internal/util.mjs";
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_truncate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
import { pathFromURL } from "ext:deno_web/00_infra.js";
import { promisify } from "ext:deno_node/internal/util.mjs";
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_unlink.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import { promisify } from "ext:deno_node/internal/util.mjs";

export function unlink(path: string | URL, callback: (err?: Error) => void) {
Expand Down
3 changes: 3 additions & 0 deletions ext/node/polyfills/_fs/_fs_utimes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import type { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
import { pathFromURL } from "ext:deno_web/00_infra.js";
import { promisify } from "ext:deno_node/internal/util.mjs";
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_watch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import { basename } from "ext:deno_node/path.ts";
import { EventEmitter } from "ext:deno_node/events.ts";
import { notImplemented } from "ext:deno_node/_utils.ts";
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_write.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import { Buffer } from "ext:deno_node/buffer.ts";
import { validateEncoding, validateInteger } from "ext:deno_node/internal/validators.mjs";
import * as io from "ext:deno_io/12_io.js";
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_writeFile.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import { Encodings } from "ext:deno_node/_utils.ts";
import { pathFromURL } from "ext:deno_web/00_infra.js";
import { Buffer } from "ext:deno_node/buffer.ts";
Expand Down
4 changes: 4 additions & 0 deletions ext/node/polyfills/_fs/_fs_writev.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import { Buffer } from "ext:deno_node/buffer.ts";
import { validateBufferArray } from "ext:deno_node/internal/fs/utils.mjs";
import { getValidatedFd } from "ext:deno_node/internal/fs/utils.mjs";
Expand Down
3 changes: 3 additions & 0 deletions ext/node/polyfills/_http_agent.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// Copyright Joyent and Node contributors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import * as net from "ext:deno_node/net.ts";
import EventEmitter from "ext:deno_node/events.ts";
import { debuglog } from "ext:deno_node/internal/util/debuglog.ts";
Expand Down
3 changes: 3 additions & 0 deletions ext/node/polyfills/_http_common.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// Copyright Joyent and Node contributors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;
/**
* Verifies that the given val is a valid HTTP token
Expand Down
3 changes: 3 additions & 0 deletions ext/node/polyfills/_http_outgoing.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// Copyright Joyent and Node contributors. All rights reserved. MIT license.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

const core = globalThis.__bootstrap.core;
import { getDefaultHighWaterMark } from "ext:deno_node/internal/streams/state.mjs";
import assert from "ext:deno_node/internal/assert.mjs";
Expand Down
3 changes: 3 additions & 0 deletions ext/node/polyfills/_next_tick.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// Copyright Joyent, Inc. and other Node contributors.

// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

import { validateFunction } from "ext:deno_node/internal/validators.mjs";
import { _exiting } from "ext:deno_node/_process/exiting.ts";
import { FixedQueue } from "ext:deno_node/internal/fixed_queue.ts";
Expand Down
Loading

0 comments on commit e16b74d

Please sign in to comment.