Skip to content

Commit

Permalink
enable noUnusedLocals
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohsen Azimi committed Apr 13, 2018
1 parent 0d50f94 commit 3565cc1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/HotModuleReplacement.runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
/*global $hash$ $requestTimeout$ installedModules $require$ hotDownloadManifest hotDownloadUpdateChunk hotDisposeChunk modules */
module.exports = function() {
var hotApplyOnUpdate = true;
// @ts-ignore
var hotCurrentHash = $hash$; // eslint-disable-line no-unused-vars
var hotRequestTimeout = $requestTimeout$;
var hotCurrentModuleData = {};
var hotCurrentChildModule; // eslint-disable-line no-unused-vars
// @ts-ignore
var hotCurrentParents = []; // eslint-disable-line no-unused-vars
// @ts-ignore
var hotCurrentParentsTemp = []; // eslint-disable-line no-unused-vars

// @ts-ignore
// eslint-disable-next-line no-unused-vars
function hotCreateRequire(moduleId) {
var me = installedModules[moduleId];
Expand Down Expand Up @@ -80,6 +84,7 @@ module.exports = function() {
return fn;
}

// @ts-ignore
// eslint-disable-next-line no-unused-vars
function hotCreateModule(moduleId) {
var hot = {
Expand Down Expand Up @@ -206,6 +211,7 @@ module.exports = function() {
});
}

// @ts-ignore
// eslint-disable-next-line no-unused-vars
function hotAddUpdateChunk(chunkId, moreModules) {
if (!hotAvailableFilesMap[chunkId] || !hotRequestedFilesMap[chunkId])
Expand Down
3 changes: 3 additions & 0 deletions lib/node/NodeMainTemplate.runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
*/
/*global installedChunks $hotChunkFilename$ hotAddUpdateChunk $hotMainFilename$ */
module.exports = function() {
// @ts-ignore
// eslint-disable-next-line no-unused-vars
function hotDownloadUpdateChunk(chunkId) {
var chunk = require("./" + $hotChunkFilename$);
hotAddUpdateChunk(chunk.id, chunk.modules);
}

// @ts-ignore
// eslint-disable-next-line no-unused-vars
function hotDownloadManifest() {
try {
Expand All @@ -20,6 +22,7 @@ module.exports = function() {
return Promise.resolve(update);
}

// @ts-ignore
//eslint-disable-next-line no-unused-vars
function hotDisposeChunk(chunkId) {
delete installedChunks[chunkId];
Expand Down
3 changes: 3 additions & 0 deletions lib/node/NodeMainTemplateAsync.runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/
/*global installedChunks $hotChunkFilename$ $require$ hotAddUpdateChunk $hotMainFilename$ */
module.exports = function() {
// @ts-ignore
// eslint-disable-next-line no-unused-vars
function hotDownloadUpdateChunk(chunkId) {
var filename = require("path").join(__dirname, $hotChunkFilename$);
Expand All @@ -21,6 +22,7 @@ module.exports = function() {
});
}

// @ts-ignore
// eslint-disable-next-line no-unused-vars
function hotDownloadManifest() {
var filename = require("path").join(__dirname, $hotMainFilename$);
Expand All @@ -37,6 +39,7 @@ module.exports = function() {
});
}

// @ts-ignore
//eslint-disable-next-line no-unused-vars
function hotDisposeChunk(chunkId) {
delete installedChunks[chunkId];
Expand Down
3 changes: 3 additions & 0 deletions lib/web/JsonpMainTemplate.runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
*/
/*globals hotAddUpdateChunk parentHotUpdateCallback document XMLHttpRequest $require$ $hotChunkFilename$ $hotMainFilename$ $crossOriginLoading$ */
module.exports = function() {
// @ts-ignore
// eslint-disable-next-line no-unused-vars
function webpackHotUpdateCallback(chunkId, moreModules) {
hotAddUpdateChunk(chunkId, moreModules);
if (parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules);
} //$semicolon

// @ts-ignore
// eslint-disable-next-line no-unused-vars
function hotDownloadUpdateChunk(chunkId) {
var head = document.getElementsByTagName("head")[0];
Expand All @@ -20,6 +22,7 @@ module.exports = function() {
head.appendChild(script);
}

// @ts-ignore
// eslint-disable-next-line no-unused-vars
function hotDownloadManifest(requestTimeout) {
requestTimeout = requestTimeout || 10000;
Expand Down
4 changes: 4 additions & 0 deletions lib/webworker/WebWorkerMainTemplate.runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@
*/
/*globals installedChunks hotAddUpdateChunk parentHotUpdateCallback importScripts XMLHttpRequest $require$ $hotChunkFilename$ $hotMainFilename$ */
module.exports = function() {
// @ts-ignore
// eslint-disable-next-line no-unused-vars
function webpackHotUpdateCallback(chunkId, moreModules) {
hotAddUpdateChunk(chunkId, moreModules);
if (parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules);
} //$semicolon

// @ts-ignore
// eslint-disable-next-line no-unused-vars
function hotDownloadUpdateChunk(chunkId) {
importScripts($require$.p + $hotChunkFilename$);
}

// @ts-ignore
// eslint-disable-next-line no-unused-vars
function hotDownloadManifest(requestTimeout) {
requestTimeout = requestTimeout || 10000;
Expand Down Expand Up @@ -57,6 +60,7 @@ module.exports = function() {
});
}

// @ts-ignore
//eslint-disable-next-line no-unused-vars
function hotDisposeChunk(chunkId) {
delete installedChunks[chunkId];
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */

/* Additional Checks */
// "noUnusedLocals": true, /* Report errors on unused locals. */
"noUnusedLocals": true, /* Report errors on unused locals. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
Expand Down

0 comments on commit 3565cc1

Please sign in to comment.