@@ -39,6 +39,11 @@ module.exports = {
3939 eventHandlerPropPrefix : { type : 'string' } ,
4040 checkLocalVariables : { type : 'boolean' } ,
4141 checkInlineFunction : { type : 'boolean' } ,
42+ ignoreComponentNames : {
43+ type : 'array' ,
44+ uniqueItems : true ,
45+ items : { type : 'string' } ,
46+ } ,
4247 } ,
4348 additionalProperties : false ,
4449 } , {
@@ -51,6 +56,11 @@ module.exports = {
5156 } ,
5257 checkLocalVariables : { type : 'boolean' } ,
5358 checkInlineFunction : { type : 'boolean' } ,
59+ ignoreComponentNames : {
60+ type : 'array' ,
61+ uniqueItems : true ,
62+ items : { type : 'string' } ,
63+ } ,
5464 } ,
5565 additionalProperties : false ,
5666 } , {
@@ -63,6 +73,11 @@ module.exports = {
6373 eventHandlerPropPrefix : { type : 'string' } ,
6474 checkLocalVariables : { type : 'boolean' } ,
6575 checkInlineFunction : { type : 'boolean' } ,
76+ ignoreComponentNames : {
77+ type : 'array' ,
78+ uniqueItems : true ,
79+ items : { type : 'string' } ,
80+ } ,
6681 } ,
6782 additionalProperties : false ,
6883 } , {
@@ -78,6 +93,16 @@ module.exports = {
7893 } ,
7994 additionalProperties : false ,
8095 } ,
96+ {
97+ type : 'object' ,
98+ properties : {
99+ ignoreComponentNames : {
100+ type : 'array' ,
101+ uniqueItems : true ,
102+ items : { type : 'string' } ,
103+ } ,
104+ } ,
105+ } ,
81106 ] ,
82107 } ] ,
83108 } ,
@@ -111,8 +136,17 @@ module.exports = {
111136
112137 const checkInlineFunction = ! ! configuration . checkInlineFunction ;
113138
139+ const ignoreComponentNames = configuration . ignoreComponentNames || [ ] ;
140+
114141 return {
115142 JSXAttribute ( node ) {
143+ const componentName = node . parent . name . name ;
144+
145+ const isComponentNameIgnored = ignoreComponentNames . some ( ( ignoredComponentNameRegex ) => {
146+ const isIgnored = new RegExp ( ignoredComponentNameRegex ) . test ( componentName ) ;
147+ return isIgnored ;
148+ } ) ;
149+
116150 if (
117151 ! node . value
118152 || ! node . value . expression
@@ -124,6 +158,7 @@ module.exports = {
124158 : ! node . value . expression . object
125159 )
126160 )
161+ || isComponentNameIgnored
127162 ) {
128163 return ;
129164 }
0 commit comments