Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 468 Bytes

no-object-literal-type-assertion.md

File metadata and controls

31 lines (23 loc) · 468 Bytes
sidebarDepth categories tags
0
TypeScript
TSLint
TypeScript

no-object-literal-type-assertion

禁止对对象字面量进行类型断言(断言为 any 是允许的)

const x = { a: 1, b: 2 } as T;
const x: T = { a: 1, b: 2 };
const y = { a: 1, b: 2 } as any;