Skip to content

useNodeAssertStrict (since v1.6.0)

Diagnostic Category: lint/style/useNodeAssertStrict

Promotes the usage of node:assert/strict over node:assert.

If you prefer stricter assertions when using the Node.js assertion module, the package node:assert/strict exposes a set of alias for stricter assertions.

import * as assert from "node:assert"
style/useNodeAssertStrict.js:1:25 lint/style/useNodeAssertStrict  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━

   Use node:assert/strict instead.
  
  > 1 │ import * as assert from "node:assert"
                           ^^^^^^^^^^^^^
    2 │ 
  
   The use of stricter assertion is preferred.
  
   Safe fix: Replace with node:assert/strict.
  
    1 │ import·*·as·assert·from·"node:assert/strict"
                                      +++++++ 
import * as assert from "node:assert/strict"