style: make any node build-in modules explicitly imported first

This commit is contained in:
Alvis HT Tang 2023-05-05 19:20:29 +08:00
parent 2e5652d84b
commit 57578e9398
2 changed files with 7 additions and 6 deletions

View File

@ -13,7 +13,8 @@
* -------------------------------------------------------------------------
*/
import { resolve } from 'path';
import { resolve } from 'node:path';
import { loadFile, template } from 'presetter';
import { getRollupParameter } from './rollup';

View File

@ -13,16 +13,16 @@
* -------------------------------------------------------------------------
*/
import { readdirSync } from 'fs';
import { resolve } from 'path';
import { readdirSync } from 'node:fs';
import { resolve } from 'node:path';
import { loadDynamicMap, resolveContext } from 'presetter';
import getPresetAsset from '#index';
jest.mock('path', () => ({
jest.mock('node:path', () => ({
__esModule: true,
...jest.requireActual('path'),
resolve: jest.fn(jest.requireActual('path').resolve),
...jest.requireActual('node:path'),
resolve: jest.fn(jest.requireActual('node:path').resolve),
}));
describe('fn:getPresetAsset', () => {