vitest-dev / eslint-plugin-vitest

eslint plugin for vitest
MIT License
324 stars 44 forks source link

Feature request: `consistent-test-file-path` #371

Open h0adp0re opened 8 months ago

h0adp0re commented 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.

The API could be something like this:

'vitest/consistent-test-file-path': [
  'error',
  {
    pattern: '**/__tests__/*',
  },
],
veritem commented 8 months ago

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?

h0adp0re commented 8 months ago

That's an even better idea! Thanks for thinking along.