File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,11 @@ const rules = {
4646 create ( context ) {
4747 const { visitorKeys } = context . getSourceCode ( ) ;
4848
49+ const excludeComponentNames =
50+ context . options ?. [ 0 ] ?. excludeComponentNames ?. map (
51+ ( regex ) => new RegExp ( regex ) ,
52+ ) ?? [ / P r o v i d e r $ / ] ;
53+
4954 return {
5055 Program ( node ) {
5156 const componentNodes = node . body
@@ -82,7 +87,7 @@ const rules = {
8287 throw DONE_WITH_SUBTREE ;
8388 } else if (
8489 current . type === 'JSXElement' &&
85- [ / P r o v i d e r $ / ] . every (
90+ excludeComponentNames . every (
8691 ( regex ) =>
8792 ! regex . test (
8893 current . openingElement . name . property
@@ -132,7 +137,7 @@ const rules = {
132137 traverseTree ( componentNode , visitorKeys , ( current ) => {
133138 if (
134139 current . type === 'JSXElement' &&
135- [ / P r o v i d e r $ / ] . every (
140+ excludeComponentNames . every (
136141 ( regex ) =>
137142 ! regex . test (
138143 current . openingElement . name . property
You can’t perform that action at this time.
0 commit comments