File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ function create(context) {
50
50
const hasOnlyLineBreak = ( value ) => / ^ [ \r \n \t \f \v ] + $ / . test ( value . replace ( / / g, '' ) ) ;
51
51
52
52
const scope = context . getScope ( ) ;
53
- const getValidation = ( node ) => ! allowedElements . includes ( elementName ( node . parent , scope ) ) ;
53
+ const getValidation = ( node ) => ! allowedElements . some ( ( el ) => new RegExp ( `^ ${ el } $` ) . test ( elementName ( node . parent , scope ) ) ) ;
54
54
55
55
return {
56
56
Literal ( node ) {
Original file line number Diff line number Diff line change @@ -105,6 +105,14 @@ const tests = {
105
105
` ,
106
106
options : [ { skip : [ 'Title.Text' ] } ] ,
107
107
} ,
108
+ {
109
+ code : `
110
+ const Title = ({ children }) => (<Title.Text>{children}</Title.Text>);
111
+ Title.Text = ({ children }) => (<Text>{children}</Text>);
112
+ <Title.Text>This is the title</Title.Text>
113
+ ` ,
114
+ options : [ { skip : [ 'Title.*' ] } ] ,
115
+ } ,
108
116
{
109
117
code : `
110
118
export default class MyComponent extends Component {
You can’t perform that action at this time.
0 commit comments