Skip to content

Commit 4d45b33

Browse files
authored
fix(eslint-plugin): [embt] ignore JSX callbacks (typescript-eslint#1630)
1 parent e23e4b9 commit 4d45b33

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ export default util.createRule<Options, MessageIds>({
7979
return false;
8080
}
8181

82+
if (node.type === AST_NODE_TYPES.JSXExpressionContainer) {
83+
return true;
84+
}
85+
8286
if (node.type === AST_NODE_TYPES.ReturnStatement) {
8387
isReturnedValue = true;
8488
}

packages/eslint-plugin/tests/rules/explicit-module-boundary-types.test.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,35 @@ export class Test {
312312
},
313313
],
314314
},
315+
{
316+
code: `
317+
export const Foo: FC = () => (
318+
<div
319+
a={e => {}}
320+
b={function (e) {}}
321+
c={function foo(e) {}}
322+
>
323+
</div>
324+
)
325+
`,
326+
parserOptions: {
327+
ecmaFeatures: { jsx: true },
328+
},
329+
},
330+
{
331+
code: `
332+
export const Foo: JSX.Element =
333+
<div
334+
a={e => {}}
335+
b={function (e) {}}
336+
c={function foo(e) {}}
337+
>
338+
</div>
339+
`,
340+
parserOptions: {
341+
ecmaFeatures: { jsx: true },
342+
},
343+
},
315344
],
316345
invalid: [
317346
{

0 commit comments

Comments
 (0)
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