-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
fix: strip resource query #58
fix: strip resource query #58
Conversation
Codecov Report
@@ Coverage Diff @@
## master #58 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 8 8
Lines 239 239
Branches 65 65
=========================================
Hits 239 239
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/cc @ricardogobbosouza I think we need to fix and look at new issues
This causes the same module file loaded with different resource queries to be linted multiple times. See #70 |
I wouldn't say this caused the bug, but rather surfaced it. Prior to this PR, this plugin was reading the query as if the file extension was in there. That shouldn't be happening. I think the solution you propose--tracking linted files to catch duplicates--is a good idea. |
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
.vue
at the end of the query makes micromatch detect it as a file:Breaking Changes
Additional Info
url.parse
.url.parse
is actually deprecated, but decided to still use it asnew URL
might not be available in older versions of Node.js (globalized in v10).new URL
also 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.parse
too.