Skip to content

Commit 3704400

Browse files
devversionandrewseguin
authored andcommitted
refactor: re-format all tracked files with prettier
Reformats all tracked files with prettier so that formatting is consistent across the repo.
1 parent ece73e5 commit 3704400

File tree

1,723 files changed

+44543
-35661
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,723 files changed

+44543
-35661
lines changed

.circleci/rebase-pr.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
// tslint:disable:no-console
2222
const {execSync: execSync_} = require('child_process');
2323

24-
2524
/** A regex to select a ref that matches our semver refs. */
2625
const semverRegex = /^(\d+)\.(\d+)\.x$/;
2726

@@ -34,7 +33,9 @@ function exec(command, allowStderr = true) {
3433
let output = new String();
3534
output.code = 0;
3635
try {
37-
output += execSync_(command, {stdio: ['pipe', 'pipe', 'pipe']}).toString().trim();
36+
output += execSync_(command, {stdio: ['pipe', 'pipe', 'pipe']})
37+
.toString()
38+
.trim();
3839
} catch (err) {
3940
allowStderr && console.error(err.stderr.toString());
4041
output.code = err.status;
@@ -44,7 +45,6 @@ function exec(command, allowStderr = true) {
4445

4546
// Run
4647

47-
4848
// Helpers
4949
async function _main() {
5050
const refs = await getRefsAndShasForChange();
@@ -59,12 +59,16 @@ async function _main() {
5959
console.log();
6060

6161
// Get the count of commits between the latest commit from origin and the common ancestor SHA.
62-
const commitCount = exec(`git rev-list --count origin/${refs.base.ref}...${refs.commonAncestorSha}`);
62+
const commitCount = exec(
63+
`git rev-list --count origin/${refs.base.ref}...${refs.commonAncestorSha}`,
64+
);
6365
console.log(`Checking ${commitCount} commits for changes in the CircleCI config file.`);
6466

6567
// Check if the files changed between the latest commit from origin and the common ancestor SHA
6668
// includes the CircleCI config.
67-
const circleCIConfigChanged = exec(`git diff --name-only origin/${refs.base.ref} ${refs.commonAncestorSha} -- .circleci/config.yml`);
69+
const circleCIConfigChanged = exec(
70+
`git diff --name-only origin/${refs.base.ref} ${refs.commonAncestorSha} -- .circleci/config.yml`,
71+
);
6872

6973
if (!!circleCIConfigChanged) {
7074
throw Error(`
@@ -90,8 +94,6 @@ async function _main() {
9094
console.log(`Rebased current branch onto ${refs.base.ref}.`);
9195
}
9296

93-
94-
9597
/**
9698
* Sort a list of fullpath refs into a list and then provide the first entry.
9799
*
@@ -116,8 +118,11 @@ function getRefFromBranchList(gitOutput) {
116118
if (aIsSemver && bIsSemver) {
117119
const [, aMajor, aMinor] = a.match(semverRegex);
118120
const [, bMajor, bMinor] = b.match(semverRegex);
119-
return parseInt(bMajor, 10) - parseInt(aMajor, 10) ||
120-
parseInt(aMinor, 10) - parseInt(bMinor, 10) || 0;
121+
return (
122+
parseInt(bMajor, 10) - parseInt(aMajor, 10) ||
123+
parseInt(aMinor, 10) - parseInt(bMinor, 10) ||
124+
0
125+
);
121126
}
122127
if (aIsSemver) {
123128
return -1;
@@ -168,7 +173,6 @@ function addAndFetchRemote(owner, name) {
168173
return remoteName;
169174
}
170175

171-
172176
/** Get the ref and latest shas for the provided sha on a specific remote. */
173177
function getRefAndShas(sha, owner, name) {
174178
const remoteName = addAndFetchRemote(owner, name);
@@ -181,19 +185,18 @@ function getRefAndShas(sha, owner, name) {
181185
return {remote: remoteName, ref, latestSha, sha};
182186
}
183187

184-
185188
/** Gets the refs and shas for the base and target of the current environment. */
186189
function getRefsAndShasForChange() {
187190
const base = getRefAndShas(
188191
process.env['CIRCLE_GIT_BASE_REVISION'],
189192
process.env['CIRCLE_PROJECT_USERNAME'],
190-
process.env['CIRCLE_PROJECT_REPONAME']
193+
process.env['CIRCLE_PROJECT_REPONAME'],
191194
);
192195

193196
const target = getRefAndShas(
194197
process.env['CIRCLE_GIT_REVISION'],
195198
process.env['CIRCLE_PR_USERNAME'],
196-
process.env['CIRCLE_PR_REPONAME']
199+
process.env['CIRCLE_PR_REPONAME'],
197200
);
198201

199202
const commonAncestorSha = getCommonAncestorSha(base.sha, target.sha);
@@ -204,7 +207,6 @@ function getRefsAndShasForChange() {
204207
};
205208
}
206209

207-
208210
_main().catch(err => {
209211
console.log('Failed to rebase on top of target branch.\n');
210212
console.error(err);

.ng-dev/caretaker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ export const caretaker: CaretakerConfig = {
1010
{
1111
name: 'Triage Queue',
1212
query: `is:open label:"needs triage"`,
13-
}
14-
]
13+
},
14+
],
1515
};

.ng-dev/commit-message.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,6 @@ export const commitMessage: CommitMessageConfig = {
113113
'material/toolbar',
114114
'material/tooltip',
115115
'material/tree',
116-
'youtube-player'
116+
'youtube-player',
117117
],
118118
};

.ng-dev/pull-request.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ export const pullRequest: PullRequestConfig = {
1111
// use the Github API merge strategy. That way we ensure that PRs show up as `Merged`.
1212
githubApiMerge: {
1313
default: 'squash',
14-
labels: [
15-
{pattern: 'preserve commits', method: 'rebase'}
16-
]
14+
labels: [{pattern: 'preserve commits', method: 'rebase'}],
1715
},
1816
mergeReadyLabel: 'merge ready',
1917
commitMessageFixupLabel: 'commit message fixup',

.ng-dev/release.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import {SemVer} from 'semver';
44
import {assertValidNpmPackageOutput} from '../tools/release-checks/npm-package-output';
55
import {fork} from 'child_process';
66
import {join} from 'path';
7-
import {
8-
FatalReleaseActionError
9-
} from '@angular/dev-infra-private/ng-dev/release/publish/actions-error';
7+
import {FatalReleaseActionError} from '@angular/dev-infra-private/ng-dev/release/publish/actions-error';
108

119
const actionProto = ReleaseAction.prototype as any;
1210
const _origStageFn = actionProto.stageVersionForBranchAndCreatePullRequest;
@@ -20,8 +18,9 @@ async function runStagingReleaseChecks(newVersion: SemVer) {
2018
// directly call into the release checks, the `.ng-dev/release` config would be
2119
// cached by NodeJS and release checks would potentially check for packages which
2220
// no longer exist in the publish branch (or the other way around).
23-
const releaseChecksProcess = fork(
24-
join(__dirname, '../tools/release-checks/index.js'), [newVersion.format()]);
21+
const releaseChecksProcess = fork(join(__dirname, '../tools/release-checks/index.js'), [
22+
newVersion.format(),
23+
]);
2524

2625
releaseChecksProcess.on('close', code => {
2726
if (code !== 0) {
@@ -37,16 +36,18 @@ async function runStagingReleaseChecks(newVersion: SemVer) {
3736
// before staging a release. This is temporary until the dev-infra team has implemented
3837
// a more generic solution to running sanity checks before releasing (potentially building
3938
// some of the checks we have in the components repository into the release tool).
40-
actionProto.stageVersionForBranchAndCreatePullRequest = async function(newVersion: SemVer) {
39+
actionProto.stageVersionForBranchAndCreatePullRequest = async function (newVersion: SemVer) {
4140
await runStagingReleaseChecks(newVersion);
4241

4342
return await _origStageFn.apply(this, arguments);
4443
};
4544

4645
// Patches the `@angular/dev-infra-private` release tool to perform sanity
4746
// checks of the NPM package output, before publishing to NPM.
48-
actionProto._verifyPackageVersions =
49-
async function(newVersion: SemVer, builtPackages: BuiltPackage[]) {
47+
actionProto._verifyPackageVersions = async function (
48+
newVersion: SemVer,
49+
builtPackages: BuiltPackage[],
50+
) {
5051
await assertValidNpmPackageOutput(builtPackages, newVersion);
5152

5253
return await _origVerifyFn.apply(this, arguments);

build-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ module.exports = {
3737
projectDir: __dirname,
3838
packagesDir: join(__dirname, 'src'),
3939
outputDir: join(__dirname, 'dist'),
40-
licenseBanner: buildLicense
40+
licenseBanner: buildLicense,
4141
};

integration/ng-add/karma.conf.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = function (config) {
1515
require('karma-chrome-launcher'),
1616
require('karma-jasmine-html-reporter'),
1717
require('karma-coverage'),
18-
require('@angular-devkit/build-angular/plugins/karma')
18+
require('@angular-devkit/build-angular/plugins/karma'),
1919
],
2020
client: {
2121
jasmine: {
@@ -24,18 +24,15 @@ module.exports = function (config) {
2424
// for example, you can disable the random execution with `random: false`
2525
// or set a specific seed with `seed: 4321`
2626
},
27-
clearContext: false // leave Jasmine Spec Runner output visible in browser
27+
clearContext: false, // leave Jasmine Spec Runner output visible in browser
2828
},
2929
jasmineHtmlReporter: {
30-
suppressAll: true // removes the duplicated traces
30+
suppressAll: true, // removes the duplicated traces
3131
},
3232
coverageReporter: {
3333
dir: require('path').join(__dirname, './coverage/ng-add'),
3434
subdir: '.',
35-
reporters: [
36-
{ type: 'html' },
37-
{ type: 'text-summary' }
38-
]
35+
reporters: [{type: 'html'}, {type: 'text-summary'}],
3936
},
4037
reporters: ['progress', 'kjhtml'],
4138
port: 9876,
@@ -44,6 +41,6 @@ module.exports = function (config) {
4441
autoWatch: true,
4542
browsers: ['ChromeHeadless'],
4643
singleRun: false,
47-
restartOnFileChange: true
44+
restartOnFileChange: true,
4845
});
4946
};
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { NgModule } from '@angular/core';
2-
import { RouterModule, Routes } from '@angular/router';
1+
import {NgModule} from '@angular/core';
2+
import {RouterModule, Routes} from '@angular/router';
33

44
const routes: Routes = [];
55

66
@NgModule({
77
imports: [RouterModule.forRoot(routes)],
8-
exports: [RouterModule]
8+
exports: [RouterModule],
99
})
10-
export class AppRoutingModule { }
10+
export class AppRoutingModule {}

integration/ng-add/src/app/app.component.spec.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
import { TestBed } from '@angular/core/testing';
2-
import { RouterTestingModule } from '@angular/router/testing';
3-
import { AppComponent } from './app.component';
1+
import {TestBed} from '@angular/core/testing';
2+
import {RouterTestingModule} from '@angular/router/testing';
3+
import {AppComponent} from './app.component';
44

55
describe('AppComponent', () => {
66
beforeEach(async () => {
77
await TestBed.configureTestingModule({
8-
imports: [
9-
RouterTestingModule
10-
],
11-
declarations: [
12-
AppComponent
13-
],
8+
imports: [RouterTestingModule],
9+
declarations: [AppComponent],
1410
}).compileComponents();
1511
});
1612

@@ -30,6 +26,8 @@ describe('AppComponent', () => {
3026
const fixture = TestBed.createComponent(AppComponent);
3127
fixture.detectChanges();
3228
const compiled = fixture.nativeElement as HTMLElement;
33-
expect(compiled.querySelector('.content span')?.textContent).toContain('ng-add app is running!');
29+
expect(compiled.querySelector('.content span')?.textContent).toContain(
30+
'ng-add app is running!',
31+
);
3432
});
3533
});

integration/ng-add/src/app/app.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Component } from '@angular/core';
1+
import {Component} from '@angular/core';
22

33
@Component({
44
selector: 'app-root',
55
templateUrl: './app.component.html',
6-
styleUrls: ['./app.component.scss']
6+
styleUrls: ['./app.component.scss'],
77
})
88
export class AppComponent {
99
title = 'ng-add';
Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1-
import { NgModule } from '@angular/core';
2-
import { BrowserModule } from '@angular/platform-browser';
1+
import {NgModule} from '@angular/core';
2+
import {BrowserModule} from '@angular/platform-browser';
33

4-
import { AppRoutingModule } from './app-routing.module';
5-
import { AppComponent } from './app.component';
4+
import {AppRoutingModule} from './app-routing.module';
5+
import {AppComponent} from './app.component';
66

77
@NgModule({
8-
declarations: [
9-
AppComponent
10-
],
11-
imports: [
12-
BrowserModule,
13-
AppRoutingModule
14-
],
8+
declarations: [AppComponent],
9+
imports: [BrowserModule, AppRoutingModule],
1510
providers: [],
16-
bootstrap: [AppComponent]
11+
bootstrap: [AppComponent],
1712
})
18-
export class AppModule { }
13+
export class AppModule {}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export const environment = {
2-
production: true
2+
production: true,
33
};

integration/ng-add/src/environments/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// The list of file replacements can be found in `angular.json`.
44

55
export const environment = {
6-
production: false
6+
production: false,
77
};
88

99
/*

integration/ng-add/src/main.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import { enableProdMode } from '@angular/core';
2-
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
1+
import {enableProdMode} from '@angular/core';
2+
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
33

4-
import { AppModule } from './app/app.module';
5-
import { environment } from './environments/environment';
4+
import {AppModule} from './app/app.module';
5+
import {environment} from './environments/environment';
66

77
if (environment.production) {
88
enableProdMode();
99
}
1010

11-
platformBrowserDynamic().bootstrapModule(AppModule)
11+
platformBrowserDynamic()
12+
.bootstrapModule(AppModule)
1213
.catch(err => console.error(err));

integration/ng-add/src/polyfills.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@
5252
/***************************************************************************************************
5353
* Zone JS is required by default for Angular itself.
5454
*/
55-
import 'zone.js'; // Included with Angular CLI.
56-
55+
import 'zone.js'; // Included with Angular CLI.
5756

5857
/***************************************************************************************************
5958
* APPLICATION IMPORTS

integration/ng-add/src/test.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
22

33
import 'zone.js/testing';
4-
import { getTestBed } from '@angular/core/testing';
4+
import {getTestBed} from '@angular/core/testing';
55
import {
66
BrowserDynamicTestingModule,
7-
platformBrowserDynamicTesting
7+
platformBrowserDynamicTesting,
88
} from '@angular/platform-browser-dynamic/testing';
99

1010
declare const require: {
11-
context(path: string, deep?: boolean, filter?: RegExp): {
11+
context(
12+
path: string,
13+
deep?: boolean,
14+
filter?: RegExp,
15+
): {
1216
keys(): string[];
1317
<T>(id: string): T;
1418
};
1519
};
1620

1721
// First, initialize the Angular testing environment.
18-
getTestBed().initTestEnvironment(
19-
BrowserDynamicTestingModule,
20-
platformBrowserDynamicTesting(),
21-
{ teardown: { destroyAfterEach: true }},
22-
);
22+
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
23+
teardown: {destroyAfterEach: true},
24+
});
2325

2426
// Then we find all the tests.
2527
const context = require.context('./', true, /\.spec\.ts$/);

0 commit comments

Comments
 (0)