[go: nahoru, domu]

Skip to content

Commit

Permalink
chore: fix test formatting in prefer-readonly.test.ts (#8223)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Jan 8, 2024
1 parent c61c3ee commit 78db0ad
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions packages/eslint-plugin/tests/rules/prefer-readonly.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ class Foo {
`
class TestIntersection {
private prop: number = 3;
test() {
const that = {} as this & { _foo: 'bar' };
that.prop = 1;
Expand All @@ -664,7 +664,7 @@ class Foo {
`
class TestUnion {
private prop: number = 3;
test() {
const that = {} as this | (this & { _foo: 'bar' });
that.prop = 1;
Expand All @@ -674,7 +674,7 @@ class Foo {
`
class TestStaticIntersection {
private static prop: number;
test() {
const that = {} as typeof TestStaticIntersection & { _foo: 'bar' };
that.prop = 1;
Expand All @@ -684,7 +684,7 @@ class Foo {
`
class TestStaticUnion {
private static prop: number = 1;
test() {
const that = {} as
| typeof TestStaticUnion
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -2048,7 +2048,7 @@ function ClassWithName<TBase extends new (...args: any[]) => {}>(Base: TBase) {
code: `
class Test {
private prop: number = 3;
test() {
const that = {} as this & { _foo: 'bar' };
that._foo = 1;
Expand All @@ -2057,11 +2057,11 @@ function ClassWithName<TBase extends new (...args: any[]) => {}>(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;
}
}
`,
Expand All @@ -2079,7 +2079,7 @@ function ClassWithName<TBase extends new (...args: any[]) => {}>(Base: TBase) {
code: `
class Test {
private prop: number = 3;
test() {
const that = {} as this | (this & { _foo: 'bar' });
that.prop;
Expand All @@ -2088,11 +2088,11 @@ function ClassWithName<TBase extends new (...args: any[]) => {}>(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;
}
}
`,
Expand All @@ -2110,7 +2110,7 @@ function ClassWithName<TBase extends new (...args: any[]) => {}>(Base: TBase) {
code: `
class Test {
private prop: number;
constructor() {
const that = {} as this & { _foo: 'bar' };
that.prop = 1;
Expand All @@ -2119,11 +2119,11 @@ function ClassWithName<TBase extends new (...args: any[]) => {}>(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;
}
}
`,
Expand Down

0 comments on commit 78db0ad

Please sign in to comment.