From 7b790a3369133e14481f22dd18ec20a8918cf744 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Sat, 11 Apr 2015 12:40:05 -0700 Subject: [PATCH] chore(build): fix check-format --- Brocfile-js_cjs.js | 4 ++-- Brocfile-js_dev.js | 3 ++- Brocfile-js_prod.js | 22 ++++++++++++---------- modules/angular2/globals.ts | 3 ++- modules/angular2/traceur-runtime.d.ts | 8 ++++---- 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/Brocfile-js_cjs.js b/Brocfile-js_cjs.js index f21722142f..f26ef5dd6b 100644 --- a/Brocfile-js_cjs.js +++ b/Brocfile-js_cjs.js @@ -59,10 +59,10 @@ var typescriptTree = new TypescriptCompiler(modulesTree, { target: 'ES5', sourceMap: true, mapRoot: '', /* force sourcemaps to use relative path */ - module: /*system.js*/'commonjs', + module: /*system.js*/ 'commonjs', allowNonTsExtensions: false, typescript: require('typescript'), - //declarationFiles: true, + // declarationFiles: true, noEmitOnError: true, outDir: 'angular2' }); diff --git a/Brocfile-js_dev.js b/Brocfile-js_dev.js index fabe5c226b..b2fea4e089 100644 --- a/Brocfile-js_dev.js +++ b/Brocfile-js_dev.js @@ -23,7 +23,8 @@ var es6DevTree = new TraceurCompiler(modulesTree, '.es6', '.map', { }); // Call Traceur again to lower the ES6 build tree to ES5 -var es5DevTree = new TraceurCompiler(es6DevTree, '.js', '.js.map', {modules: 'instantiate', sourceMaps: true}); +var es5DevTree = + new TraceurCompiler(es6DevTree, '.js', '.js.map', {modules: 'instantiate', sourceMaps: true}); // Now we add a few more files to the es6 tree that Traceur should not see ['angular2', 'benchmarks', 'benchmarks_external', 'benchpress', 'examples', 'rtts_assert'].forEach( diff --git a/Brocfile-js_prod.js b/Brocfile-js_prod.js index 763b1b1031..2d26e43995 100644 --- a/Brocfile-js_prod.js +++ b/Brocfile-js_prod.js @@ -23,14 +23,15 @@ var es6ProdTree = new TraceurCompiler(modulesTree, '.es6', '.map', { }); // Call Traceur again to lower the ES6 build tree to ES5 -var es5ProdTree = new TraceurCompiler(es6ProdTree, '.js', '.js.map', {modules: 'instantiate', sourceMaps: true}); +var es5ProdTree = + new TraceurCompiler(es6ProdTree, '.js', '.js.map', {modules: 'instantiate', sourceMaps: true}); // Now we add a few more files to the es6 tree that Traceur should not see ['angular2', 'benchmarks', 'benchmarks_external', 'benchpress', 'examples', 'rtts_assert'].forEach( - function(destDir) { - var extras = new Funnel('tools/build', {files: ['es5build.js'], destDir: destDir}); - es6ProdTree = mergeTrees([es6ProdTree, extras]); - }); + function(destDir) { + var extras = new Funnel('tools/build', {files: ['es5build.js'], destDir: destDir}); + es6ProdTree = mergeTrees([es6ProdTree, extras]); + }); var vendorScriptsTree = flatten(new Funnel('.', { files: [ @@ -46,9 +47,9 @@ var vendorScriptsTree = flatten(new Funnel('.', { ] })); var vendorScripts_benchmark = - new Funnel('tools/build/snippets', {files: ['url_params_to_form.js'], destDir: '/'}); + new Funnel('tools/build/snippets', {files: ['url_params_to_form.js'], destDir: '/'}); var vendorScripts_benchmarks_external = - new Funnel('node_modules/angular', {files: ['angular.js'], destDir: '/'}); + new Funnel('node_modules/angular', {files: ['angular.js'], destDir: '/'}); var servingTrees = []; function copyVendorScriptsTo(destDir) { @@ -58,7 +59,7 @@ function copyVendorScriptsTo(destDir) { } if (destDir.indexOf('benchmarks_external') > -1) { servingTrees.push( - new Funnel(vendorScripts_benchmarks_external, {srcDir: '/', destDir: destDir})); + new Funnel(vendorScripts_benchmarks_external, {srcDir: '/', destDir: destDir})); } } @@ -85,7 +86,7 @@ htmlTree = replace(htmlTree, { }); // TODO(broccoli): are these needed here, if not loaded by a script tag?? ['benchmarks/src', 'benchmarks_external/src', 'examples/src/benchpress'].forEach( - copyVendorScriptsTo); + copyVendorScriptsTo); var scripts = mergeTrees(servingTrees, {overwrite: true}); var css = new Funnel(modulesTree, {include: ["**/*.css"]}); @@ -100,4 +101,5 @@ htmlTree = mergeTrees([htmlTree, scripts, polymer, css]); es5ProdTree = mergeTrees([es5ProdTree, htmlTree]); -module.exports = mergeTrees([stew.mv(es6ProdTree, 'js/prod/es6'), stew.mv(es5ProdTree, 'js/prod/es5')]); +module.exports = + mergeTrees([stew.mv(es6ProdTree, 'js/prod/es6'), stew.mv(es5ProdTree, 'js/prod/es5')]); diff --git a/modules/angular2/globals.ts b/modules/angular2/globals.ts index 162fc00425..a678ed9bbf 100644 --- a/modules/angular2/globals.ts +++ b/modules/angular2/globals.ts @@ -6,7 +6,8 @@ declare var assert: any; declare var global: Window; type int = number; -interface List extends Array {} +interface List extends Array { +} interface Window { Object: typeof Object; diff --git a/modules/angular2/traceur-runtime.d.ts b/modules/angular2/traceur-runtime.d.ts index 658edf4a01..9942c049e2 100644 --- a/modules/angular2/traceur-runtime.d.ts +++ b/modules/angular2/traceur-runtime.d.ts @@ -9,7 +9,7 @@ interface String { * same as the corresponding elements of this object (converted to a String) starting at * position. Otherwise returns false. */ - startsWith(searchString: string, position ?: number): boolean; + startsWith(searchString: string, position?: number): boolean; } interface NumberConstructor { @@ -29,14 +29,14 @@ interface Array { * @param end index to stop filling the array at. If end is negative, it is treated as * length+end. */ - fill(value: T, start ?: number, end ?: number): T[]; + fill(value: T, start?: number, end?: number): T[]; } // Copied from lib.dom.d.ts and modified interface Map { clear(): void; delete (key: K): boolean; - forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg ?: any): void; + forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; get(key: K): V; has(key: K): boolean; set(key: K, value: V): Map; @@ -54,7 +54,7 @@ interface Set { add(value: T): Set; clear(): void; delete (value: T): boolean; - forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg ?: any): void; + forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; has(value: T): boolean; size: number; }