From 26574a7c4624b4fe25892620c2fe46f2a63c7d76 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Tue, 29 Sep 2020 18:26:20 +0300 Subject: [PATCH] build(docs-infra): remove the `only-arrow-functions` tslint rule to align with CLI (#39018) This commit removes the `only-arrow-functions: false` tslint rule to more closely align `tslint.json` with the one generated by the latest Angular CLI for new apps. PR Close #39018 --- aio/src/app/search/search.worker.ts | 4 ++-- aio/tests/e2e/src/api-pages.e2e-spec.ts | 2 +- aio/tests/e2e/src/app.e2e-spec.ts | 2 +- aio/tests/e2e/src/onerror.e2e-spec.ts | 4 ++-- aio/tslint.json | 1 - 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/aio/src/app/search/search.worker.ts b/aio/src/app/search/search.worker.ts index 646b81f6e2..153416a680 100644 --- a/aio/src/app/search/search.worker.ts +++ b/aio/src/app/search/search.worker.ts @@ -44,7 +44,7 @@ function handleMessage(message: { data: WebWorkerMessage }): void { const payload = message.data.payload; switch (type) { case 'load-index': - makeRequest(SEARCH_TERMS_URL, function(searchInfo: PageInfo[]) { + makeRequest(SEARCH_TERMS_URL, (searchInfo: PageInfo[]) => { index = createIndex(loadIndex(searchInfo)); postMessage({ type, id, payload: true }); }); @@ -94,7 +94,7 @@ function queryIndex(query: string): PageInfo[] { results = index.search(query + ' ' + titleQuery); } // Map the hits into info about each page to be returned as results - return results.map(function(hit) { return pages[hit.ref]; }); + return results.map(hit => pages[hit.ref]); } } catch (e) { // If the search query cannot be parsed the index throws an error diff --git a/aio/tests/e2e/src/api-pages.e2e-spec.ts b/aio/tests/e2e/src/api-pages.e2e-spec.ts index b97e89e4f3..636b7b0b62 100644 --- a/aio/tests/e2e/src/api-pages.e2e-spec.ts +++ b/aio/tests/e2e/src/api-pages.e2e-spec.ts @@ -1,6 +1,6 @@ import { ApiPage } from './api.po'; -describe('Api pages', function() { +describe('Api pages', () => { it('should show direct subclasses of a class', () => { const page = new ApiPage('api/forms/AbstractControlDirective'); expect(page.getDescendants('class', true)).toEqual(['ControlContainer', 'NgControl']); diff --git a/aio/tests/e2e/src/app.e2e-spec.ts b/aio/tests/e2e/src/app.e2e-spec.ts index 39b95cfa10..99e0211830 100644 --- a/aio/tests/e2e/src/app.e2e-spec.ts +++ b/aio/tests/e2e/src/app.e2e-spec.ts @@ -1,7 +1,7 @@ import { browser, by, element, ElementFinder } from 'protractor'; import { SitePage } from './app.po'; -describe('site App', function() { +describe('site App', () => { let page: SitePage; beforeEach(() => { diff --git a/aio/tests/e2e/src/onerror.e2e-spec.ts b/aio/tests/e2e/src/onerror.e2e-spec.ts index 3b199a9c89..2cf227b77d 100644 --- a/aio/tests/e2e/src/onerror.e2e-spec.ts +++ b/aio/tests/e2e/src/onerror.e2e-spec.ts @@ -3,7 +3,7 @@ import { SitePage } from './app.po'; /* tslint:disable:max-line-length */ -describe('onerror handler', function() { +describe('onerror handler', () => { let page: SitePage; beforeAll(() => { @@ -186,7 +186,7 @@ createViewNodes@???`); }); async function callOnError(message: string, url?: string, line?: number, column?: number, error?: Error) { - await browser.executeScript(function() { + await browser.executeScript(() => { // reset the ga queue (window as any).ga.q.length = 0; // post the error to the handler diff --git a/aio/tslint.json b/aio/tslint.json index 05ee64c9b0..b6d76e15af 100644 --- a/aio/tslint.json +++ b/aio/tslint.json @@ -68,7 +68,6 @@ true, "as-needed" ], - "only-arrow-functions": false, "quotemark": [ true, "single"