Skip to content

Commit

Permalink
fix(eslint-plugin): [lines-between-class-members] fix `exceptAfterOve…
Browse files Browse the repository at this point in the history
…rload` for abstract methods (#3943)
  • Loading branch information
ixth committed Oct 3, 2021
1 parent 40760f9 commit 240fc65
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Expand Up @@ -51,7 +51,8 @@ export default util.createRule<Options, MessageIds>({

function isOverload(node: TSESTree.Node): boolean {
return (
node.type === AST_NODE_TYPES.MethodDefinition &&
(node.type === AST_NODE_TYPES.TSAbstractMethodDefinition ||
node.type === AST_NODE_TYPES.MethodDefinition) &&
node.value.type === AST_NODE_TYPES.TSEmptyBodyFunctionExpression
);
}
Expand Down
Expand Up @@ -120,6 +120,15 @@ qux() { }
{ exceptAfterOverload: true, exceptAfterSingleLine: true },
],
},
{
code: `
abstract class foo {
abstract bar(a: string): void;
abstract bar(a: string, b: string): void;
};
`,
options: ['always'],
},
],
invalid: [
{
Expand Down

0 comments on commit 240fc65

Please sign in to comment.