Open h0adp0re opened 8 months ago
Some projects nest test files next to relevant source files in several __tests__ directories. It would be handy to enforce this practice. I found out the hard way that consistent-test-filename does what it says and only uses basename.
__tests__
consistent-test-filename
basename
The API could be something like this:
'vitest/consistent-test-file-path': [ 'error', { pattern: '**/__tests__/*', }, ],
Why can't we add an optional file path option to the consistent-test-filename rule instead? Won't that be a good idea? What do you think?
That's an even better idea! Thanks for thinking along.
Some projects nest test files next to relevant source files in several
__tests__
directories. It would be handy to enforce this practice. I found out the hard way thatconsistent-test-filename
does what it says and only usesbasename
.The API could be something like this: