Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/babel-preset-default/bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ builder( {
)
.then( ( output ) => writeFile( './build/polyfill.min.js', output.code ) )
.catch( ( error ) => {
// eslint-disable-next-line no-console
console.log( error );
process.exit( 1 );
} );
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,22 @@ if ( require.main === module ) {

// Validate arguments
if ( ! mapFile ) {
// eslint-disable-next-line no-console
console.error( `Map file argument is required.` );
process.exit( 1 );
}
if ( ! targetDir ) {
// eslint-disable-next-line no-console
console.error( `Target directory argument is required.` );
process.exit( 1 );
}
try {
fs.accessSync( mapFile );
} catch {
// eslint-disable-next-line no-console
console.error( `Map file "${ mapFile } doesn't exist.` );
process.exit( 1 );
}
try {
fs.accessSync( targetDir );
} catch {
// eslint-disable-next-line no-console
console.error( `Target directory "${ targetDir }"" doesn't exist.` );
process.exit( 1 );
}
Expand Down Expand Up @@ -88,14 +84,12 @@ if ( require.main === module ) {
try {
fs.accessSync( compiledFile );
} catch {
// eslint-disable-next-line no-console
console.warn(
`Couldn't find matching build file for Typescript file "${ compiledFile }".`
);
return file;
}

// eslint-disable-next-line no-console
console.log(
`Using compiled file "${ compiledFile }" for Typescript file "${ file }"`
);
Expand All @@ -110,7 +104,6 @@ if ( require.main === module ) {
copyFileToDir( sourceFile, targetDir )
);
} catch ( error ) {
// eslint-disable-next-line no-console
console.error(
`Something went wrong when copying source files to "${ targetDir }":`,
error
Expand Down
1 change: 0 additions & 1 deletion packages/react-native-editor/bin/extract-used-strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ const generatePotFiles = ( plugins, potFilesDir ) => {
}
);
} catch ( error ) {
// eslint-disable-next-line no-console
console.error( error );
process.exit( 1 );
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env node
/* eslint-disable no-console */

/**
* External dependencies
Expand Down Expand Up @@ -243,7 +242,7 @@ const getUsedStrings = ( usedStringsFile, domain ) => {
const generateIndexFile = ( translations, pluginDir ) => {
const indexNative = `/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */
/* eslint-disable prettier/prettier */

const translations = {
${ translations
.filter( Boolean )
Expand All @@ -253,9 +252,9 @@ const generateIndexFile = ( translations, pluginDir ) => {
)
.join( '\n' ) }
};

export const getTranslation = ( locale ) => translations[ locale ];

/* eslint-enable prettier/prettier */
`;

Expand Down Expand Up @@ -312,5 +311,3 @@ if ( require.main === module ) {
generateIndexFile( translations, pluginDir );
} );
}

/* eslint-enable no-console */
2 changes: 0 additions & 2 deletions packages/scripts/config/jest-environment-puppeteer/index.js

@aduth aduth May 14, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I didn't necessarily expect scripts to exempt the entire package here (as opposed to e.g. a scripts/ directory within a package), though based on what the scripts package actually is, I suppose the exception makes sense for the entire package.

Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
// https://github.com/facebook/jest/blob/1be8d737abd0e2f30e3314184a0efc372ad6d88f/packages/jest-jasmine2/src/jasmine/Env.ts#L250-L251
// Emitting an uncaughtException event to the process will throw an
// empty error which is very hard to debug in puppeteer context.
// eslint-disable-next-line no-console
console.error( error );

Check failure on line 35 in packages/scripts/config/jest-environment-puppeteer/index.js

View workflow job for this annotation

GitHub Actions / All (Node.js 24 on Linux)

Unexpected console statement.
};

const KEYS = {
Expand Down Expand Up @@ -70,8 +69,7 @@
// eslint-disable-next-line no-debugger
debugger;
} );
// eslint-disable-next-line no-console
console.log(

Check failure on line 72 in packages/scripts/config/jest-environment-puppeteer/index.js

View workflow job for this annotation

GitHub Actions / All (Node.js 24 on Linux)

Unexpected console statement.
chalk.blue(
'\n\n🕵️‍ Code is paused, press enter to resume'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
const messages = getMessages( _aggregatedResults.testResults );

for ( const message of messages ) {
// eslint-disable-next-line no-console
console.log( message );

Check failure on line 31 in packages/scripts/config/jest-github-actions-reporter/index.js

View workflow job for this annotation

GitHub Actions / All (Node.js 24 on Linux)

Unexpected console statement.
}
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/scripts/scripts/lint-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ if ( ! hasLintConfig ) {
];
const hasLegacyConfig = legacyConfigFiles.some( hasProjectFile );
if ( hasLegacyConfig ) {
// eslint-disable-next-line no-console
console.warn(
'Warning: Legacy eslintrc configuration detected. ' +
'ESLint v10 no longer supports eslintrc files. ' +
Expand Down
2 changes: 0 additions & 2 deletions packages/scripts/scripts/packages-update.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-console */
/**
* External dependencies
*/
Expand Down Expand Up @@ -82,4 +81,3 @@ function updatePackageJSON() {
}

updatePackageJSON();
/* eslint-enable no-console */
1 change: 0 additions & 1 deletion packages/scripts/scripts/test-playwright.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ try {
// First, try to load the package installed from among the optional peerDependencies.
loadConfig = require( '@wordpress/env/lib/config' ).loadConfig;
} catch {
// eslint-disable-next-line no-console
console.log(
'Notice: Could not find @wordpress/env package. Using WP_BASE_URL environment variable or else the default http://localhost:8889 URL for tests.'
);
Expand Down
4 changes: 0 additions & 4 deletions packages/scripts/utils/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@ const hasFileArgInCLI = () => getFileArgsFromCLI().length > 0;

const handleSignal = ( signal ) => {
if ( signal === 'SIGKILL' ) {
// eslint-disable-next-line no-console
console.log(
'The script failed because the process exited too early. ' +
'This probably means the system ran out of memory or someone called ' +
'`kill -9` on the process.'
);
} else if ( signal === 'SIGTERM' ) {
// eslint-disable-next-line no-console
console.log(
'The script failed because the process exited too early. ' +
'Someone might have called `kill` or `killall`, or the system could ' +
Expand All @@ -57,13 +55,11 @@ const handleSignal = ( signal ) => {

const spawnScript = ( scriptName, args = [], nodeArgs = [] ) => {
if ( ! scriptName ) {
// eslint-disable-next-line no-console
console.log( 'Script name is missing.' );
exit( 1 );
}

if ( ! hasScriptFile( scriptName ) ) {
// eslint-disable-next-line no-console
console.log(
'Unknown script "' +
scriptName +
Expand Down
1 change: 0 additions & 1 deletion tools/api-docs/gen-components-docs/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ await Promise.all(
);

try {
// eslint-disable-next-line no-console
console.log( `Writing docs to ${ outputFile }` );
return fs.writeFile( outputFile, docs );
} catch ( e ) {
Expand Down
1 change: 0 additions & 1 deletion tools/api-docs/gen-theme-reference.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ async function main() {
}

main().catch( ( error ) => {
// eslint-disable-next-line no-console
console.error( error );
process.exit( 1 );
} );
1 change: 0 additions & 1 deletion tools/api-docs/update-api-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ glob.stream( [
cwd: ROOT_DIR,
} );
} catch ( error ) {
// eslint-disable-next-line no-console
console.error( error );
process.exit( 1 );
}
Expand Down
10 changes: 1 addition & 9 deletions tools/eslint/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -564,15 +564,7 @@ export default dedupePlugins( [

// Override: CLI/bin/env files — allow console.
{
files: [
'bin/**/*.js',
'bin/**/*.mjs',
'tools/**/*.js',
'tools/**/*.mjs',
'tools/**/*.cjs',
'packages/env/**',
'packages/theme/bin/**/*.[tj]s?(x)',
],
files: [ '**/{bin,scripts,tools}/**', 'packages/env/**' ],
rules: {
'no-console': 'off',
},
Expand Down
Loading