# vitest/prefer-to-have-length 📝 Enforce using toHaveLength(). ⚠️ This rule _warns_ in the 🌐 `all` config. 🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). ```js // bad expect(files.length).toStrictEqual(1) // good expect(files).toHaveLength(1) ```