fix(types): allow string resourceQueryExclude#48
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the public resourceQueryExclude option typing and documentation to reflect the plugin’s existing runtime behavior of accepting string patterns (in addition to RegExp), and extends the test suite to cover a string-based exclusion.
Changes:
- Added a shared
ResourceQueryExcludetype and used it forPluginOptions/ResolvedOptions. - Updated README docs for
resourceQueryExcludeto include string support and usage examples. - Added a test case ensuring string patterns work for excluding resource queries.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/options.ts |
Introduces ResourceQueryExclude and applies it to option typings. |
README.md |
Updates the documented option type and explains string-to-RegExp behavior with examples. |
test/resource-query.test.js |
Adds coverage for resourceQueryExclude when provided as a string. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| as `raw` in `import './file.js?raw'`. | ||
|
|
||
| String values are converted to `RegExp`. Use anchors when you need an exact | ||
| match. |
| expect(stats.hasErrors()).toBe(false); | ||
| }); | ||
|
|
||
| it('should exclude the match resource query from string pattern', async () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR aligns the public
resourceQueryExcludeoption type and docs with runtime behavior by allowing string patterns alongsideRegExpvalues. It adds a shared option type, documents string conversion toRegExpwith examples, and covers string patterns in the resource query test.