Skip to content

Commit 0cd8f41

Browse files
authored
perf: use node: prefix to bypass require.cache call for builtins (#4302)
1 parent 12281b6 commit 0cd8f41

File tree

40 files changed

+72
-72
lines changed

40 files changed

+72
-72
lines changed

@alias/commitlint/cli.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {test, expect} from 'vitest';
2-
import {createRequire} from 'module';
3-
import path from 'path';
4-
import {fileURLToPath} from 'url';
2+
import {createRequire} from 'node:module';
3+
import path from 'node:path';
4+
import {fileURLToPath} from 'node:url';
55

66
import {x} from 'tinyexec';
77
import {fix} from '@commitlint/test';

@commitlint/cli/index.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const path = require('path');
1+
const path = require('node:path');
22

33
module.exports = path.join(__dirname, 'cli.js');

@commitlint/cli/src/cli.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {describe, test, expect} from 'vitest';
2-
import {createRequire} from 'module';
3-
import path from 'path';
4-
import {fileURLToPath} from 'url';
2+
import {createRequire} from 'node:module';
3+
import path from 'node:path';
4+
import {fileURLToPath} from 'node:url';
55
import {fix, git} from '@commitlint/test';
66
import fs from 'fs-extra';
77
import merge from 'lodash.merge';

@commitlint/cli/src/cli.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import {createRequire} from 'module';
2-
import path from 'path';
3-
import {fileURLToPath, pathToFileURL} from 'url';
4-
import util from 'util';
1+
import {createRequire} from 'node:module';
2+
import path from 'node:path';
3+
import {fileURLToPath, pathToFileURL} from 'node:url';
4+
import util from 'node:util';
55

66
import lint from '@commitlint/lint';
77
import load, {resolveFromSilent, resolveGlobalSilent} from '@commitlint/load';

@commitlint/config-conventional/src/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {test, expect} from 'vitest';
2-
import path from 'path';
3-
import {pathToFileURL} from 'url';
2+
import path from 'node:path';
3+
import {pathToFileURL} from 'node:url';
44

55
import lint from '@commitlint/lint';
66

@commitlint/config-lerna-scopes/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {createRequire} from 'module';
2-
import Path from 'path';
1+
import {createRequire} from 'node:module';
2+
import Path from 'node:path';
33

44
import {globSync} from 'glob';
55
import importFrom from 'import-from';

@commitlint/config-lerna-scopes/index.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {test, expect} from 'vitest';
2-
import path from 'path';
3-
import {fileURLToPath} from 'url';
2+
import path from 'node:path';
3+
import {fileURLToPath} from 'node:url';
44

55
import {npm} from '@commitlint/test';
66

@commitlint/config-nx-scopes/index.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {test, expect} from 'vitest';
2-
import path from 'path';
3-
import {fileURLToPath} from 'url';
2+
import path from 'node:path';
3+
import {fileURLToPath} from 'node:url';
44

55
import {npm} from '@commitlint/test';
66

@commitlint/config-patternplate/index.js

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

33
import configAngular from '@commitlint/config-angular';
44
import {glob} from 'glob';

@commitlint/config-pnpm-scopes/index.js

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

33
import fg from 'fast-glob';
44
import readYamlFile from 'read-yaml-file';

0 commit comments

Comments
 (0)