style(docs-infra): fix docs examples for tslint rule `semicolon` (#38143)

This commit updates the docs examples to be compatible with the
`semicolon` tslint rule.

This is in preparation of updating the docs examples `tslint.json` to
match the one generated for new Angular CLI apps in a future commit.

PR Close #38143
This commit is contained in:
George Kalpakas 2020-07-30 13:03:11 +03:00 committed by Alex Rickabaugh
parent 7c0f11789b
commit 77f38d3be1
21 changed files with 23 additions and 23 deletions

View File

@ -84,7 +84,7 @@ export class AppComponent implements OnInit {
}
resetList() {
this.resetItems()
this.resetItems();
this.itemsWithTrackByCountReset = 0;
this.itemsNoTrackByCount = ++this.itemsNoTrackByCount;
}

View File

@ -22,5 +22,5 @@ export function runnersUpFactory(take: number) {
.join(', ');
// #docregion factory-synopsis
};
};
}
// #enddocregion factory-synopsis

View File

@ -107,7 +107,7 @@ export class OldLogger {
logs: string[] = [];
log(message: string) {
throw new Error('Should not call the old logger!');
};
}
}
@Component({

View File

@ -14,7 +14,7 @@ describe('Elements', () => {
const waitForText = (elem: ElementFinder) => {
// Waiting for the element to have some text, makes the tests less flaky.
browser.wait(async () => /\S/.test(await elem.getText()), 5000);
}
};
beforeEach(() => browser.get(''));

View File

@ -160,7 +160,7 @@ function expectFormIsInvalid() {
function triggerAlterEgoValidation() {
// alterEgo has updateOn set to 'blur', click outside of the input to trigger the blur event
element(by.css('app-root')).click()
element(by.css('app-root')).click();
}
function waitForAlterEgoValidation() {

View File

@ -19,7 +19,7 @@ export const identityRevealedValidator: ValidatorFn = (control: FormGroup): Vali
})
export class IdentityRevealedValidatorDirective implements Validator {
validate(control: AbstractControl): ValidationErrors {
return identityRevealedValidator(control)
return identityRevealedValidator(control);
}
}
// #enddocregion cross-validation-directive

View File

@ -30,9 +30,9 @@ export class HeroTaxReturnComponent {
onCanceled() {
this.flashMessage('Canceled');
this.heroTaxReturnService.restoreTaxReturn();
};
}
onClose() { this.close.emit(); };
onClose() { this.close.emit(); }
onSaved() {
this.flashMessage('Saved');

View File

@ -12,7 +12,7 @@ export interface RequestCacheEntry {
// #docregion request-cache
export abstract class RequestCache {
abstract get(req: HttpRequest<any>): HttpResponse<any> | undefined;
abstract put(req: HttpRequest<any>, response: HttpResponse<any>): void
abstract put(req: HttpRequest<any>, response: HttpResponse<any>): void;
}
// #enddocregion request-cache

View File

@ -97,11 +97,11 @@ describe('NgModule-example', function () {
newContactButton.click().then(function () {
input.click();
nextButton.click()
nextButton.click();
expect(contacts.validationError.getText()).toBe('Name is required.');
input.click();
contacts.input.sendKeys('Watson');
saveButton.click()
saveButton.click();
expect(contacts.contactNameHeader.getText()).toBe('Awesome Watson');
});

View File

@ -6,4 +6,4 @@ export const CRISES: Crisis[] = [
{ id: 2, name: 'Sky Rains Great White Sharks' },
{ id: 3, name: 'Giant Asteroid Heading For Earth' },
{ id: 4, name: 'Procrastinators Meeting Delayed Again' },
]
];

View File

@ -19,5 +19,5 @@ export class DialogService {
const confirmation = window.confirm(message || 'Is it OK?');
return of(confirmation);
};
}
}

View File

@ -18,7 +18,7 @@ export class FilterTextService {
match = true;
break;
}
};
}
return match;
});
filteredList = filtered;

View File

@ -51,7 +51,7 @@ export class MasterService {
export class ReversePipe implements PipeTransform {
transform(s: string) {
let r = '';
for (let i = s.length; i; ) { r += s[--i]; };
for (let i = s.length; i; ) { r += s[--i]; }
return r;
}
}

View File

@ -139,5 +139,5 @@ class Page {
// Get the component's injected router navigation spy
const routerSpy = fixture.debugElement.injector.get(Router);
this.navSpy = routerSpy.navigate as jasmine.Spy;
};
}
}

View File

@ -8,7 +8,7 @@ import { WelcomeComponent } from './welcome.component';
class MockUserService {
isLoggedIn = true;
user = { name: 'Test User'};
};
}
// #enddocregion mock-user-service
describe('WelcomeComponent (class only)', () => {

View File

@ -120,7 +120,7 @@ function expectHeading(hLevel: number, expectedText: string): void {
let hTag = `h${hLevel}`;
let hText = element(by.css(hTag)).getText();
expect(hText).toEqual(expectedText, hTag);
};
}
function getPageElts() {
return {

View File

@ -120,7 +120,7 @@ function expectHeading(hLevel: number, expectedText: string): void {
let hTag = `h${hLevel}`;
let hText = element(by.css(hTag)).getText();
expect(hText).toEqual(expectedText, hTag);
};
}
function getPageElts() {
return {

View File

@ -124,7 +124,7 @@ function expectHeading(hLevel: number, expectedText: string): void {
let hTag = `h${hLevel}`;
let hText = element(by.css(hTag)).getText();
expect(hText).toEqual(expectedText, hTag);
};
}
function getPageElts() {
return {

View File

@ -164,7 +164,7 @@ function expectHeading(hLevel: number, expectedText: string): void {
let hTag = `h${hLevel}`;
let hText = element(by.css(hTag)).getText();
expect(hText).toEqual(expectedText, hTag);
};
}
function getHeroLiEltById(id: number) {
let spanForId = element(by.cssContainingText('li span.badge', id.toString()));

View File

@ -286,7 +286,7 @@ function expectHeading(hLevel: number, expectedText: string): void {
let hTag = `h${hLevel}`;
let hText = element(by.css(hTag)).getText();
expect(hText).toEqual(expectedText, hTag);
};
}
function getHeroAEltById(id: number): ElementFinder {
let spanForId = element(by.cssContainingText('li span.badge', id.toString()));

View File

@ -81,7 +81,7 @@ describe('PhoneCat Application', function() {
waitForCount(phoneList, 1);
let nexusPhone = phoneList.first();
let detailLink = nexusPhone.all(by.css('a')).first()
let detailLink = nexusPhone.all(by.css('a')).first();
detailLink.click();
expect(browser.getLocationAbsUrl()).toBe('/phones/nexus-s');