style: enforce disallowance of object constructor (#33211)

Applying the `prefer-literal` tslint rule to object enforces the style guide rule https://google.github.io/styleguide/jsguide.html#features-objects-ctor

PR Close #33211
This commit is contained in:
Danny Skoog
2019-10-17 02:46:50 +02:00
committed by Miško Hevery
parent 354f66b904
commit db4789bf91
12 changed files with 26 additions and 22 deletions

View File

@ -40,7 +40,7 @@ import {compViewDef, createAndGetRootNodes} from './helper';
});
it('should add debug information to the renderer', () => {
const someContext = new Object();
const someContext = {};
const {view, rootNodes} = createAndGetRootNodes(
compViewDef([anchorDef(NodeFlags.None, null, null, 0)]), someContext);
expect(getDebugNode(rootNodes[0]) !.nativeNode).toBe(asElementData(view, 0).renderElement);

View File

@ -62,7 +62,7 @@ const removeEventListener = 'removeEventListener';
});
it('should add debug information to the renderer', () => {
const someContext = new Object();
const someContext = {};
const {view, rootNodes} = createAndGetRootNodes(
compViewDef([elementDef(0, NodeFlags.None, null, null, 0, 'div')]), someContext);
expect(getDebugNode(rootNodes[0]) !.nativeNode).toBe(asElementData(view, 0).renderElement);

View File

@ -16,8 +16,8 @@ import {compViewDef, compViewDefFactory, createAndGetRootNodes, createEmbeddedVi
describe(`Embedded Views`, () => {
it('should create embedded views with the right context', () => {
const parentContext = new Object();
const childContext = new Object();
const parentContext = {};
const childContext = {};
const {view: parentView} = createAndGetRootNodes(
compViewDef([

View File

@ -41,7 +41,7 @@ import {ARG_TYPE_VALUES, checkNodeInlineOrDynamic, compViewDef, createAndGetRoot
});
it('should add debug information to the renderer', () => {
const someContext = new Object();
const someContext = {};
const {view, rootNodes} =
createAndGetRootNodes(compViewDef([textDef(0, null, ['a'])]), someContext);
expect(getDebugNode(rootNodes[0]) !.nativeNode).toBe(asTextData(view, 0).renderText);