debt - disable use of node.js path lib (#249425)

* debt - disable use of node.js `path` lib

* .
This commit is contained in:
Benjamin Pasero
2025-05-21 09:59:53 +02:00
committed by GitHub
parent 6209ba20b4
commit a8149189ec
4 changed files with 14 additions and 4 deletions
+1 -1
View File
@@ -821,7 +821,7 @@ export default tseslint.config(
'net',
'node-pty',
'os',
'path',
// 'path', NOT allowed: use src/vs/base/common/path.ts instead
'perf_hooks',
'readline',
'stream',
+1 -1
View File
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
// NOTE: VSCode's copy of nodejs path library to be usable in common (non-node) namespace
// Copied from: https://github.com/nodejs/node/commits/v20.18.2/lib/path.js
// Copied from: https://github.com/nodejs/node/commits/v22.15.0/lib/path.js
// Excluding: the change that adds primordials
// (https://github.com/nodejs/node/commit/187a862d221dec42fa9a5c4214e7034d9092792f and others)
// Excluding: the change that adds glob matching
+1 -1
View File
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { join } from 'path'; // using node.js 'path' only for historic reasons, should use our path lib if confident
import { join } from '../common/path.js';
import { promises } from 'fs';
import { mark } from '../common/performance.js';
import { ILanguagePacks, INLSConfiguration } from '../../nls.js';
@@ -4,9 +4,19 @@
*--------------------------------------------------------------------------------------------*/
import { homedir } from 'os';
import { resolve, isAbsolute, join } from 'path'; // using node.js 'path' only for historic reasons, should use our path lib if confident
import { NativeParsedArgs } from '../common/argv.js';
// This file used to be a pure JS file and was always
// importing `path` from node.js even though we ship
// our own version of the library and prefer to use
// that.
// However, resolution of user-data-path is critical
// and while our version of `path` is a copy of node.js
// one, you never know. As such, preserve the use of
// the built-in `path` lib for the time being.
// eslint-disable-next-line local/code-import-patterns
import { resolve, isAbsolute, join } from 'path';
const cwd = process.env['VSCODE_CWD'] || process.cwd();
/**