File tree 1 file changed +36
-8
lines changed
1 file changed +36
-8
lines changed Original file line number Diff line number Diff line change 3
3
const url = require ( '../url' )
4
4
5
5
const forbidden = new Set ( [
6
- 'SegmentedControl' ,
7
6
// 'ActionList',
8
7
// 'ActionList.Divider',
9
8
// 'ActionList.Group',
10
9
// 'ActionList.Item',
11
10
// 'ActionList.LeadingVisual',
12
11
// 'ActionList.LinkItem',
13
12
13
+ // 'ActionMenu.Button',
14
+ // 'ActionMenu.Overlay',
15
+
16
+ // 'Avatar',
17
+ // 'AvatarStack',
18
+
19
+ // 'BorderBox',
20
+ // 'Box',
21
+
22
+ // 'BranchName',
23
+
24
+ // 'Breadcrumbs',
25
+ // 'Breadcrumbs.Item',
26
+
27
+ 'SegmentedControl' ,
28
+ 'SegmentedControl.Button' ,
29
+
30
+ 'SplitPageLayout.Pane' ,
31
+
14
32
// 'UnderlineNav',
15
33
// 'UnderlineNav.Item',
16
34
] )
@@ -36,14 +54,24 @@ module.exports = {
36
54
create ( context ) {
37
55
return {
38
56
JSXOpeningElement ( node ) {
39
- if ( ! forbidden . has ( node . name . name ) ) {
40
- return
57
+ if ( node . name . type === 'JSXMemberExpression' ) {
58
+ if ( node . name . object . type === 'JSXIdentifier' && node . name . property . type === 'JSXIdentifier' ) {
59
+ const name = `${ node . name . object . name } .${ node . name . property . name } `
60
+ if ( forbidden . has ( name ) ) {
61
+ context . report ( {
62
+ node,
63
+ messageId : 'sxProp' ,
64
+ } )
65
+ }
66
+ }
67
+ } else if ( node . name . type === 'JSXIdentifier' ) {
68
+ if ( forbidden . has ( node . name . name ) ) {
69
+ context . report ( {
70
+ node,
71
+ messageId : 'sxProp' ,
72
+ } )
73
+ }
41
74
}
42
-
43
- context . report ( {
44
- node,
45
- messageId : 'sxProp' ,
46
- } )
47
75
} ,
48
76
}
49
77
} ,
You can’t perform that action at this time.
0 commit comments