Merge pull request #32516 from backstage/freben/nodecolon

Add a rule for the use of `node:` prefix on native imports
This commit is contained in:
Fredrik Adelöw
2026-01-27 14:17:14 +01:00
committed by GitHub
444 changed files with 749 additions and 634 deletions
+4 -2
View File
@@ -16,10 +16,12 @@
*/
/* eslint-disable no-restricted-syntax */
const path = require('path');
const path = require('node:path');
// Figure out whether we're running inside the backstage repo or as an installed dependency
const isLocal = require('fs').existsSync(path.resolve(__dirname, '../src'));
const isLocal = require('node:fs').existsSync(
path.resolve(__dirname, '../src'),
);
if (!isLocal || process.env.BACKSTAGE_E2E_CLI_TEST) {
require('..');
+1 -1
View File
@@ -16,7 +16,7 @@
*/
const fs = require('fs-extra');
const path = require('path');
const path = require('node:path');
const YARN_REGISTRY = 'https://registry.yarnpkg.com';
const NPM_REGISTRY = 'https://registry.npmjs.org';
+1 -1
View File
@@ -18,7 +18,7 @@
/* eslint-disable no-restricted-syntax */
const fs = require('fs-extra');
const path = require('path');
const path = require('node:path');
async function main() {
const pkgPath = path.resolve(__dirname, '../package.json');
+1 -1
View File
@@ -18,7 +18,7 @@
/* eslint-disable no-restricted-syntax */
const fs = require('fs-extra');
const path = require('path');
const path = require('node:path');
async function main() {
const pkgPath = path.resolve(__dirname, '../package.json');
+2 -2
View File
@@ -15,12 +15,12 @@
*/
import inquirer from 'inquirer';
import path from 'path';
import path from 'node:path';
import { Command } from 'commander';
import * as tasks from './lib/tasks';
import createApp from './createApp';
import { findPaths } from '@backstage/cli-common';
import { tmpdir } from 'os';
import { tmpdir } from 'node:os';
import { createMockDirectory } from '@backstage/backend-test-utils';
jest.mock('./lib/tasks');
+2 -2
View File
@@ -17,9 +17,9 @@
import chalk from 'chalk';
import { OptionValues } from 'commander';
import inquirer, { Answers } from 'inquirer';
import { resolve as resolvePath } from 'path';
import { resolve as resolvePath } from 'node:path';
import { findPaths } from '@backstage/cli-common';
import os from 'os';
import os from 'node:os';
import fs from 'fs-extra';
import {
Task,
+3 -3
View File
@@ -15,9 +15,9 @@
*/
import fs from 'fs-extra';
import child_process from 'child_process';
import { resolve as resolvePath } from 'path';
import os from 'os';
import child_process from 'node:child_process';
import { resolve as resolvePath } from 'node:path';
import os from 'node:os';
import {
Task,
buildAppTask,
+4 -4
View File
@@ -27,11 +27,11 @@ import {
dirname,
resolve as resolvePath,
relative as relativePath,
} from 'path';
import { exec as execCb } from 'child_process';
} from 'node:path';
import { exec as execCb } from 'node:child_process';
import { packageVersions } from './versions';
import { promisify } from 'util';
import os from 'os';
import { promisify } from 'node:util';
import os from 'node:os';
const TASK_NAME_MAX_LENGTH = 14;
const TEN_MINUTES_MS = 1000 * 60 * 10;