Skip to content

Commit

Permalink
add testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
yeonjuan committed Feb 13, 2024
1 parent 142045d commit 4d353a2
Showing 1 changed file with 41 additions and 0 deletions.
Expand Up @@ -733,6 +733,47 @@ class A {
}
})();
}
}
`,
},
],
},
],
},
{
code: `
class A {
private readonly ['foo']: string = 'bar';
constructor(foo: string) {
this.b = new (class {
private readonly foo: string = 'baz';
constructor() {
this['foo'] = 'qux';
}
})();
}
}
`,
options: ['getters'],
errors: [
{
messageId: 'preferGetterStyle',
column: 21,
line: 3,
suggestions: [
{
messageId: 'preferGetterStyleSuggestion',
output: `
class A {
private get ['foo']() { return 'bar'; }
constructor(foo: string) {
this.b = new (class {
private readonly foo: string = 'baz';
constructor() {
this['foo'] = 'qux';
}
})();
}
}
`,
},
Expand Down

0 comments on commit 4d353a2

Please sign in to comment.