Skip to content

Commit

Permalink
fix: use node: protocol for Node.js core modules (#1261)
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous authored May 10, 2022
1 parent 6ddb17b commit 7e99d88
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/init.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { promises as fsPromises, existsSync } from "fs";
import { join, relative, resolve } from "path";
import { inspect } from "util";
import { promises as fsPromises, existsSync } from "node:fs";
import { join, relative, resolve } from "node:path";
import { inspect } from "node:util";
import { defaultLogger } from "./logger.js";

const { copyFile, mkdir, readFile, writeFile, unlink } = fsPromises;
Expand Down
2 changes: 1 addition & 1 deletion lib/logger.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EOL } from "os";
import { EOL } from "node:os";

/** @type {import("../types/ybiq").Logger} */
export const defaultLogger = (msg) => {
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@
"rules": {
"import/extensions": "off",
"import/no-internal-modules": "off",
"import/prefer-default-export": "off"
"import/no-unresolved": "off",
"import/prefer-default-export": "off",
"node/no-missing-import": "off"
},
"overrides": [
{
Expand All @@ -165,6 +167,7 @@
},
"rules": {
"import/no-internal-modules": "off",
"import/no-unresolved": "off",
"node/no-unsupported-features/es-syntax": "off"
}
},
Expand Down
6 changes: 3 additions & 3 deletions test/init.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { copyFileSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
import { tmpdir } from "os";
import { join, resolve } from "path";
import { copyFileSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join, resolve } from "node:path";
import { init } from "../lib/init.js";
import { exec } from "./helpers/exec.js";
import { pkg } from "./helpers/pkg.js";
Expand Down
1 change: 0 additions & 1 deletion test/types.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-unresolved, node/no-missing-import -- Prevent error: TS7016: Could not find a declaration file for module '../lib/index.js'
import * as ybiq from "..";

const noop = (arg?: unknown): void => {
Expand Down

0 comments on commit 7e99d88

Please sign in to comment.