提交 e8475ad5 编写于 作者: M Matt Bierner

Enable noUnusedParameters in build scripts

上级 5de9c9bf
......@@ -153,7 +153,7 @@ function extractStrings(destFiles) {
deps: deps
};
};
destFiles.forEach(function (destFile, index) {
destFiles.forEach(function (destFile) {
if (!/\.js$/.test(destFile.dest)) {
return;
}
......@@ -291,7 +291,7 @@ function emitEntryPoint(modulesMap, deps, entryPoint, includedModules, prepend,
mainResult.sources.push(emitShimmedModule(c, deps[c], module.shim, module.path, contents));
}
else {
mainResult.sources.push(emitNamedModule(c, deps[c], module.defineLocation, module.path, contents));
mainResult.sources.push(emitNamedModule(c, module.defineLocation, module.path, contents));
}
});
Object.keys(usedPlugins).forEach(function (pluginName) {
......@@ -357,7 +357,7 @@ function emitPlugin(entryPoint, plugin, pluginName, moduleName) {
contents: result
};
}
function emitNamedModule(moduleId, myDeps, defineCallPosition, path, contents) {
function emitNamedModule(moduleId, defineCallPosition, path, contents) {
// `defineCallPosition` is the position in code: |define()
var defineCallOffset = positionToOffset(contents, defineCallPosition.line, defineCallPosition.col);
// `parensOffset` is the position in code: define|()
......
......@@ -267,7 +267,7 @@ function extractStrings(destFiles: IConcatFile[]): IConcatFile[] {
};
};
destFiles.forEach((destFile, index) => {
destFiles.forEach((destFile) => {
if (!/\.js$/.test(destFile.dest)) {
return;
}
......@@ -438,7 +438,7 @@ function emitEntryPoint(
if (module.shim) {
mainResult.sources.push(emitShimmedModule(c, deps[c], module.shim, module.path, contents));
} else {
mainResult.sources.push(emitNamedModule(c, deps[c], module.defineLocation, module.path, contents));
mainResult.sources.push(emitNamedModule(c, module.defineLocation, module.path, contents));
}
});
......@@ -513,7 +513,7 @@ function emitPlugin(entryPoint: string, plugin: ILoaderPlugin, pluginName: strin
};
}
function emitNamedModule(moduleId: string, myDeps: string[], defineCallPosition: IPosition, path: string, contents: string): IFile {
function emitNamedModule(moduleId: string, defineCallPosition: IPosition, path: string, contents: string): IFile {
// `defineCallPosition` is the position in code: |define()
let defineCallOffset = positionToOffset(contents, defineCallPosition.line, defineCallPosition.col);
......
......@@ -187,10 +187,10 @@ var XLF = /** @class */ (function () {
this.buffer.push(line.toString());
};
XLF.parsePseudo = function (xlfString) {
return new Promise(function (resolve, reject) {
return new Promise(function (resolve) {
var parser = new xml2js.Parser();
var files = [];
parser.parseString(xlfString, function (err, result) {
parser.parseString(xlfString, function (_err, result) {
var fileNodes = result['xliff']['file'];
fileNodes.forEach(function (file) {
var originalFilePath = file.$.original;
......@@ -301,7 +301,7 @@ function stripComments(content) {
* Fourth matches line comments
*/
var regexp = /("(?:[^\\\"]*(?:\\.)?)*")|('(?:[^\\\']*(?:\\.)?)*')|(\/\*(?:\r?\n|.)*?\*\/)|(\/{2,}.*?(?:(?:\r?\n)|$))/g;
var result = content.replace(regexp, function (match, m1, m2, m3, m4) {
var result = content.replace(regexp, function (match, _m1, _m2, m3, m4) {
// Only one of m1, m2, m3, m4 matches
if (m3) {
// A block comment. Replace with nothing
......@@ -834,7 +834,7 @@ function tryGetResource(project, slug, apiHostname, credentials) {
});
}
function createResource(project, slug, xlfFile, apiHostname, credentials) {
return new Promise(function (resolve, reject) {
return new Promise(function (_resolve, reject) {
var data = JSON.stringify({
'content': xlfFile.contents.toString(),
'name': slug,
......
......@@ -265,10 +265,10 @@ export class XLF {
}
static parsePseudo = function (xlfString: string): Promise<ParsedXLF[]> {
return new Promise((resolve, reject) => {
return new Promise((resolve) => {
let parser = new xml2js.Parser();
let files: { messages: Map<string>, originalFilePath: string, language: string }[] = [];
parser.parseString(xlfString, function (err: any, result: any) {
parser.parseString(xlfString, function (_err: any, result: any) {
const fileNodes: any[] = result['xliff']['file'];
fileNodes.forEach(file => {
const originalFilePath = file.$.original;
......@@ -399,7 +399,7 @@ function stripComments(content: string): string {
* Fourth matches line comments
*/
var regexp: RegExp = /("(?:[^\\\"]*(?:\\.)?)*")|('(?:[^\\\']*(?:\\.)?)*')|(\/\*(?:\r?\n|.)*?\*\/)|(\/{2,}.*?(?:(?:\r?\n)|$))/g;
let result = content.replace(regexp, (match, m1, m2, m3, m4) => {
let result = content.replace(regexp, (match, _m1, _m2, m3, m4) => {
// Only one of m1, m2, m3, m4 matches
if (m3) {
// A block comment. Replace with nothing
......@@ -934,7 +934,7 @@ function tryGetResource(project: string, slug: string, apiHostname: string, cred
}
function createResource(project: string, slug: string, xlfFile: File, apiHostname: string, credentials: any): Promise<any> {
return new Promise((resolve, reject) => {
return new Promise((_resolve, reject) => {
const data = JSON.stringify({
'content': xlfFile.contents.toString(),
'name': slug,
......
......@@ -103,7 +103,7 @@ var TypeScriptLanguageServiceHost = /** @class */ (function () {
.concat(Object.keys(this._libs))
.concat(Object.keys(this._files)));
};
TypeScriptLanguageServiceHost.prototype.getScriptVersion = function (fileName) {
TypeScriptLanguageServiceHost.prototype.getScriptVersion = function (_fileName) {
return '1';
};
TypeScriptLanguageServiceHost.prototype.getProjectVersion = function () {
......@@ -120,13 +120,13 @@ var TypeScriptLanguageServiceHost = /** @class */ (function () {
return ts.ScriptSnapshot.fromString('');
}
};
TypeScriptLanguageServiceHost.prototype.getScriptKind = function (fileName) {
TypeScriptLanguageServiceHost.prototype.getScriptKind = function (_fileName) {
return ts.ScriptKind.TS;
};
TypeScriptLanguageServiceHost.prototype.getCurrentDirectory = function () {
return '';
};
TypeScriptLanguageServiceHost.prototype.getDefaultLibFileName = function (options) {
TypeScriptLanguageServiceHost.prototype.getDefaultLibFileName = function (_options) {
return 'defaultLib:lib.d.ts';
};
TypeScriptLanguageServiceHost.prototype.isDefaultLibFileName = function (fileName) {
......
......@@ -172,7 +172,7 @@ class TypeScriptLanguageServiceHost implements ts.LanguageServiceHost {
.concat(Object.keys(this._files))
);
}
getScriptVersion(fileName: string): string {
getScriptVersion(_fileName: string): string {
return '1';
}
getProjectVersion(): string {
......@@ -187,13 +187,13 @@ class TypeScriptLanguageServiceHost implements ts.LanguageServiceHost {
return ts.ScriptSnapshot.fromString('');
}
}
getScriptKind(fileName: string): ts.ScriptKind {
getScriptKind(_fileName: string): ts.ScriptKind {
return ts.ScriptKind.TS;
}
getCurrentDirectory(): string {
return '';
}
getDefaultLibFileName(options: ts.CompilerOptions): string {
getDefaultLibFileName(_options: ts.CompilerOptions): string {
return 'defaultLib:lib.d.ts';
}
isDefaultLibFileName(fileName: string): boolean {
......
......@@ -399,7 +399,7 @@ var TypeScriptLanguageServiceHost = /** @class */ (function () {
.concat(Object.keys(this._libs))
.concat(Object.keys(this._files)));
};
TypeScriptLanguageServiceHost.prototype.getScriptVersion = function (fileName) {
TypeScriptLanguageServiceHost.prototype.getScriptVersion = function (_fileName) {
return '1';
};
TypeScriptLanguageServiceHost.prototype.getProjectVersion = function () {
......@@ -416,13 +416,13 @@ var TypeScriptLanguageServiceHost = /** @class */ (function () {
return ts.ScriptSnapshot.fromString('');
}
};
TypeScriptLanguageServiceHost.prototype.getScriptKind = function (fileName) {
TypeScriptLanguageServiceHost.prototype.getScriptKind = function (_fileName) {
return ts.ScriptKind.TS;
};
TypeScriptLanguageServiceHost.prototype.getCurrentDirectory = function () {
return '';
};
TypeScriptLanguageServiceHost.prototype.getDefaultLibFileName = function (options) {
TypeScriptLanguageServiceHost.prototype.getDefaultLibFileName = function (_options) {
return 'defaultLib:es5';
};
TypeScriptLanguageServiceHost.prototype.isDefaultLibFileName = function (fileName) {
......
......@@ -484,7 +484,7 @@ class TypeScriptLanguageServiceHost implements ts.LanguageServiceHost {
.concat(Object.keys(this._files))
);
}
getScriptVersion(fileName: string): string {
getScriptVersion(_fileName: string): string {
return '1';
}
getProjectVersion(): string {
......@@ -499,13 +499,13 @@ class TypeScriptLanguageServiceHost implements ts.LanguageServiceHost {
return ts.ScriptSnapshot.fromString('');
}
}
getScriptKind(fileName: string): ts.ScriptKind {
getScriptKind(_fileName: string): ts.ScriptKind {
return ts.ScriptKind.TS;
}
getCurrentDirectory(): string {
return '';
}
getDefaultLibFileName(options: ts.CompilerOptions): string {
getDefaultLibFileName(_options: ts.CompilerOptions): string {
return 'defaultLib:es5';
}
isDefaultLibFileName(fileName: string): boolean {
......
......@@ -97,7 +97,7 @@ function updateVersion(accessor: IVersionAccessor, symbolsPath: string) {
function asyncRequest<T>(options: request.UrlOptions & request.CoreOptions): Promise<T> {
return new Promise<T>((resolve, reject) => {
request(options, (error, response, body) => {
request(options, (error, _response, body) => {
if (error) {
reject(error);
} else {
......
......@@ -13,7 +13,8 @@
"allowJs": true,
"checkJs": true,
"strict": true,
"noUnusedLocals": true
"noUnusedLocals": true,
"noUnusedParameters": true
},
"exclude": [
"node_modules/**"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册