chore: consistently import node modules with prefix (#3013)

Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
This commit is contained in:
Pascal Birchler
2025-08-25 22:11:27 +02:00
committed by GitHub
parent 415d3413c4
commit ee4feea006
168 changed files with 420 additions and 405 deletions

View File

@@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
import util from 'util';
import util from 'node:util';
import { ConsoleMessageItem } from '../types.js';
interface ConsolePatcherParams {

View File

@@ -9,7 +9,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest';
import { MarkdownDisplay } from './MarkdownDisplay.js';
import { LoadedSettings } from '../../config/settings.js';
import { SettingsContext } from '../contexts/SettingsContext.js';
import { EOL } from 'os';
import { EOL } from 'node:os';
describe('<MarkdownDisplay />', () => {
const baseProps = {

View File

@@ -6,7 +6,7 @@
import React from 'react';
import { Text, Box } from 'ink';
import { EOL } from 'os';
import { EOL } from 'node:os';
import { Colors } from '../colors.js';
import { colorizeCode } from './CodeColorizer.js';
import { TableRenderer } from './TableRenderer.js';

View File

@@ -4,10 +4,10 @@
* SPDX-License-Identifier: Apache-2.0
*/
import { exec } from 'child_process';
import { promisify } from 'util';
import * as fs from 'fs/promises';
import * as path from 'path';
import { exec } from 'node:child_process';
import { promisify } from 'node:util';
import * as fs from 'node:fs/promises';
import * as path from 'node:path';
const execAsync = promisify(exec);

View File

@@ -5,8 +5,8 @@
*/
import { vi, describe, it, expect, beforeEach, Mock } from 'vitest';
import { spawn, SpawnOptions } from 'child_process';
import { EventEmitter } from 'events';
import { spawn, SpawnOptions } from 'node:child_process';
import { EventEmitter } from 'node:events';
import {
isAtCommand,
isSlashCommand,
@@ -44,7 +44,7 @@ describe('commandUtils', () => {
beforeEach(async () => {
vi.clearAllMocks();
// Dynamically import and set up spawn mock
const { spawn } = await import('child_process');
const { spawn } = await import('node:child_process');
mockSpawn = spawn as Mock;
// Create mock child process with stdout/stderr emitters

View File

@@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
import { spawn, SpawnOptions } from 'child_process';
import { spawn, SpawnOptions } from 'node:child_process';
/**
* Checks if a query string potentially represents an '@' command.

View File

@@ -23,11 +23,11 @@
* to avoid conflicts with user customizations.
*/
import { promises as fs } from 'fs';
import * as os from 'os';
import * as path from 'path';
import { exec } from 'child_process';
import { promisify } from 'util';
import { promises as fs } from 'node:fs';
import * as os from 'node:os';
import * as path from 'node:path';
import { exec } from 'node:child_process';
import { promisify } from 'node:util';
import { isKittyProtocolEnabled } from './kittyProtocolDetector.js';
import { VSCODE_SHIFT_ENTER_SEQUENCE } from './platformConstants.js';

View File

@@ -5,7 +5,7 @@
*/
import stripAnsi from 'strip-ansi';
import { stripVTControlCharacters } from 'util';
import { stripVTControlCharacters } from 'node:util';
/**
* Calculates the maximum width of a multi-line ASCII art string.