Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(eslint-plugin): [class-literal-property-style] don't report nodes withoverride keyword#10135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -145,6 +145,7 @@ export default createRule<Options, MessageIds>({
MethodDefinition(node): void {
if (
node.kind !== 'get' ||
node.override ||
!node.value.body ||
node.value.body.body.length === 0
) {
Expand DownExpand Up@@ -222,7 +223,7 @@ export default createRule<Options, MessageIds>({
}
},
PropertyDefinition(node): void {
if (!node.readonly || node.declare) {
if (!node.readonly || node.declare || node.override) {
return;
}
const { properties } =
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -257,6 +257,35 @@ class Mx {
`,
options: ['getters'],
},
{
// https://github.com/typescript-eslint/typescript-eslint/issues/3602
// getter with override modifier should be ignored
code: `
declare abstract class BaseClass {
get cursor(): string;
}

class ChildClass extends BaseClass {
override get cursor() {
return 'overridden value';
}
}
`,
},
{
// https://github.com/typescript-eslint/typescript-eslint/issues/3602
// property with override modifier should be ignored
code: `
declare abstract class BaseClass {
protected readonly foo: string;
}

class ChildClass extends BaseClass {
protected override readonly foo = 'bar';
}
`,
options: ['getters'],
},
],
invalid: [
{
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp