n/prefer-global/console
eslint-plugin-n
No autofix
eslint.config.js
import n from "eslint-plugin-n";
export default [
{
plugins: { n },
rules: {
"n/prefer-global/console": "error",
},
},
];const console = require("console")
console.log("hello")console.log("hello")console.log("hello")const console = require("console")
console.log("hello")Examples from the ESLint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
n/prefer-global/console
eslint-plugin-n
import n from "eslint-plugin-n";
export default [
{
plugins: { n },
rules: {
"n/prefer-global/console": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Disallow unsupported Node.js built-in APIs on the specified version
Disallow unsupported ECMAScript syntax on the specified version
Enforce either TextDecoder or require("util").TextDecoder