跳转到内容

useNodeAssertStrict

此内容尚不支持你的语言。

Diagnostic Category: lint/style/useNodeAssertStrict

Since: v1.6.0

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"
code-block.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"