Skip to content

Commit

Permalink
code linting
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Jan 11, 2017
1 parent 330ca07 commit 8e69a80
Show file tree
Hide file tree
Showing 169 changed files with 262 additions and 258 deletions.
7 changes: 7 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
"rules": {
"quotes": ["error", "double"],
"no-undef": "error",
"no-extra-semi": "error",
"semi": "error",
"no-template-curly-in-string": "error",
"no-caller": "error",
"yoda": "error",
"eqeqeq": "error",
"global-require": "off",
"brace-style": "error",
"eol-last": "error",
"indent": ["error", "tab", { "SwitchCase": 1 }],
Expand Down
10 changes: 5 additions & 5 deletions bin/convert-argv.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module.exports = function(yargs, argv, convertOptions) {
}
}
return path.extname(configPath);
}
};

var mapConfigArg = function mapConfigArg(configArg) {
var resolvedPath = path.resolve(configArg);
Expand All @@ -55,7 +55,7 @@ module.exports = function(yargs, argv, convertOptions) {
path: resolvedPath,
ext: extension
};
}
};

var configArgList = Array.isArray(argv.config) ? argv.config : [argv.config];
configFiles = configArgList.map(mapConfigArg);
Expand Down Expand Up @@ -90,7 +90,7 @@ module.exports = function(yargs, argv, convertOptions) {
}
}
}
}
};

var requireConfig = function requireConfig(configPath) {
var options = require(configPath);
Expand All @@ -102,7 +102,7 @@ module.exports = function(yargs, argv, convertOptions) {
options = options(argv.env, argv);
}
return options;
}
};

configFiles.forEach(function(file) {
registerCompiler(interpret.extensions[file.ext]);
Expand Down Expand Up @@ -511,7 +511,7 @@ module.exports = function(yargs, argv, convertOptions) {
} else {
options.entry[name] = entry;
}
}
};
argv._.forEach(function(content) {
var i = content.indexOf("=");
var j = content.indexOf("?");
Expand Down
2 changes: 1 addition & 1 deletion buildin/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ module.exports = function(module) {
module.webpackPolyfill = 1;
}
return module;
}
};
2 changes: 1 addition & 1 deletion examples/agressive-merging/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ module.exports = {
moveToParents: true
})
]
}
};
2 changes: 1 addition & 1 deletion examples/chunkhash/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ module.exports = {
})
*/
]
};
};
2 changes: 1 addition & 1 deletion examples/code-splitted-css-bundle/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ module.exports = {
filename: "style.css"
})
]
};
};
2 changes: 1 addition & 1 deletion examples/coffee-script/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ module.exports = {
resolve: {
extensions: [".web.coffee", ".web.js", ".coffee", ".js"]
}
}
};
2 changes: 1 addition & 1 deletion examples/css-bundle/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ module.exports = {
allChunks: true
})
]
};
};
4 changes: 2 additions & 2 deletions examples/dll-user/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ module.exports = {
plugins: [
new webpack.DllReferencePlugin({
context: path.join(__dirname, "..", "dll"),
manifest: require("../dll/js/alpha-manifest.json")
manifest: require("../dll/js/alpha-manifest.json") // eslint-disable-line
}),
new webpack.DllReferencePlugin({
scope: "beta",
manifest: require("../dll/js/beta-manifest.json"),
manifest: require("../dll/js/beta-manifest.json"), // eslint-disable-line
extensions: [".js", ".jsx"]
})
]
Expand Down
2 changes: 1 addition & 1 deletion examples/dll/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var path = require("path");
var webpack = require("../../");
module.exports = {
resolve: {
extensions: ['.js', '.jsx']
extensions: [".js", ".jsx"]
},
entry: {
alpha: ["./alpha", "./a", "module"],
Expand Down
2 changes: 1 addition & 1 deletion examples/externals/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ module.exports = {
}
}
]
}
};
4 changes: 2 additions & 2 deletions examples/extra-async-chunk-advanced/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var path = require("path");
var CommonsChunkPlugin = require("../../lib/optimize/CommonsChunkPlugin");

module.exports = {
plugins: [
new CommonsChunkPlugin({
Expand All @@ -15,4 +15,4 @@ module.exports = {
async: true
}),
]
}
};
4 changes: 2 additions & 2 deletions examples/extra-async-chunk/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var path = require("path");
var CommonsChunkPlugin = require("../../lib/optimize/CommonsChunkPlugin");

module.exports = {
plugins: [
new CommonsChunkPlugin({
Expand All @@ -11,4 +11,4 @@ module.exports = {
async: true
})
]
}
};
4 changes: 2 additions & 2 deletions examples/hybrid-routing/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
},
output: {
path: path.join(__dirname, "js"),
publicPath: 'js/',
publicPath: "js/",
filename: "[name].bundle.js",
chunkFilename: "[id].chunk.js"
},
Expand All @@ -24,4 +24,4 @@ module.exports = {
})
// The pages cannot run without the commons.js file now.
]
}
};
2 changes: 1 addition & 1 deletion examples/i18n/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ module.exports = Object.keys(languages).map(function(language) {
)
]
};
});
});
2 changes: 1 addition & 1 deletion examples/move-to-parent/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ module.exports = {
}
})
]
}
};
2 changes: 1 addition & 1 deletion examples/multi-compiler/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ module.exports = [
})
]
}
];
];
2 changes: 1 addition & 1 deletion examples/multi-part-library/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ module.exports = {
library: ["MyLibrary", "[name]"],
libraryTarget: "umd"
}
}
};
2 changes: 1 addition & 1 deletion examples/multiple-commons-chunks/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ module.exports = {
chunks: ["pageC", "adminPageC"]
}),
]
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ module.exports = {
filename: "[name].css"
}),
]
};
};
2 changes: 1 addition & 1 deletion examples/multiple-entry-points/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ module.exports = {
name: "commons"
})
]
}
};
2 changes: 1 addition & 1 deletion examples/two-explicit-vendor-chunks/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ module.exports = {
minChunks: Infinity
})
]
}
};
2 changes: 1 addition & 1 deletion examples/web-worker/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ module.exports = {
}
})
]
}
};
2 changes: 1 addition & 1 deletion hot/log-apply-result.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ module.exports = function(updatedModules, renewedModules) {
return typeof moduleId === "number";
});
if(numberIds)
console.log("[HMR] Consider using the NamedModulesPlugin for module names.")
console.log("[HMR] Consider using the NamedModulesPlugin for module names.");
}
};
2 changes: 1 addition & 1 deletion hot/poll.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if(module.hot) {
}
});
}
}
};
setInterval(checkForUpdate, hotPollInterval);
} else {
throw new Error("[HMR] Hot Module Replacement is disabled.");
Expand Down
2 changes: 1 addition & 1 deletion hot/signal.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if(module.hot) {
console.warn("[HMR] Update failed: " + err.stack || err.message);
}
});
}
};

process.on(__resourceQuery.substr(1) || "SIGUSR2", function() {
if(module.hot.status() !== "idle") {
Expand Down
2 changes: 1 addition & 1 deletion lib/CaseSensitiveModulesWarning.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ module.exports = class CaseSensitiveModulesWarning extends Error {
return message;
}).join("\n");
}
}
};
4 changes: 2 additions & 2 deletions lib/Chunk.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const byId = (a, b) => {
if(a.id < b.id) return -1;
if(b.id < a.id) return 1;
return 0;
}
};

class Chunk {

Expand Down Expand Up @@ -183,7 +183,7 @@ class Chunk {
}
onChunk(c);
});
}
};
moveChunks(other.parents, "chunks", c => {
if(c !== this && this.addParent(c)) {
c.addChunk(this);
Expand Down
2 changes: 1 addition & 1 deletion lib/Compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function Compiler() {
});
});
}.bind(this)
}
};

this.options = {};
}
Expand Down
2 changes: 1 addition & 1 deletion lib/ConstPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const NullFactory = require("./NullFactory");
const getQuery = (request) => {
const i = request.indexOf("?");
return request.indexOf("?") < 0 ? "" : request.substr(i);
}
};

class ConstPlugin {
apply(compiler) {
Expand Down
2 changes: 1 addition & 1 deletion lib/ContextModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ ContextModule.prototype.libIdent = function(options) {
if(this.addon)
identifier += contextify(options, this.addon);
if(this.regExp)
identifier += prettyRegExp(this.regExp + "")
identifier += prettyRegExp(this.regExp + "");
return identifier.replace(/ $/, "");
};

Expand Down
4 changes: 2 additions & 2 deletions lib/ContextModuleFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ ContextModuleFactory.prototype.create = function(data, callback) {
resolvers.loader.resolve({}, context, loader, function(err, result) {
if(err) return callback(err);
callback(null, result);
})
}, callback)
});
}, callback);
}
], function(err, result) {
if(err) return callback(err);
Expand Down
4 changes: 2 additions & 2 deletions lib/ContextReplacementPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function ContextReplacementPlugin(resourceRegExp, newContentResource, newContent
} else if(typeof newContentResource === "string" && typeof newContentRecursive === "object") {
this.newContentResource = newContentResource;
this.newContentCreateContextMap = function(fs, callback) {
callback(null, newContentRecursive)
callback(null, newContentRecursive);
};
} else if(typeof newContentResource === "string" && typeof newContentRecursive === "function") {
this.newContentResource = newContentResource;
Expand Down Expand Up @@ -99,5 +99,5 @@ function createResolveDependenciesFromContextMap(createContextMap) {
});
callback(null, dependencies);
});
}
};
}
2 changes: 1 addition & 1 deletion lib/DelegatedModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ DelegatedModule.prototype.build = function(options, compilation, resolver, fs, c
DelegatedModule.prototype.unbuild = function() {
this.built = false;
Module.prototype.unbuild.call(this);
}
};

DelegatedModule.prototype.source = function() {
var sourceModule = this.dependencies[0].module;
Expand Down
4 changes: 2 additions & 2 deletions lib/DynamicEntryPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class DynamicEntryPlugin {
if(err) return reject(err);
resolve();
});
})
});
};

Promise.resolve(this.entry()).then((entry) => {
Expand All @@ -44,7 +44,7 @@ class DynamicEntryPlugin {
return addEntry(entry[name], name);
})).then(() => callback(), callback);
}
})
});
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/EntryOptionPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ module.exports = class EntryOptionPlugin {
return true;
});
}
}
};
2 changes: 1 addition & 1 deletion lib/ExternalModuleFactoryPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ExternalModuleFactoryPlugin.prototype.apply = function(normalModuleFactory) {
return next();
}
callback(null, module);
}
};

do {
var async = true;
Expand Down
2 changes: 1 addition & 1 deletion lib/FlagDependencyUsagePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ FlagDependencyUsagePlugin.prototype.apply = function(compiler) {

modules.forEach(function(module) {
module.used = false;
})
});

var queue = [];
compilation.chunks.forEach(function(chunk) {
Expand Down
Loading

0 comments on commit 8e69a80

Please sign in to comment.