vitest/no-focused-tests
@vitest/eslint-plugin
Safe autofixRecommended
eslint.config.js
import vitest from "@vitest/eslint-plugin";
export default [
{
plugins: { vitest },
rules: {
"vitest/no-focused-tests": "error",
},
},
];it.only('test', () => {
// ...
})
test.only('it', () => {
// ...
})it('test', () => {
// ...
})
test('it', () => {
/* ... */
})Examples from the ESLint documentation.
vitest/no-focused-tests
@vitest/eslint-plugin
import vitest from "@vitest/eslint-plugin";
export default [
{
plugins: { vitest },
rules: {
"vitest/no-focused-tests": "error",
},
},
];vitest/no-focused-tests
vitest plugin · correctness
{
"plugins": [
"vitest"
],
"rules": {
"vitest/no-focused-tests": "error"
}
}suspicious/noFocusedTests
suspicious · since 1.6.0
{
"linter": {
"rules": {
"suspicious": {
"noFocusedTests": "error"
}
}
}
}Disallow using expect outside of it or test blocks
Enforce having expectation in test body