File tree Expand file tree Collapse file tree 1 file changed +17
-16
lines changed Expand file tree Collapse file tree 1 file changed +17
-16
lines changed Original file line number Diff line number Diff line change @@ -48,28 +48,29 @@ module.exports = {
48
48
const hasDestructure = utils . isUsingPropsDestructure ( node )
49
49
const hasWithDefaults = utils . hasWithDefaults ( node )
50
50
51
- if ( destructurePreference === 'always' ) {
52
- if ( ! hasDestructure ) {
53
- context . report ( {
54
- node,
55
- messageId : 'preferDestructuring'
56
- } )
57
- return
58
- }
59
-
60
- if ( hasWithDefaults ) {
61
- context . report ( {
62
- node : node . parent . callee ,
63
- messageId : 'avoidWithDefaults'
64
- } )
65
- }
66
- } else {
51
+ if ( destructurePreference === 'never' ) {
67
52
if ( hasDestructure ) {
68
53
context . report ( {
69
54
node,
70
55
messageId : 'avoidDestructuring'
71
56
} )
72
57
}
58
+ return
59
+ }
60
+
61
+ if ( ! hasDestructure ) {
62
+ context . report ( {
63
+ node,
64
+ messageId : 'preferDestructuring'
65
+ } )
66
+ return
67
+ }
68
+
69
+ if ( hasWithDefaults ) {
70
+ context . report ( {
71
+ node : node . parent . callee ,
72
+ messageId : 'avoidWithDefaults'
73
+ } )
73
74
}
74
75
}
75
76
} )
You can’t perform that action at this time.
0 commit comments