Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
h0adp0re opened this issue Feb 7, 2024 · 2 comments
Open

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

h0adp0re opened this issue Feb 7, 2024 · 2 comments

Comments

@h0adp0re
Copy link

h0adp0re commented Feb 7, 2024

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
Copy link
Member

veritem commented Feb 7, 2024

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
Copy link
Author

h0adp0re commented Feb 7, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants