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 { loadFile, template } from 'presetter';
import { getRollupParameter } from './rollup'; import { getRollupParameter } from './rollup';

View File

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