Commit 3d07f818 authored by Evan You's avatar Evan You

perf: avoid duplicate linting when used with eslint-loader

parent aec11fcb
......@@ -10,7 +10,15 @@ module.exports = code => code
// and transform it into appropriate requests.
module.exports.pitch = function (remainingRequest) {
const query = qs.parse(this.resourceQuery.slice(1))
const loaders = this.loaders.slice(1) // remove self
// if this is a language block request, remove eslint-loader to avoid
// duplicate linting.
const loaders = query.type
? this.loaders.filter(l => !/(\/|\\|@)eslint-loader/.test(l.path))
: this.loaders
// remove self
loaders.shift()
// do not inject if user uses null-loader to void the type (#1239)
if (loaders.some(l => /(\/|\\|@)null-loader/.test(l.path))) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment