Biomejs 运行 linter 时没有错误,即使文件中显示错误

问题描述 投票:0回答:1

这是我的配置:

{
    "$schema": "https://biomejs.dev/schemas/1.6.4/schema.json",
    "organizeImports": {
        "enabled": true
    },
    "linter": {
        "enabled": true,
        "rules": {
            "recommended": true
        }
    },
    "files": {
        "ignore": ["./.next/server", "./.next/static"]
    }
}

当我运行 lint 时,它都是绿色的,即使在我的文件 index.js 中我已经声明了分配给不存在的函数的变量:

const test = myFunction(); // Cannot find name "myFunction" Did you mean "Function"?

index.js 文件也突出显示为红色,但 linter 仍然运行且没有错误。我尝试打破文档中提到的不同规则,但没有一个打破我的 linter:

biome lint .

biomejs
1个回答
0
投票

这是预期的(至少对于您提供的代码而言),因为推荐的规则集不包括

noUndeclaredViarables

检查playground,然后在左侧尝试将“推荐”更改为“全部”。您会看到差异。

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.