fix(consistent-test-filename): correct options type #801
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #799
In #785 the options schema was corrected from the previously invalid schema
eslint-plugin-vitest/src/rules/consistent-test-filename.ts
Lines 33 to 38 in 4321439
to a valid one
eslint-plugin-vitest/src/rules/consistent-test-filename.ts
Lines 33 to 37 in 0d82d1e
As pointed out in #799 it used to be possible to use a
RegExpfor the rules options (due to the invalid schema and options retrievement viacontext).Since, according to the official ESLint documentation 1, rule options need to consist of JSON data types, I would stick with the fixed schema, which means the options must be passed as a string regex, for example:
However, what I've missed in #785 is that the
Optionstype should also just accept strings and that it makes more sense to pass the default options in this format as well.Footnotes
https://eslint.org/docs/latest/use/configure/configuration-files#configuring-rules ↩