fix: strip resource query #58
Merged
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.
This PR contains a:
Motivation / Use-Case
Prior to this PR, eslint-webpack-plugin was not stripping Webpack path queries in resource paths and was failing to resolve files with resource queries in its path (eg. "virtual files" created by Webpack loaders). This is a regression introduced in v2.2.0.
For example, mdvue-loader loads Markdown files as Vue components and also renders Vue code-blocks in the markdown file. To accomplish this, it imports the specific code-block as a virtual module via a query path like this:
Given a ESLintPlugin configuration like this, the
.vueat the end of the query makes micromatch detect it as a file:Breaking Changes
Additional Info
url.parse.url.parseis actually deprecated, but decided to still use it asnew URLmight not be available in older versions of Node.js (globalized in v10).new URLalso doesn't support relative paths.module.resource.split('?')[0]as well but unsure how well that scales. Seems like macOS allows?in the filename, and that seems to breakurl.parsetoo.