Appearance
此规则会对被注释掉的测试发出警告。它与 no-disabled-tests 规则类似。
no-disabled-tests
你可能会忘记取消注释某些测试。此规则会对被注释掉的测试发出警告。
如果测试不稳定,通常最好跳过它;如果不再需要,则删除它。
以下是此规则错误代码的示例:
// describe('foo', () => {}); // it('foo', () => {}); // test('foo', () => {}); // describe.skip('foo', () => {}); // it.skip('foo', () => {}); // test.skip('foo', () => {});
To enable this rule using the config file or in the CLI, you can use:
{ "plugins": ["vitest"], "rules": { "vitest/no-commented-out-tests": "error" } }
import { defineConfig } from "oxlint"; export default defineConfig({ plugins: ["vitest"], rules: { "vitest/no-commented-out-tests": "error", }, });
oxlint --deny vitest/no-commented-out-tests --vitest-plugin
此规则在 v0.0.8 中添加。
vitest/no-commented-out-tests Suspicious
它的作用
此规则会对被注释掉的测试发出警告。它与
no-disabled-tests规则类似。为什么这不好?
你可能会忘记取消注释某些测试。此规则会对被注释掉的测试发出警告。
如果测试不稳定,通常最好跳过它;如果不再需要,则删除它。
示例
以下是此规则错误代码的示例:
如何使用
To enable this rule using the config file or in the CLI, you can use:
版本
此规则在 v0.0.8 中添加。
参考资料