Skip to content

Commit 4b8128a

Browse files
committed
added test with fragment shorthand in function
1 parent 27193ec commit 4b8128a

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

tests/lib/rules/no-unused-styles.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ const tests = {
112112
});
113113
const Hello = React.createClass({
114114
getInitialState: function() {
115-
return { condition: true, condition2: true };
115+
return { condition: true, condition2: true };
116116
},
117117
render: function() {
118118
return (
@@ -135,7 +135,7 @@ const tests = {
135135
});
136136
const Hello = React.createClass({
137137
getInitialState: function() {
138-
return { condition: true };
138+
return { condition: true };
139139
},
140140
render: function() {
141141
return (
@@ -175,7 +175,7 @@ const tests = {
175175
code: `
176176
const Hello = React.createClass({
177177
getInitialState: function() {
178-
return { condition: true };
178+
return { condition: true };
179179
},
180180
render: function() {
181181
const myStyle = this.state.condition ? styles.text : styles.text2;
@@ -276,6 +276,16 @@ const tests = {
276276
errors: [{
277277
message: 'Unused style detected: styles.bar',
278278
}],
279+
}, {
280+
code: `
281+
const styles = StyleSheet.create({
282+
text: {}
283+
})
284+
const Hello = () => (<><Text style={styles.b}>Hello</Text></>);
285+
`,
286+
errors: [{
287+
message: 'Unused style detected: styles.text',
288+
}],
279289
}],
280290
};
281291

0 commit comments

Comments
 (0)