Skip to content

Commit

Permalink
build(docs-infra): update the object-literal-key-quotes tslint rule…
Browse files Browse the repository at this point in the history
… to align with CLI (#39018)

This commit updates the `object-literal-key-quotes` tslint rule to more
closely align `tslint.json` with the one generated by the latest Angular
CLI for new apps.

PR Close #39018
  • Loading branch information
gkalpak authored and josephperrott committed Oct 1, 2020
1 parent cb85d69 commit 4f8b716
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 130 deletions.
50 changes: 25 additions & 25 deletions aio/src/app/app.component.spec.ts
Expand Up @@ -782,7 +782,7 @@ describe('AppComponent', () => {
it('should grab focus when the / key is pressed', () => {
const searchBox: SearchBoxComponent = fixture.debugElement.query(By.directive(SearchBoxComponent)).componentInstance;
spyOn(searchBox, 'focus');
window.document.dispatchEvent(new KeyboardEvent('keyup', { 'key': '/' }));
window.document.dispatchEvent(new KeyboardEvent('keyup', { key: '/' }));
fixture.detectChanges();
expect(searchBox.focus).toHaveBeenCalled();
});
Expand All @@ -791,7 +791,7 @@ describe('AppComponent', () => {
const searchBox: SearchBoxComponent = fixture.debugElement.query(By.directive(SearchBoxComponent)).componentInstance;
spyOn(searchBox, 'focus');
component.showSearchResults = true;
window.document.dispatchEvent(new KeyboardEvent('keyup', { 'key': 'Escape' }));
window.document.dispatchEvent(new KeyboardEvent('keyup', { key: 'Escape' }));
fixture.detectChanges();
expect(searchBox.focus).toHaveBeenCalled();
});
Expand Down Expand Up @@ -1311,42 +1311,42 @@ class TestHttpClient {

// tslint:disable:quotemark
navJson = {
"TopBar": [
TopBar: [
{
"url": "features",
"title": "Features"
url: 'features',
title: 'Features',
},
{
"url": "no-title",
"title": "No Title"
url: 'no-title',
title: 'No Title',
},
],
"SideNav": [
SideNav: [
{
"title": "Core",
"tooltip": "Learn the core capabilities of Angular",
"children": [
title: 'Core',
tooltip: 'Learn the core capabilities of Angular',
children: [
{
"url": "guide/pipes",
"title": "Pipes",
"tooltip": "Pipes transform displayed values within a template."
url: 'guide/pipes',
title: 'Pipes',
tooltip: 'Pipes transform displayed values within a template.',
},
{
"url": "guide/bags",
"title": "Bags",
"tooltip": "Pack your bags for a code adventure."
}
]
url: 'guide/bags',
title: 'Bags',
tooltip: 'Pack your bags for a code adventure.',
},
],
},
{
"url": "api",
"title": "API",
"tooltip": "Details of the Angular classes and values."
}
url: 'api',
title: 'API',
tooltip: 'Details of the Angular classes and values.',
},
],
"docVersions": TestHttpClient.docVersions,
docVersions: TestHttpClient.docVersions,

"__versionInfo": TestHttpClient.versionInfo,
__versionInfo: TestHttpClient.versionInfo,
};

get(url: string) {
Expand Down
112 changes: 56 additions & 56 deletions aio/src/app/custom-elements/api/api-list.component.spec.ts
Expand Up @@ -223,77 +223,77 @@ class TestApiService {
// tslint:disable:quotemark
const apiSections: ApiSection[] = [
{
"name": "common",
"title": "common",
"path": "api/common",
"deprecated": false,
"items": [
name: 'common',
title: 'common',
path: 'api/common',
deprecated: false,
items: [
{
"name": "class_1",
"title": "Class 1",
"path": "api/common/class_1",
"docType": "class",
"stability": "experimental",
"securityRisk": false,
name: 'class_1',
title: 'Class 1',
path: 'api/common/class_1',
docType: 'class',
stability: 'experimental',
securityRisk: false,
},
{
"name": "class_2",
"title": "Class 2",
"path": "api/common/class_2",
"docType": "class",
"stability": "stable",
"securityRisk": false,
name: 'class_2',
title: 'Class 2',
path: 'api/common/class_2',
docType: 'class',
stability: 'stable',
securityRisk: false,
},
{
"name": "directive_1",
"title": "Directive 1",
"path": "api/common/directive_1",
"docType": "directive",
"stability": "stable",
"securityRisk": true,
name: 'directive_1',
title: 'Directive 1',
path: 'api/common/directive_1',
docType: 'directive',
stability: 'stable',
securityRisk: true,
},
{
"name": "pipe_1",
"title": "Pipe 1",
"path": "api/common/pipe_1",
"docType": "pipe",
"stability": "stable",
"securityRisk": true,
name: 'pipe_1',
title: 'Pipe 1',
path: 'api/common/pipe_1',
docType: 'pipe',
stability: 'stable',
securityRisk: true,
},
]
],
},
{
"name": "core",
"title": "core",
"path": "api/core",
"deprecated": false,
"items": [
name: 'core',
title: 'core',
path: 'api/core',
deprecated: false,
items: [
{
"name": "class_3",
"title": "Class 3",
"path": "api/core/class_3",
"docType": "class",
"stability": "experimental",
"securityRisk": false,
name: 'class_3',
title: 'Class 3',
path: 'api/core/class_3',
docType: 'class',
stability: 'experimental',
securityRisk: false,
},
{
"name": "function_1",
"title": "Function 1",
"path": "api/core/function 1",
"docType": "function",
"stability": "deprecated",
"securityRisk": true,
name: 'function_1',
title: 'Function 1',
path: 'api/core/function 1',
docType: 'function',
stability: 'deprecated',
securityRisk: true,
},
{
"name": "const_1",
"title": "Const 1",
"path": "api/core/const_1",
"docType": "const",
"stability": "stable",
"securityRisk": false,
}
]
}
name: 'const_1',
title: 'Const 1',
path: 'api/core/const_1',
docType: 'const',
stability: 'stable',
securityRisk: false,
},
],
},
];

function getApiSections() { return apiSections; }
95 changes: 47 additions & 48 deletions aio/src/app/custom-elements/resource/resource.service.spec.ts
Expand Up @@ -86,62 +86,61 @@ describe('ResourceService', () => {
});

function getTestResources() {
// tslint:disable:quotemark
return {
"Cat 3": {
"order": 3,
"subCategories": {
"Cat3 SubCat1": {
"order": 2,
"resources": {
"Cat3 SubCat1 Res1": {
"desc": "Meetup in Barcelona, Spain. ",
"title": "Angular Beers",
"url": "http://www.meetup.com/AngularJS-Beers/"
'Cat 3': {
order: 3,
subCategories: {
'Cat3 SubCat1': {
order: 2,
resources: {
'Cat3 SubCat1 Res1': {
desc: 'Meetup in Barcelona, Spain. ',
title: 'Angular Beers',
url: 'http://www.meetup.com/AngularJS-Beers/',
},
"Cat3 SubCat1 Res2": {
"desc": "Angular Camps in Barcelona, Spain.",
"title": "Angular Camp",
"url": "http://angularcamp.org/"
}
}
'Cat3 SubCat1 Res2': {
desc: 'Angular Camps in Barcelona, Spain.',
title: 'Angular Camp',
url: 'http://angularcamp.org/',
},
},
},
"Cat3 SubCat2": {
"order": 1,
"resources": {
"Cat3 SubCat2 Res1": {
"desc": "A community index of components and libraries",
"title": "Catalog of Angular Components & Libraries",
"url": "https://a/b/c"
}
}
'Cat3 SubCat2': {
order: 1,
resources: {
'Cat3 SubCat2 Res1': {
desc: 'A community index of components and libraries',
title: 'Catalog of Angular Components & Libraries',
url: 'https://a/b/c',
},
},
},
}
},
},
"Cat 1": {
"order": 1,
"subCategories": {
"Cat1 SubCat1": {
"order": 1,
"resources": {
"S S S": {
"desc": "SSS",
"title": "Sssss",
"url": "http://s/s/s"
'Cat 1': {
order: 1,
subCategories: {
'Cat1 SubCat1': {
order: 1,
resources: {
'S S S': {
desc: 'SSS',
title: 'Sssss',
url: 'http://s/s/s',
},
"A A A": {
"desc": "AAA",
"title": "Aaaa",
"url": "http://a/a/a"
'A A A': {
desc: 'AAA',
title: 'Aaaa',
url: 'http://a/a/a',
},
"Z Z Z": {
"desc": "ZZZ",
"title": "Zzzzz",
"url": "http://z/z/z"
}
}
'Z Z Z': {
desc: 'ZZZ',
title: 'Zzzzz',
url: 'http://z/z/z',
},
},
},
},
}
},
};
}
5 changes: 4 additions & 1 deletion aio/tslint.json
Expand Up @@ -64,7 +64,10 @@
"no-redundant-jsdoc": true,
"no-switch-case-fall-through": true,
"no-var-requires": false,
"object-literal-key-quotes": false,
"object-literal-key-quotes": [
true,
"as-needed"
],
"only-arrow-functions": false,
"quotemark": [
true,
Expand Down

0 comments on commit 4f8b716

Please sign in to comment.