diff --git a/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts b/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts index f003977d8fb9..55c6bd29f99e 100644 --- a/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts +++ b/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts @@ -79,6 +79,10 @@ export default util.createRule({ return false; } + if (node.type === AST_NODE_TYPES.JSXExpressionContainer) { + return true; + } + if (node.type === AST_NODE_TYPES.ReturnStatement) { isReturnedValue = true; } diff --git a/packages/eslint-plugin/tests/rules/explicit-module-boundary-types.test.ts b/packages/eslint-plugin/tests/rules/explicit-module-boundary-types.test.ts index 20a9f14a57e8..388adb994315 100644 --- a/packages/eslint-plugin/tests/rules/explicit-module-boundary-types.test.ts +++ b/packages/eslint-plugin/tests/rules/explicit-module-boundary-types.test.ts @@ -312,6 +312,35 @@ export class Test { }, ], }, + { + code: ` +export const Foo: FC = () => ( +
{}} + b={function (e) {}} + c={function foo(e) {}} + > +
+) + `, + parserOptions: { + ecmaFeatures: { jsx: true }, + }, + }, + { + code: ` +export const Foo: JSX.Element = +
{}} + b={function (e) {}} + c={function foo(e) {}} + > +
+ `, + parserOptions: { + ecmaFeatures: { jsx: true }, + }, + }, ], invalid: [ { pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy