Skip to content

Commit 5615928

Browse files
devversionatscott
authored andcommitted
build: no longer run tslint from within gulp task (angular#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 angular#35800
1 parent 5349e46 commit 5615928

28 files changed

+171
-138
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ jobs:
274274
- run: 'yarn bazel:lint ||
275275
(echo -e "\n.bzl files have lint errors. Please run ''yarn bazel:lint-fix''"; exit 1)'
276276

277-
- run: yarn gulp lint
277+
- run: yarn lint
278278
- run: node tools/pullapprove/verify.js
279279

280280
test:

docs/DEVELOPER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ where `$ANGULAR_PATH` is an environment variable of the absolute path of your An
129129
You can check that your code is properly formatted and adheres to coding style by running:
130130

131131
``` shell
132-
$ yarn gulp lint
132+
$ yarn lint
133133
```
134134

135135
## Publishing Snapshot Builds

gulpfile.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,9 @@ gulp.task('format:changed', ['format:untracked', 'format:diff']);
4545
// Alias for `format:changed` that formerly formatted all files.
4646
gulp.task('format', ['format:changed']);
4747

48-
gulp.task('lint', ['format:enforce', 'validate-commit-messages', 'tslint']);
49-
gulp.task('tslint', ['tools:build'], loadTask('lint'));
48+
gulp.task('lint', ['format:enforce', 'validate-commit-messages']);
5049
gulp.task('validate-commit-messages', loadTask('validate-commit-message'));
5150
gulp.task('source-map-test', loadTask('source-map-test'));
52-
gulp.task('tools:build', loadTask('tools-build'));
5351
gulp.task('changelog', loadTask('changelog'));
5452
gulp.task('changelog:zonejs', loadTask('changelog-zonejs'));
5553
gulp.task('check-env', () => {/* this is a noop because the env test ran already above */});

modules/system.d.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
/**
2-
* Dummy typings for systemjs.
2+
* @license
3+
* Copyright Google Inc. All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
37
*/
8+
9+
/** Dummy typings for systemjs. */
410
declare var System: any;

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
"bazel": "bazel",
3131
"//circleci-win-comment": "See the test-win circleci job for why these are needed. If they are not needed anymore, remove them.",
3232
"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/...",
33-
"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/..."
33+
"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/...",
34+
"lint": "yarn -s tslint && yarn gulp lint",
35+
"tslint": "tsc -p tools/tsconfig.json && tslint -c tslint.json \"+(packages|modules|scripts|tools)/**/*.+(js|ts)\""
3436
},
3537
"// 1": "dependencies are used locally and by bazel",
3638
"dependencies": {

packages/bazel/src/builders/schema.d.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
2-
// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
3-
// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
4-
5-
// tslint:disable:no-global-tslint-disable
6-
// tslint:disable
1+
/**
2+
* @license
3+
* Copyright Google Inc. All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
78

89
/**
910
* Options for Bazel Builder

packages/bazel/src/schematics/ng-add/schema.d.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
2-
// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
3-
// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
4-
5-
// tslint:disable:no-global-tslint-disable
6-
// tslint:disable
1+
/**
2+
* @license
3+
* Copyright Google Inc. All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
78

89
export interface Schema {
910
/**

packages/bazel/src/schematics/ng-new/schema.d.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google Inc. All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
18

2-
// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
3-
// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
4-
5-
// tslint:disable
69
export interface Schema {
710
/**
811
* Initial git repository commit information.

packages/core/test/render3/perf/micro_bench.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export function createBenchmark(benchmarkName: string): Benchmark {
9191
return (previous.bestTime < current.bestTime) ? previous : current;
9292
});
9393
const unitOffset = findUnit(fastest.bestTime);
94-
(fn || console.log)(`\nBenchmark: ${benchmarkName}\n${profiles.map((profile: Profile) => {
94+
(fn || console.info)(`\nBenchmark: ${benchmarkName}\n${profiles.map((profile: Profile) => {
9595
const time = formatTime(profile.bestTime, unitOffset);
9696
const percent = formatPercent(1 - profile.bestTime / fastest.bestTime);
9797
return ` ${profile.profileName}: ${time}(${percent}) `;

packages/service-worker/worker/src/service-worker.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// tslint:disable:file-header
12
/**
23
* Copyright (c) 2016, Tiernan Cridland
34
*

0 commit comments

Comments
 (0)