Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4d45b33

Browse files
authored
fix(eslint-plugin): [embt] ignore JSX callbacks (typescript-eslint#1630)
1 parente23e4b9 commit4d45b33

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
returnfalse;
8080
}
8181

82+
if(node.type===AST_NODE_TYPES.JSXExpressionContainer){
83+
returntrue;
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)

[8]ページ先頭

©2009-2025 Movatter.jp