File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,10 @@ const valid = [
2929 name : "Direct export AF component with number" ,
3030 code : "export const Foo2 = () => {};" ,
3131 } ,
32+ {
33+ name : "Direct export AF component with underscore" ,
34+ code : "export const Foo_ = () => {};" ,
35+ } ,
3236 {
3337 name : "Direct export uppercase function" ,
3438 code : "export function CMS() {};" ,
@@ -226,6 +230,11 @@ const invalid = [
226230 code : "export const foo = () => {}; export const Bar = () => {};" ,
227231 errorId : "namedExport" ,
228232 } ,
233+ {
234+ name : "Component and underscored component" ,
235+ code : "export const _Foo = () => {}; export const Foo = () => {};" ,
236+ errorId : "namedExport" ,
237+ } ,
229238 {
230239 name : "Component and function with allowConstantExport" ,
231240 code : "export const foo = () => {}; export const Bar = () => {};" ,
Original file line number Diff line number Diff line change 11import type { TSESLint } from "@typescript-eslint/utils" ;
22import type { TSESTree } from "@typescript-eslint/types" ;
33
4- const reactComponentNameRE = / ^ [ A - Z ] [ a - z A - Z 0 - 9 ] * $ / u;
4+ const reactComponentNameRE = / ^ [ A - Z ] [ a - z A - Z 0 - 9 _ ] * $ / u;
55
66export const onlyExportComponents : TSESLint . RuleModule <
77 | "exportAll"
You can’t perform that action at this time.
0 commit comments