vitest/valid-title
@vitest/eslint-plugin
Safe autofixRecommended
eslint.config.js
import vitest from "@vitest/eslint-plugin";
export default [
{
plugins: { vitest },
rules: {
"vitest/valid-title": "error",
},
},
];describe(1, () => {
it('should be a number', () => {
expect(1).toBe(1)
})
})describe('foo', () => {
it('Includes ng keyword Bar', () => {
expect(1).toBe(1)
})
})describe('foo', () => {
it(' ', () => {
expect(1).toBe(1)
})
})describe('1', () => {
it('should be a number', () => {
expect(1).toBe(1)
})
})describe('name', () => {
it('name', () => {})
})describe(foo, () => {
it(hoge, () => {})
})Examples from the ESLint documentation.
vitest/valid-title
@vitest/eslint-plugin
import vitest from "@vitest/eslint-plugin";
export default [
{
plugins: { vitest },
rules: {
"vitest/valid-title": "error",
},
},
];vitest/valid-title
vitest plugin · correctness
{
"plugins": [
"vitest"
],
"rules": {
"vitest/valid-title": "error"
}
}nursery/useValidTestTitle
nursery · since 2.5.14
{
"linter": {
"rules": {
"nursery": {
"useValidTestTitle": "error"
}
}
}
}Disallow using expect outside of it or test blocks
Disallow string interpolation in snapshots