Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(eslint-plugin): [explicit-module-boundary-types] ignore all bodyless setters #2413

Merged
merged 4 commits into from Aug 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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);
}
vansergen marked this conversation as resolved.
Show resolved Hide resolved
`,
],
Expand Down