Skip to content

Commit 37c061f

Browse files
authored
Use node: import for Node.js built-in modules (#892)
1 parent 3ac6329 commit 37c061f

10 files changed

+17
-13
lines changed

.changeset/slow-timers-visit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"aws-sdk-js-codemod": patch
3+
---
4+
5+
Use node: import for Node.js built-in modules

biome.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"options": { "syntax": "shorthand" }
3535
},
3636
"useImportType": "off",
37-
"useNodejsImportProtocol": "off",
3837
"useTemplate": "off"
3938
},
4039
"suspicious": {

src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// It's kept that way so that users can reuse jscodeshift options.
2323

2424
// @ts-nocheck
25-
import path from "path";
25+
import path from "node:path";
2626
import Runner from "jscodeshift/dist/Runner";
2727

2828
import {

src/transforms/v2-to-v3/apis/removePromiseForCallExpression.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { emitWarning } from "node:process";
12
import { ASTPath, CallExpression, JSCodeshift, MemberExpression } from "jscodeshift";
2-
import { emitWarning } from "process";
33

44
export const removePromiseForCallExpression = (
55
j: JSCodeshift,

src/transforms/v2-to-v3/transformer.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { readdirSync } from "fs";
2-
import { join } from "path";
3-
import { readFile } from "fs/promises";
1+
import { readdirSync } from "node:fs";
2+
import { readFile } from "node:fs/promises";
3+
import { join } from "node:path";
44
import jscodeshift from "jscodeshift";
55
import { describe, expect, it } from "vitest";
66

src/transforms/v2-to-v3/utils/getMostUsedIndentationType.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EOL } from "os";
1+
import { EOL } from "node:os";
22

33
export enum IndentationType {
44
TAB = "tab",

src/transforms/v2-to-v3/utils/getValueIndentedWithTabs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EOL } from "os";
1+
import { EOL } from "node:os";
22

33
const INDENTATION_REGEX = /^(\t*)( {4})/;
44

src/utils/getJsCodeshiftParser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
// @ts-nocheck
55

6-
import { existsSync, readFileSync } from "fs";
7-
import { dirname, join } from "path";
6+
import { existsSync, readFileSync } from "node:fs";
7+
import { dirname, join } from "node:path";
88
import { DEFAULT_EXTENSIONS } from "@babel/core";
99
import argsParser from "jscodeshift/dist/argsParser";
1010

src/utils/getTransforms.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { readdirSync } from "fs";
2-
import { join } from "path";
1+
import { readdirSync } from "node:fs";
2+
import { join } from "node:path";
33

44
import { AwsSdkJsCodemodTransform } from "../transforms";
55

src/utils/getUpdatedTransformFile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { resolve } from "path";
1+
import { resolve } from "node:path";
22

33
export const getUpdatedTransformFile = (transformFolder: string) =>
44
resolve(__dirname, "..", "transforms", transformFolder, "transformer.js");

0 commit comments

Comments
 (0)