n/prefer-import/assert-strict
eslint-plugin-n
No autofix
eslint.config.js
import n from "eslint-plugin-n";
export default [
{
plugins: { n },
rules: {
"n/prefer-import/assert-strict": "error",
},
},
];Enforce using node:assert/strict instead of node:assert.
import assert from "node:assert"
import("node:assert")
const assert = require("node:assert")import assert from "node:assert/strict"
import("node:assert/strict")
const assert = require("node:assert/strict")
// These forms already select strict assertion mode.
import { strict as strictAssert } from "node:assert"
const requiredAssert = require("node:assert").strictExamples 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-import/assert-strict
eslint-plugin-n
import n from "eslint-plugin-n";
export default [
{
plugins: { n },
rules: {
"n/prefer-import/assert-strict": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Enforce either URLSearchParams or require("url").URLSearchParams
Enforce either global timer functions or require("timers")
Require a timeout or signal for child processes