chore(typing): enforce --noImplicitAny for tools directory.

Exposed a couple of bugs.

Closes #6645
This commit is contained in:
Alex Eagle
2016-01-22 10:51:16 -08:00
committed by Misko Hevery
parent 7112d008d0
commit ebe14720eb
34 changed files with 174 additions and 161 deletions

View File

@ -11,7 +11,8 @@ var FILE_ENCODING = {encoding: 'utf-8'};
* the associated changes.
*/
class DiffingReplace implements DiffingBroccoliPlugin {
constructor(private inputPath, private cachePath, private options) {}
// TODO: define an interface for options
constructor(private inputPath: string, private cachePath: string, private options: any) {}
rebuild(treeDiff: DiffResult) {
var patterns = this.options.patterns;
@ -27,13 +28,13 @@ class DiffingReplace implements DiffingBroccoliPlugin {
fse.mkdirpSync(destDirPath);
}
var fileMatches = files.some((filePath) => minimatch(changedFilePath, filePath));
var fileMatches = files.some((filePath: string) => minimatch(changedFilePath, filePath));
if (fileMatches) {
var content = fs.readFileSync(sourceFilePath, FILE_ENCODING);
patterns.forEach((pattern) => {
patterns.forEach((pattern: any) => {
var replacement = pattern.replacement;
if (typeof replacement === 'function') {
replacement = function(content) {
replacement = function(content: string) {
return pattern.replacement(content, changedFilePath);
};
}