Skip to content

Commit 47e3d1d

Browse files
committed
refactor: use 'node:' protocols for Node.js built-in module imports
1 parent 451eee8 commit 47e3d1d

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22

3-
import * as fs from 'fs'
4-
import * as path from 'path'
3+
import * as fs from 'node:fs'
4+
import * as path from 'node:path'
55

66
import minimist from 'minimist'
77
import prompts from 'prompts'

template/base/vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'node:url'
22

33
import { defineConfig } from 'vite'
44
import legacy from '@vitejs/plugin-legacy'

template/config/jsx/vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'node:url'
22

33
import { defineConfig } from 'vite'
44
import legacy from '@vitejs/plugin-legacy'

utils/directoryTraverse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as fs from 'fs'
2-
import * as path from 'path'
1+
import * as fs from 'node:fs'
2+
import * as path from 'node:path'
33

44
export function preOrderDirectoryTraverse(dir, dirCallback, fileCallback) {
55
for (const filename of fs.readdirSync(dir)) {

utils/renderEslint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as fs from 'fs'
2-
import * as path from 'path'
1+
import * as fs from 'node:fs'
2+
import * as path from 'node:path'
33

44
import type { Linter } from 'eslint'
55

utils/renderTemplate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as fs from 'fs'
2-
import * as path from 'path'
1+
import * as fs from 'node:fs'
2+
import * as path from 'node:path'
33

44
import deepMerge from './deepMerge'
55
import sortDependencies from './sortDependencies'

0 commit comments

Comments
 (0)