From 5615928df94887cec5b12719bbcd36331357bdeb Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Mon, 2 Mar 2020 18:35:30 +0100 Subject: [PATCH] build: no longer run tslint from within gulp task (#35800) Switches our tslint setup to the standard `tslint.json` linter excludes. The set of files that need to be linted is specified through a Yarn script. For IDEs, open files are linted with the closest tslint configuration, if the tslint IDE extension is set up, and the source file is not excluded. We cannot use the language service plugin for tslint as we have multiple nested tsconfig files, and we don't want to add the plugin to each tsconfig. We could reduce that bloat by just extending from a top-level tsconfig that defines the language service plugin, but unfortunately the tslint plugin does not allow the use of tslint configs which are not part of the tsconfig project. This is problematic since the tslint configuration is at the project root, and we don't want to copy tslint configurations next to each tsconfig file. Additionally, linting of `d.ts` files has been re-enabled. This has been disabled in the past and a TODO has been left. This commit fixes the lint issues and re-enables linting. PR Close #35800 --- .circleci/config.yml | 2 +- docs/DEVELOPER.md | 2 +- gulpfile.js | 4 +- modules/system.d.ts | 8 ++- package.json | 4 +- packages/bazel/src/builders/schema.d.ts | 13 ++--- .../bazel/src/schematics/ng-add/schema.d.ts | 13 ++--- .../bazel/src/schematics/ng-new/schema.d.ts | 11 ++-- .../core/test/render3/perf/micro_bench.ts | 2 +- .../worker/src/service-worker.d.ts | 1 + packages/system.d.ts | 8 ++- scripts/browserstack/start_tunnel.js | 4 +- scripts/build-ivy-npm-packages.js | 7 +++ scripts/build-packages-dist.js | 20 ++++--- scripts/ci/payload-size.js | 16 ++++-- scripts/ci/update-deps-to-dist-packages.js | 16 ++++-- scripts/github/utils/git_util.js | 8 +-- scripts/github/utils/github_closes.js | 12 ++++- scripts/github/utils/json_extract.js | 14 +++-- scripts/github/utils/json_extract_test.js | 8 +++ scripts/package-builder.js | 20 ++++--- scripts/webdriver-manager-update.js | 3 +- tools/gulp-tasks/README.md | 4 +- tools/gulp-tasks/lint.js | 54 ------------------- tools/gulp-tasks/tools-build.js | 23 -------- tools/postinstall-patches.js | 2 +- tools/types.d.ts | 8 +++ tslint.json | 22 ++++++++ 28 files changed, 171 insertions(+), 138 deletions(-) delete mode 100644 tools/gulp-tasks/lint.js delete mode 100644 tools/gulp-tasks/tools-build.js diff --git a/.circleci/config.yml b/.circleci/config.yml index 73bd538776..0249cdf975 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -274,7 +274,7 @@ jobs: - run: 'yarn bazel:lint || (echo -e "\n.bzl files have lint errors. Please run ''yarn bazel:lint-fix''"; exit 1)' - - run: yarn gulp lint + - run: yarn lint - run: node tools/pullapprove/verify.js test: diff --git a/docs/DEVELOPER.md b/docs/DEVELOPER.md index 02e3d5888d..38ddf18c9c 100644 --- a/docs/DEVELOPER.md +++ b/docs/DEVELOPER.md @@ -129,7 +129,7 @@ where `$ANGULAR_PATH` is an environment variable of the absolute path of your An You can check that your code is properly formatted and adheres to coding style by running: ``` shell -$ yarn gulp lint +$ yarn lint ``` ## Publishing Snapshot Builds diff --git a/gulpfile.js b/gulpfile.js index 091088ec38..49157e466e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -45,11 +45,9 @@ gulp.task('format:changed', ['format:untracked', 'format:diff']); // Alias for `format:changed` that formerly formatted all files. gulp.task('format', ['format:changed']); -gulp.task('lint', ['format:enforce', 'validate-commit-messages', 'tslint']); -gulp.task('tslint', ['tools:build'], loadTask('lint')); +gulp.task('lint', ['format:enforce', 'validate-commit-messages']); gulp.task('validate-commit-messages', loadTask('validate-commit-message')); gulp.task('source-map-test', loadTask('source-map-test')); -gulp.task('tools:build', loadTask('tools-build')); gulp.task('changelog', loadTask('changelog')); gulp.task('changelog:zonejs', loadTask('changelog-zonejs')); gulp.task('check-env', () => {/* this is a noop because the env test ran already above */}); diff --git a/modules/system.d.ts b/modules/system.d.ts index f94cec235e..4cedada6f9 100644 --- a/modules/system.d.ts +++ b/modules/system.d.ts @@ -1,4 +1,10 @@ /** - * Dummy typings for systemjs. + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license */ + +/** Dummy typings for systemjs. */ declare var System: any; diff --git a/package.json b/package.json index 4079d3bbf2..887f1c10ff 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,9 @@ "bazel": "bazel", "//circleci-win-comment": "See the test-win circleci job for why these are needed. If they are not needed anymore, remove them.", "circleci-win-ve": "bazel test --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only,-browser:chromium-local //packages/compiler-cli/... //tools/ts-api-guardian/...", - "circleci-win-ivy": "bazel test --config=ivy --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot,-browser:chromium-local //packages/compiler-cli/... //tools/ts-api-guardian/..." + "circleci-win-ivy": "bazel test --config=ivy --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot,-browser:chromium-local //packages/compiler-cli/... //tools/ts-api-guardian/...", + "lint": "yarn -s tslint && yarn gulp lint", + "tslint": "tsc -p tools/tsconfig.json && tslint -c tslint.json \"+(packages|modules|scripts|tools)/**/*.+(js|ts)\"" }, "// 1": "dependencies are used locally and by bazel", "dependencies": { diff --git a/packages/bazel/src/builders/schema.d.ts b/packages/bazel/src/builders/schema.d.ts index dbcf8d8da9..7113eb7dc4 100644 --- a/packages/bazel/src/builders/schema.d.ts +++ b/packages/bazel/src/builders/schema.d.ts @@ -1,9 +1,10 @@ - -// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE -// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...). - -// tslint:disable:no-global-tslint-disable -// tslint:disable +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ /** * Options for Bazel Builder diff --git a/packages/bazel/src/schematics/ng-add/schema.d.ts b/packages/bazel/src/schematics/ng-add/schema.d.ts index a064607654..90e91dfd69 100644 --- a/packages/bazel/src/schematics/ng-add/schema.d.ts +++ b/packages/bazel/src/schematics/ng-add/schema.d.ts @@ -1,9 +1,10 @@ - -// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE -// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...). - -// tslint:disable:no-global-tslint-disable -// tslint:disable +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ export interface Schema { /** diff --git a/packages/bazel/src/schematics/ng-new/schema.d.ts b/packages/bazel/src/schematics/ng-new/schema.d.ts index 48c3575c50..9cf013db9e 100644 --- a/packages/bazel/src/schematics/ng-new/schema.d.ts +++ b/packages/bazel/src/schematics/ng-new/schema.d.ts @@ -1,8 +1,11 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ -// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE -// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...). - -// tslint:disable export interface Schema { /** * Initial git repository commit information. diff --git a/packages/core/test/render3/perf/micro_bench.ts b/packages/core/test/render3/perf/micro_bench.ts index 00c5ff1c49..2f7e714fc0 100644 --- a/packages/core/test/render3/perf/micro_bench.ts +++ b/packages/core/test/render3/perf/micro_bench.ts @@ -91,7 +91,7 @@ export function createBenchmark(benchmarkName: string): Benchmark { return (previous.bestTime < current.bestTime) ? previous : current; }); const unitOffset = findUnit(fastest.bestTime); - (fn || console.log)(`\nBenchmark: ${benchmarkName}\n${profiles.map((profile: Profile) => { + (fn || console.info)(`\nBenchmark: ${benchmarkName}\n${profiles.map((profile: Profile) => { const time = formatTime(profile.bestTime, unitOffset); const percent = formatPercent(1 - profile.bestTime / fastest.bestTime); return ` ${profile.profileName}: ${time}(${percent}) `; diff --git a/packages/service-worker/worker/src/service-worker.d.ts b/packages/service-worker/worker/src/service-worker.d.ts index e0f8cefb13..e49ecbc838 100644 --- a/packages/service-worker/worker/src/service-worker.d.ts +++ b/packages/service-worker/worker/src/service-worker.d.ts @@ -1,3 +1,4 @@ +// tslint:disable:file-header /** * Copyright (c) 2016, Tiernan Cridland * diff --git a/packages/system.d.ts b/packages/system.d.ts index f94cec235e..4cedada6f9 100644 --- a/packages/system.d.ts +++ b/packages/system.d.ts @@ -1,4 +1,10 @@ /** - * Dummy typings for systemjs. + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license */ + +/** Dummy typings for systemjs. */ declare var System: any; diff --git a/scripts/browserstack/start_tunnel.js b/scripts/browserstack/start_tunnel.js index 768eced515..f20101a6ec 100644 --- a/scripts/browserstack/start_tunnel.js +++ b/scripts/browserstack/start_tunnel.js @@ -37,12 +37,12 @@ var tunnel = new BrowserStackTunnel({ hosts: hosts }); -console.log('Starting tunnel on ports', PORTS.join(', ')); +console.info('Starting tunnel on ports', PORTS.join(', ')); tunnel.start(function(error) { if (error) { console.error('Can not establish the tunnel', error); } else { - console.log('Tunnel established.'); + console.info('Tunnel established.'); fakeServers.forEach(function(server) { server.close(); }); diff --git a/scripts/build-ivy-npm-packages.js b/scripts/build-ivy-npm-packages.js index f132ae7ce1..8577c0e6de 100755 --- a/scripts/build-ivy-npm-packages.js +++ b/scripts/build-ivy-npm-packages.js @@ -1,4 +1,11 @@ #!/usr/bin/env node +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ 'use strict'; const {buildTargetPackages} = require('./package-builder'); diff --git a/scripts/build-packages-dist.js b/scripts/build-packages-dist.js index af3d03bb31..97d1568d10 100755 --- a/scripts/build-packages-dist.js +++ b/scripts/build-packages-dist.js @@ -1,4 +1,12 @@ #!/usr/bin/env node +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + 'use strict'; const {chmod, cp, mkdir, rm} = require('shelljs'); @@ -22,18 +30,18 @@ buildTargetPackages('dist/packages-dist', false, 'Production'); // copied into the `dist/packages-dist/` directory (despite its source's being inside // `packages/`), because it is not published to npm under the `@angular` scope (as happens for // the rest of the packages). -console.log(''); -console.log('##############################'); -console.log(`${scriptPath}:`); -console.log(' Building zone.js npm package'); -console.log('##############################'); +console.info(''); +console.info('##############################'); +console.info(`${scriptPath}:`); +console.info(' Building zone.js npm package'); +console.info('##############################'); exec(`${bazelCmd} build //packages/zone.js:npm_package`); // Copy artifacts to `dist/zone.js-dist/`, so they can be easier persisted on CI. const buildOutputDir = `${bazelBin}/packages/zone.js/npm_package`; const distTargetDir = `${baseDir}/dist/zone.js-dist/zone.js`; -console.log(`# Copy artifacts to ${distTargetDir}`); +console.info(`# Copy artifacts to ${distTargetDir}`); mkdir('-p', distTargetDir); rm('-rf', distTargetDir); cp('-R', buildOutputDir, distTargetDir); diff --git a/scripts/ci/payload-size.js b/scripts/ci/payload-size.js index 446519ff69..c32f3bab5c 100644 --- a/scripts/ci/payload-size.js +++ b/scripts/ci/payload-size.js @@ -1,3 +1,11 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + 'use strict'; // Imports @@ -27,7 +35,7 @@ for (const compressionType in limitSizes) { failed = true; // An expected compression type/file combination is missing. Maybe the file was renamed or // removed. Report it as an error, so the user updates the corresponding limit file. - console.log( + console.error( `ERROR: Commit ${commit} ${compressionType} ${filename} measurement is missing. ` + 'Maybe the file was renamed or removed.'); } else { @@ -54,11 +62,11 @@ for (const compressionType in limitSizes) { } // Group failure messages separately from success messages so they are easier to find. -successMessages.concat(failureMessages).forEach(message => console.log(message)); +successMessages.concat(failureMessages).forEach(message => console.error(message)); if (failed) { - console.log(`If this is a desired change, please update the size limits in file '${limitFile}'.`); + console.info(`If this is a desired change, please update the size limits in file '${limitFile}'.`); process.exit(1); } else { - console.log(`Payload size check passed. All diffs are less than 1% or 500 bytes.`); + console.info(`Payload size check passed. All diffs are less than 1% or 500 bytes.`); } diff --git a/scripts/ci/update-deps-to-dist-packages.js b/scripts/ci/update-deps-to-dist-packages.js index a64a30a61c..eff3e2b023 100644 --- a/scripts/ci/update-deps-to-dist-packages.js +++ b/scripts/ci/update-deps-to-dist-packages.js @@ -1,4 +1,12 @@ /** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/* * This script updates a package.json file by replacing all dependencies and devDependencies * such that all packages from the @angular scope point to the packages-dist directory. * @@ -52,12 +60,12 @@ writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2)); // Log all packages that were updated if (updated.length > 0) { - console.log(green(`Updated ${packageJsonPath} to packages in ${packagesDistRoot}:`)); - console.log(` ${updated.join('\n ')}\n`); + console.info(green(`Updated ${packageJsonPath} to packages in ${packagesDistRoot}:`)); + console.info(` ${updated.join('\n ')}\n`); } // Log the packages that were skipped, as they were not present in the packages-dist directory if (skipped.length > 0) { - console.log(yellow(`Did not update packages that were not present in ${packagesDistRoot}:`)); - console.log(` ${skipped.join('\n ')}\n`); + console.info(yellow(`Did not update packages that were not present in ${packagesDistRoot}:`)); + console.info(` ${skipped.join('\n ')}\n`); } diff --git a/scripts/github/utils/git_util.js b/scripts/github/utils/git_util.js index 35124df18e..e7224d299b 100644 --- a/scripts/github/utils/git_util.js +++ b/scripts/github/utils/git_util.js @@ -28,7 +28,7 @@ function httpGet(server, path, headers) { }) .on('error', (e) => reject(e)); }); -}; +} let warnNoToken = true; @@ -47,7 +47,7 @@ async function githubGet(path) { } return JSON.parse(await httpGet('api.github.com', '/repos/angular/angular/' + path, headers)); -}; +} async function githubPrInfo(prNumber) { const pr = (await githubGet('pulls/' + prNumber)); @@ -62,7 +62,7 @@ async function githubPrInfo(prNumber) { }, branch: branch }; -}; // trailing ; so that clang-format is not confused on async function +} function gitHasLocalModifications() { return execNoFatal('git diff-index --quiet HEAD --').code != 0; @@ -92,4 +92,4 @@ exports.githubGet = githubGet; exports.githubPrInfo = githubPrInfo; exports.gitHasLocalModifications = gitHasLocalModifications; exports.execNoFatal = execNoFatal; -exports.getCurrentBranch = getCurrentBranch; \ No newline at end of file +exports.getCurrentBranch = getCurrentBranch; diff --git a/scripts/github/utils/github_closes.js b/scripts/github/utils/github_closes.js index f601541826..a4c66fa6d7 100755 --- a/scripts/github/utils/github_closes.js +++ b/scripts/github/utils/github_closes.js @@ -1,5 +1,13 @@ #!/usr/bin/env node +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + var msg = ''; if (require.main === module) { @@ -14,7 +22,7 @@ if (require.main === module) { process.stdin.on('end', () => { var argv = process.argv.slice(2); - console.log(rewriteMsg(msg, argv[0])); + console.info(rewriteMsg(msg, argv[0])); }); } @@ -25,4 +33,4 @@ function rewriteMsg(msg, prNo) { return lines.join('\n'); } -exports.rewriteMsg = rewriteMsg; \ No newline at end of file +exports.rewriteMsg = rewriteMsg; diff --git a/scripts/github/utils/json_extract.js b/scripts/github/utils/json_extract.js index 4de803a187..5806be3298 100644 --- a/scripts/github/utils/json_extract.js +++ b/scripts/github/utils/json_extract.js @@ -1,5 +1,13 @@ #!/usr/bin/env node +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + var json = ''; if (require.main === module) { @@ -16,8 +24,8 @@ if (require.main === module) { var obj = JSON.parse(json); var argv = process.argv.slice(2); extractPaths(obj, argv).forEach(function(line) { - console.log(line); - }) + console.info(line); + }); }); } @@ -51,4 +59,4 @@ function extractPaths(obj, paths) { return lines; } -exports.extractPaths = extractPaths; \ No newline at end of file +exports.extractPaths = extractPaths; diff --git a/scripts/github/utils/json_extract_test.js b/scripts/github/utils/json_extract_test.js index fb00fabd79..362d12893f 100644 --- a/scripts/github/utils/json_extract_test.js +++ b/scripts/github/utils/json_extract_test.js @@ -1,5 +1,13 @@ #!/usr/bin/env node +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + var assert = require("assert"); var extractPaths = require('./json_extract').extractPaths; diff --git a/scripts/package-builder.js b/scripts/package-builder.js index 4451d3e427..668f35762a 100755 --- a/scripts/package-builder.js +++ b/scripts/package-builder.js @@ -1,3 +1,11 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + 'use strict'; // Build the dist/packages-dist directory in the same fashion as the legacy @@ -51,11 +59,11 @@ module.exports = { * @param {string} description Human-readable description of the build. */ function buildTargetPackages(destPath, enableIvy, description) { - console.log('##################################'); - console.log(`${scriptPath}:`); - console.log(' Building @angular/* npm packages'); - console.log(` Mode: ${description}`); - console.log('##################################'); + console.info('##################################'); + console.info(`${scriptPath}:`); + console.info(' Building @angular/* npm packages'); + console.info(` Mode: ${description}`); + console.info('##################################'); // List of targets to build, e.g. core, common, compiler, etc. Note that we want to also remove // all carriage return (`\r`) characters form the query output, because otherwise the carriage @@ -79,7 +87,7 @@ function buildTargetPackages(destPath, enableIvy, description) { const destDir = `${absDestPath}/${pkg}`; if (test('-d', srcDir)) { - console.log(`# Copy artifacts to ${destDir}`); + console.info(`# Copy artifacts to ${destDir}`); rm('-rf', destDir); cp('-R', srcDir, destDir); chmod('-R', 'u+w', destDir); diff --git a/scripts/webdriver-manager-update.js b/scripts/webdriver-manager-update.js index d19bf65ce3..c9c8588f6f 100755 --- a/scripts/webdriver-manager-update.js +++ b/scripts/webdriver-manager-update.js @@ -1,6 +1,4 @@ #!/usr/bin/env node -'use strict'; - /** * @license * Copyright Google Inc. All Rights Reserved. @@ -8,6 +6,7 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ +'use strict'; // Use process.cwd() so that this script is portable and can be used in /aio // where this will require /aio/node_modules/puppeteer const puppeteerPkgPath = require.resolve('puppeteer/package.json', {paths: [process.cwd()]}); diff --git a/tools/gulp-tasks/README.md b/tools/gulp-tasks/README.md index 91fe459320..5f7a3660e6 100644 --- a/tools/gulp-tasks/README.md +++ b/tools/gulp-tasks/README.md @@ -52,5 +52,5 @@ gulp.task('format:enforce', loadTask('format', 'enforce')); E.g. Loading a task that has dependencies: ```js -gulp.task('lint', ['format:enforce', 'tools:build'], loadTask('lint')); -``` \ No newline at end of file +gulp.task('lint', ['format:enforce'], loadTask('lint')); +``` diff --git a/tools/gulp-tasks/lint.js b/tools/gulp-tasks/lint.js deleted file mode 100644 index f5ef3b7056..0000000000 --- a/tools/gulp-tasks/lint.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -// Check the coding standards and programming errors -module.exports = (gulp) => () => { - const tslint = require('gulp-tslint'); - // Built-in rules are at https://palantir.github.io/tslint/rules/ - const path = require('path'); - return gulp - .src([ - // TODO(vicb): add .js files when supported - // see https://github.com/palantir/tslint/pull/1515 - './modules/**/*.ts', - './modules/**/*.js', - './packages/**/*.ts', - './packages/**/*.js', - './tools/**/*.ts', - './tools/**/*.js', - './*.ts', - - // Ignore node_modules directories - '!**/node_modules/**', - - // Ignore built files directories - '!**/built/**', - '!**/dist/**', - - // Ignore special files - '!**/*.externs.js', - - // Ignore generated files due to lack of copyright header - // TODO(alfaproject): make generated files lintable - '!**/*.d.ts', - '!**/*.ngfactory.ts', - - // Ignore zone.js directory - // TODO(JiaLiPassion): add zone.js back later - '!packages/zone.js/**/*.js', - '!packages/zone.js/**/*.ts', - - // Ignore test files - '!packages/localize/**/test_files/**', - ]) - .pipe(tslint({ - configuration: path.resolve(__dirname, '../../tslint.json'), - formatter: 'prose', - })) - .pipe(tslint.report({emitError: true})); -}; diff --git a/tools/gulp-tasks/tools-build.js b/tools/gulp-tasks/tools-build.js deleted file mode 100644 index a3bbeb56ca..0000000000 --- a/tools/gulp-tasks/tools-build.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -function tsc(projectPath, done) { - const path = require('path'); - const platformScriptPath = require('./platform-script-path'); - const childProcess = require('child_process'); - - childProcess - .spawn( - path.join(__dirname, platformScriptPath('../../node_modules/.bin/tsc')), - ['-p', path.join(__dirname, '../..', projectPath)], {stdio: 'inherit'}) - .on('close', done); -} - -module.exports = (gulp) => (done) => { - tsc('tools/', done); -}; diff --git a/tools/postinstall-patches.js b/tools/postinstall-patches.js index c6c591716b..976183b090 100644 --- a/tools/postinstall-patches.js +++ b/tools/postinstall-patches.js @@ -23,7 +23,7 @@ try { const {set, cd, sed, echo, ls, rm} = require('shelljs'); const {readFileSync} = require('fs'); const path = require('path'); -const log = console.log; +const log = console.info; // COMMENTED OUT BECAUSE WE CURRENTLY REQUIRE NO PATCHES // UNCOMMENT TO REENABLE PATCHING AND LOG OUTPUT diff --git a/tools/types.d.ts b/tools/types.d.ts index ab3d9db318..8c5fadd1df 100644 --- a/tools/types.d.ts +++ b/tools/types.d.ts @@ -1,3 +1,11 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + // This file contains all ambient imports needed to compile the tools source code /// diff --git a/tslint.json b/tslint.json index a8c2deb355..35a2f00b2c 100644 --- a/tslint.json +++ b/tslint.json @@ -73,5 +73,27 @@ true, "function" ] + }, + "linterOptions": { + "exclude": [ + "**/node_modules/**/*", + // Ignore AIO and integration tests. + "./aio/**/*", + "./integration/**/*", + // Ignore output directories + "./built/**/*", + "./dist/**/*", + "./bazel-out/**/*", + // Ignore special files + "**/*.externs.js", + // Ignore test files + "./packages/localize/**/test_files/**/*", + "./tools/ts-api-guardian/test/fixtures/**/*", + "./tools/public_api_guard/**/*.d.ts", + "./modules/benchmarks_external/**/*", + // Ignore zone.js directory + // TODO(JiaLiPassion): add zone.js back later + "./packages/zone.js/**/*" + ] } }