ruleTester |
any |
const |
new RuleTester() |
✗ |
ANGLE_BRACKET_TESTS_EXCEPT_CONST_CASE |
"\nconst x = <Foo>new Generic<int>();\nconst x = <A>b;\nconst x = <readonly number[]>[1];\nconst x = <a | b>('string');\nconst x = <A>!'string';\nconst x = <A>a + b;\nconst x = <(A)>a + (b);\nconst x = <Foo>(new Generic<string>());\nconst x = new (<Foo>Generic<string>)();\nconst x = new (<Foo>Generic<string>)('strin... |
const |
`` |
|
const x = new Generic(); |
|
|
|
|
const x = b; |
|
|
|
|
const x = [1]; |
|
|
|
|
const x = <a |
b>('string'); |
|
|
|
const x = !'string'; |
|
|
|
|
const x = a + b; |
|
|
|
|
const x = <(A)>a + (b); |
|
|
|
|
const x = (new Generic()); |
|
|
|
|
const x = new (Generic)(); |
|
|
|
|
const x = new (Generic)('string'); |
|
|
|
|
const x = () => { bar: 5 }; |
|
|
|
|
const x = () => ({ bar: 5 }); |
|
|
|
|
const x = () => bar; |
|
|
|
|
const x = bar`\${"baz"}`;`` |
✗ |
|
|
|
ANGLE_BRACKET_TESTS |
"\nconst x = <Foo>new Generic<int>();\nconst x = <A>b;\nconst x = <readonly number[]>[1];\nconst x = <a | b>('string');\nconst x = <A>!'string';\nconst x = <A>a + b;\nconst x = <(A)>a + (b);\nconst x = <Foo>(new Generic<string>());\nconst x = new (<Foo>Generic<string>)();\nconst x = new (<Foo>Generic<string>)('strin... |
const |
``${ANGLE_BRACKET_TESTS_EXCEPT_CONST_CASE} |
|
const x = { key: 'value' }; |
|
|
|
|
`` |
✗ |
|
|
|
AS_TESTS_EXCEPT_CONST_CASE |
"\nconst x = new Generic<int>() as Foo;\nconst x = b as A;\nconst x = [1] as readonly number[];\nconst x = 'string' as a | b;\nconst x = !'string' as A;\nconst x = (a as A) + b;\nconst x = (a as A) + (b);\nconst x = new Generic<string>() as Foo;\nconst x = new ((Generic<string>) as Foo)();\nconst x = new ((Generic<s... |
const |
`` |
|
const x = new Generic() as Foo; |
|
|
|
|
const x = b as A; |
|
|
|
|
const x = [1] as readonly number[]; |
|
|
|
|
const x = 'string' as a |
b; |
|
|
|
const x = !'string' as A; |
|
|
|
|
const x = (a as A) + b; |
|
|
|
|
const x = (a as A) + (b); |
|
|
|
|
const x = new Generic() as Foo; |
|
|
|
|
const x = new ((Generic) as Foo)(); |
|
|
|
|
const x = new ((Generic) as Foo)('string'); |
|
|
|
|
const x = () => ({ bar: 5 } as Foo); |
|
|
|
|
const x = () => ({ bar: 5 } as Foo); |
|
|
|
|
const x = () => (bar as Foo); |
|
|
|
|
const x = bar`\${"baz"}` as Foo;`` |
✗ |
|
|
|
AS_TESTS |
"\nconst x = new Generic<int>() as Foo;\nconst x = b as A;\nconst x = [1] as readonly number[];\nconst x = 'string' as a | b;\nconst x = !'string' as A;\nconst x = (a as A) + b;\nconst x = (a as A) + (b);\nconst x = new Generic<string>() as Foo;\nconst x = new ((Generic<string>) as Foo)();\nconst x = new ((Generic<s... |
const |
``${AS_TESTS_EXCEPT_CONST_CASE} |
|
const x = { key: 'value' } as const; |
|
|
|
|
`` |
✗ |
|
|
|
OBJECT_LITERAL_AS_CASTS |
"\nconst x = {} as Foo<int>;\nconst x = ({}) as a | b;\nconst x = {} as A + b;\n" |
const |
`` |
|
const x = {} as Foo; |
|
|
|
|
const x = ({}) as a |
b; |
|
|
|
const x = {} as A + b; |
|
|
|
|
`` |
✗ |
|
|
|
OBJECT_LITERAL_ANGLE_BRACKET_CASTS |
"\nconst x = <Foo<int>>{};\nconst x = <a | b>({});\nconst x = <A>{} + b;\n" |
const |
`` |
|
const x = >{}; |
|
|
|
|
const x = <a |
b>({}); |
|
|
|
const x = {} + b; |
|
|
|
|
`` |
✗ |
|
|
|
OBJECT_LITERAL_ARGUMENT_AS_CASTS |
"\nprint({ bar: 5 } as Foo)\nnew print({ bar: 5 } as Foo)\nfunction foo() { throw { bar: 5 } as Foo }\nfunction b(x = {} as Foo.Bar) {}\nfunction c(x = {} as Foo) {}\nprint?.({ bar: 5 } as Foo)\nprint?.call({ bar: 5 } as Foo)\nprint ${{ bar: 5 } as Foo}\n" |
const |
`` |
|
print({ bar: 5 } as Foo) |
|
|
|
|
new print({ bar: 5 } as Foo) |
|
|
|
|
function foo() { throw { bar: 5 } as Foo } |
|
|
|
|
function b(x = {} as Foo.Bar) {} |
|
|
|
|
function c(x = {} as Foo) {} |
|
|
|
|
print?.({ bar: 5 } as Foo) |
|
|
|
|
print?.call({ bar: 5 } as Foo) |
|
|
|
|
print`\${{ bar: 5 } as Foo}` |
|
|
|
|
`` |
✗ |
|
|
|
OBJECT_LITERAL_ARGUMENT_ANGLE_BRACKET_CASTS |
"\nprint(<Foo>{ bar: 5 })\nnew print(<Foo>{ bar: 5 })\nfunction foo() { throw <Foo>{ bar: 5 } }\nprint?.(<Foo>{ bar: 5 })\nprint?.call(<Foo>{ bar: 5 })\nprint ${{ bar: 5 }}\n" |
const |
`` |
|
print({ bar: 5 }) |
|
|
|
|
new print({ bar: 5 }) |
|
|
|
|
function foo() { throw { bar: 5 } } |
|
|
|
|
print?.({ bar: 5 }) |
|
|
|
|
print?.call({ bar: 5 }) |
|
|
|
|
print`\${{ bar: 5 }}` |
|
|
|
|
`` |
✗ |
|
|
|