Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: no longer run tslint from within gulp task #35800

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/DEVELOPER.md
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions gulpfile.js
Expand Up @@ -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 */});
Expand Down
8 changes: 7 additions & 1 deletion 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;
8 changes: 5 additions & 3 deletions package.json
Expand Up @@ -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": {
Expand Down Expand Up @@ -132,7 +134,7 @@
"terser": "^4.4.0",
"tsickle": "0.38.0",
"tslib": "^1.10.0",
"tslint": "5.7.0",
"tslint": "6.0.0",
"typescript": "~3.7.4",
"xhr2": "0.1.4",
"yaml": "^1.7.2",
Expand Down Expand Up @@ -173,7 +175,7 @@
"rewire": "2.5.2",
"sauce-connect": "https://saucelabs.com/downloads/sc-4.5.1-linux.tar.gz",
"semver": "^6.3.0",
"tslint-eslint-rules": "4.1.1",
"tslint-eslint-rules": "5.4.0",
"tslint-no-toplevel-property-access": "0.0.2",
"tsutils": "2.27.2",
"universal-analytics": "0.4.15",
Expand Down
13 changes: 7 additions & 6 deletions 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
Expand Down
13 changes: 7 additions & 6 deletions 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 {
/**
Expand Down
11 changes: 7 additions & 4 deletions 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.
Expand Down
Expand Up @@ -28,8 +28,7 @@ describe('Google3 dynamic queries TSLint rule', () => {
function runTSLint(fix = true) {
const program = Linter.createProgram(join(tmpDir, 'tsconfig.json'));
const linter = new Linter({fix, rulesDirectory: [rulesDirectory]}, program);
const config = Configuration.parseConfigFile(
{rules: {'dynamic-queries': true}, linterOptions: {typeCheck: true}});
const config = Configuration.parseConfigFile({rules: {'dynamic-queries': true}});

program.getRootFileNames().forEach(fileName => {
linter.lint(fileName, program.getSourceFile(fileName) !.getFullText(), config);
Expand Down
Expand Up @@ -38,8 +38,7 @@ describe('Google3 explicitQueryTiming TSLint rule', () => {
function runTSLint(fix = true) {
const program = Linter.createProgram(join(tmpDir, 'tsconfig.json'));
const linter = new Linter({fix, rulesDirectory: [rulesDirectory]}, program);
const config = Configuration.parseConfigFile(
{rules: {'explicit-query-timing': true}, linterOptions: {typeCheck: true}});
const config = Configuration.parseConfigFile({rules: {'explicit-query-timing': true}});

program.getRootFileNames().forEach(fileName => {
linter.lint(fileName, program.getSourceFile(fileName) !.getFullText(), config);
Expand Down
Expand Up @@ -29,8 +29,7 @@ describe('Google3 missing injectable tslint rule', () => {
function runTSLint(fix = true) {
const program = Linter.createProgram(join(tmpDir, 'tsconfig.json'));
const linter = new Linter({fix, rulesDirectory: [rulesDirectory]}, program);
const config = Configuration.parseConfigFile(
{rules: {'no-missing-injectable': true}, linterOptions: {typeCheck: true}});
const config = Configuration.parseConfigFile({rules: {'no-missing-injectable': true}});

program.getRootFileNames().forEach(fileName => {
linter.lint(fileName, program.getSourceFile(fileName) !.getFullText(), config);
Expand Down
Expand Up @@ -30,8 +30,8 @@ describe('Google3 noTemplateVariableAssignment TSLint rule', () => {
function runTSLint() {
const program = Linter.createProgram(join(tmpDir, 'tsconfig.json'));
const linter = new Linter({fix: false, rulesDirectory: [rulesDirectory]}, program);
const config = Configuration.parseConfigFile(
{rules: {'no-template-variable-assignment': true}, linterOptions: {typeCheck: true}});
const config =
Configuration.parseConfigFile({rules: {'no-template-variable-assignment': true}});

program.getRootFileNames().forEach(fileName => {
linter.lint(fileName, program.getSourceFile(fileName) !.getFullText(), config);
Expand Down
Expand Up @@ -43,8 +43,7 @@ describe('Google3 Renderer to Renderer2 TSLint rule', () => {
function runTSLint(fix: boolean) {
const program = Linter.createProgram(join(tmpDir, 'tsconfig.json'));
const linter = new Linter({fix, rulesDirectory: [rulesDirectory]}, program);
const config = Configuration.parseConfigFile(
{rules: {'renderer-to-renderer2': true}, linterOptions: {typeCheck: true}});
const config = Configuration.parseConfigFile({rules: {'renderer-to-renderer2': true}});

program.getRootFileNames().forEach(fileName => {
linter.lint(fileName, program.getSourceFile(fileName) !.getFullText(), config);
Expand Down
Expand Up @@ -30,7 +30,6 @@ describe('Google3 undecorated classes with decorated fields TSLint rule', () =>
const linter = new Linter({fix, rulesDirectory: [rulesDirectory]}, program);
const config = Configuration.parseConfigFile({
rules: {'undecorated-classes-with-decorated-fields': true},
linterOptions: {typeCheck: true}
});

program.getRootFileNames().forEach(fileName => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/render3/perf/micro_bench.ts
Expand Up @@ -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}) `;
Expand Down
1 change: 1 addition & 0 deletions packages/service-worker/worker/src/service-worker.d.ts
@@ -1,3 +1,4 @@
// tslint:disable:file-header
/**
* Copyright (c) 2016, Tiernan Cridland
*
Expand Down
8 changes: 7 additions & 1 deletion 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;
4 changes: 2 additions & 2 deletions scripts/browserstack/start_tunnel.js
Expand Up @@ -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();
});
Expand Down
7 changes: 7 additions & 0 deletions 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');
Expand Down
20 changes: 14 additions & 6 deletions 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');
Expand All @@ -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);
Expand Down
16 changes: 12 additions & 4 deletions 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
Expand Down Expand Up @@ -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 {
Expand All @@ -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.`);
}
16 changes: 12 additions & 4 deletions 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.
*
Expand Down Expand Up @@ -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`);
}
8 changes: 4 additions & 4 deletions scripts/github/utils/git_util.js
Expand Up @@ -28,7 +28,7 @@ function httpGet(server, path, headers) {
})
.on('error', (e) => reject(e));
});
};
}

let warnNoToken = true;

Expand All @@ -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));
Expand All @@ -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;
Expand Down Expand Up @@ -92,4 +92,4 @@ exports.githubGet = githubGet;
exports.githubPrInfo = githubPrInfo;
exports.gitHasLocalModifications = gitHasLocalModifications;
exports.execNoFatal = execNoFatal;
exports.getCurrentBranch = getCurrentBranch;
exports.getCurrentBranch = getCurrentBranch;