Skip to content

Commit

Permalink
fix(eslint-plugin): [explicit-module-boundary-types] ignore all bodyl…
Browse files Browse the repository at this point in the history
…ess setters (#2413)
  • Loading branch information
vansergen committed Aug 21, 2020
1 parent d468cfe commit a53f8c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Expand Up @@ -427,10 +427,11 @@ export default util.createRule<Options, MessageIds>({
const isConstructor =
node.parent?.type === AST_NODE_TYPES.MethodDefinition &&
node.parent.kind === 'constructor';
const isAbstractSetAccessor =
node.parent?.type === AST_NODE_TYPES.TSAbstractMethodDefinition &&
const isSetAccessor =
(node.parent?.type === AST_NODE_TYPES.TSAbstractMethodDefinition ||
node.parent?.type === AST_NODE_TYPES.MethodDefinition) &&
node.parent.kind === 'set';
if (!isConstructor && !isAbstractSetAccessor && !node.returnType) {
if (!isConstructor && !isSetAccessor && !node.returnType) {
context.report({
node,
messageId: 'missingReturnType',
Expand Down
Expand Up @@ -649,6 +649,11 @@ export const buz: Buz = () => n => String(n);
`
export abstract class Foo<T> {
abstract set value(element: T);
}
`,
`
export declare class Foo {
set time(seconds: number);
}
`,
],
Expand Down

0 comments on commit a53f8c6

Please sign in to comment.