Skip to content

Commit

Permalink
fix(eslint-plugin): [explicit-module-boundary-types] ignore abstract …
Browse files Browse the repository at this point in the history
…setters (#2410)
  • Loading branch information
a-tarasyuk committed Aug 20, 2020
1 parent b62331a commit 3764248
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Expand Up @@ -427,7 +427,10 @@ export default util.createRule<Options, MessageIds>({
const isConstructor =
node.parent?.type === AST_NODE_TYPES.MethodDefinition &&
node.parent.kind === 'constructor';
if (!isConstructor && !node.returnType) {
const isAbstractSetAccessor =
node.parent?.type === AST_NODE_TYPES.TSAbstractMethodDefinition &&
node.parent.kind === 'set';
if (!isConstructor && !isAbstractSetAccessor && !node.returnType) {
context.report({
node,
messageId: 'missingReturnType',
Expand Down
Expand Up @@ -646,6 +646,11 @@ type Buz = () => (n: number) => string;
export const buz: Buz = () => n => String(n);
`,
`
export abstract class Foo<T> {
abstract set value(element: T);
}
`,
],
invalid: [
{
Expand Down

0 comments on commit 3764248

Please sign in to comment.