From 786868070ff0f20dd81454ed8059e66a54a03c3c Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 8 Jan 2024 13:09:23 -0500 Subject: [PATCH] chore: fix test formatting in prefer-readonly.test.ts --- .../tests/rules/prefer-readonly.test.ts | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/eslint-plugin/tests/rules/prefer-readonly.test.ts b/packages/eslint-plugin/tests/rules/prefer-readonly.test.ts index a8d170c4a7d0..39262c6fbb4e 100644 --- a/packages/eslint-plugin/tests/rules/prefer-readonly.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-readonly.test.ts @@ -654,7 +654,7 @@ class Foo { ` class TestIntersection { private prop: number = 3; - + test() { const that = {} as this & { _foo: 'bar' }; that.prop = 1; @@ -664,7 +664,7 @@ class Foo { ` class TestUnion { private prop: number = 3; - + test() { const that = {} as this | (this & { _foo: 'bar' }); that.prop = 1; @@ -674,7 +674,7 @@ class Foo { ` class TestStaticIntersection { private static prop: number; - + test() { const that = {} as typeof TestStaticIntersection & { _foo: 'bar' }; that.prop = 1; @@ -684,7 +684,7 @@ class Foo { ` class TestStaticUnion { private static prop: number = 1; - + test() { const that = {} as | typeof TestStaticUnion @@ -697,7 +697,7 @@ class Foo { class TestBothIntersection { private prop1: number = 1; private static prop2: number; - + test() { const that = {} as typeof TestBothIntersection & this; that.prop1 = 1; @@ -709,7 +709,7 @@ class Foo { class TestBothIntersection { private prop1: number = 1; private static prop2: number; - + test() { const that = {} as this & typeof TestBothIntersection; that.prop1 = 1; @@ -2048,7 +2048,7 @@ function ClassWithName {}>(Base: TBase) { code: ` class Test { private prop: number = 3; - + test() { const that = {} as this & { _foo: 'bar' }; that._foo = 1; @@ -2057,11 +2057,11 @@ function ClassWithName {}>(Base: TBase) { `, output: ` class Test { - private readonly prop: number = 3 + private readonly prop: number = 3; test() { - const that = {} as this & {_foo: 'bar'} - that._foo = 1 + const that = {} as this & { _foo: 'bar' }; + that._foo = 1; } } `, @@ -2079,7 +2079,7 @@ function ClassWithName {}>(Base: TBase) { code: ` class Test { private prop: number = 3; - + test() { const that = {} as this | (this & { _foo: 'bar' }); that.prop; @@ -2088,11 +2088,11 @@ function ClassWithName {}>(Base: TBase) { `, output: ` class Test { - private readonly prop: number = 3 + private readonly prop: number = 3; test() { - const that = {} as this | (this & {_foo: 'bar'}) - that.prop + const that = {} as this | (this & { _foo: 'bar' }); + that.prop; } } `, @@ -2110,7 +2110,7 @@ function ClassWithName {}>(Base: TBase) { code: ` class Test { private prop: number; - + constructor() { const that = {} as this & { _foo: 'bar' }; that.prop = 1; @@ -2119,11 +2119,11 @@ function ClassWithName {}>(Base: TBase) { `, output: ` class Test { - private readonly prop: number + private readonly prop: number; constructor() { - const that = {} as this & {_foo: 'bar'} - that.prop = 1 + const that = {} as this & { _foo: 'bar' }; + that.prop = 1; } } `,