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): [explicit-module-boundary-types] checkaccessor class properties with a function initializer#10804

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@@ -270,7 +270,8 @@ export default createRule<Options, MessageIds>({
node.type === AST_NODE_TYPES.MethodDefinition ||
node.type === AST_NODE_TYPES.TSAbstractMethodDefinition ||
(node.type === AST_NODE_TYPES.Property && node.method) ||
node.type === AST_NODE_TYPES.PropertyDefinition
node.type === AST_NODE_TYPES.PropertyDefinition ||
node.type === AST_NODE_TYPES.AccessorProperty
) {
return isStaticMemberAccessOfValue(
node,
Expand DownExpand Up@@ -369,6 +370,7 @@ export default createRule<Options, MessageIds>({
return;

case AST_NODE_TYPES.PropertyDefinition:
case AST_NODE_TYPES.AccessorProperty:
case AST_NODE_TYPES.MethodDefinition:
case AST_NODE_TYPES.TSAbstractMethodDefinition:
if (
Expand Down
1 change: 1 addition & 0 deletionspackages/eslint-plugin/src/util/misc.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -239,6 +239,7 @@ export function isParenlessArrowFunction(
}

export type NodeWithKey =
| TSESTree.AccessorProperty
| TSESTree.MemberExpression
| TSESTree.MethodDefinition
| TSESTree.Property
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -601,6 +601,15 @@ export default { Foo };
},
{
code: `
export class Foo {
accessor bar = (): void => {
return;
};
}
`,
},
{
code: `
export function foo(): (n: number) => string {
return n => String(n);
}
Expand DownExpand Up@@ -1670,6 +1679,52 @@ class Foo {
return arg;
};
}
export default Foo;
`,
errors: [
{
line: 3,
messageId: 'missingReturnType',
},
{
data: {
name: 'arg',
},
line: 3,
messageId: 'missingArgType',
},
],
},
{
code: `
class Foo {
accessor bool = arg => {
return arg;
};
}
export default Foo;
`,
errors: [
{
data: {
name: 'arg',
},
line: 3,
messageId: 'missingArgType',
},
{
line: 3,
messageId: 'missingReturnType',
},
],
},
{
code: `
class Foo {
accessor bool = function (arg) {
return arg;
};
}
export default Foo;
`,
errors: [
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp