Skip to content

Commit c9cf039

Browse files
authored
Merge pull request #2135 from StoDevX/forbid-unnecessary-curly-brackets-in-jsx-attrs
Forbid unnecessary curly brackets in jsx attrs
2 parents 706c2c1 + e1378b6 commit c9cf039

File tree

5 files changed

+13
-16
lines changed

5 files changed

+13
-16
lines changed

.eslintrc.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ rules:
7171

7272
# react rules – https://github.com/yannickcr/eslint-plugin-react
7373
react/display-name: off
74+
react/jsx-curly-brace-presence: [warn, never]
7475
react/jsx-key: warn
7576
react/jsx-no-bind:
7677
- warn
@@ -89,11 +90,11 @@ rules:
8990
react/sort-comp:
9091
- warn
9192
- order:
92-
- static-methods
93-
- type-annotations
94-
- lifecycle
95-
- everything-else
96-
- render
93+
- static-methods
94+
- type-annotations
95+
- lifecycle
96+
- everything-else
97+
- render
9798
react/sort-prop-types: warn
9899
react/wrap-multilines: off
99100
react/jsx-boolean-value: [error, always]

source/views/menus/menu-github.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export class GitHubHostedMenu extends React.PureComponent<Props, State> {
111111
}
112112

113113
if (this.state.error) {
114-
return <NoticeView text={'Error: ' + this.state.error.message} />
114+
return <NoticeView text={`Error: ${this.state.error.message}`} />
115115
}
116116

117117
return (

source/views/sis/student-work/detail.ios.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function Information({job}: {job: JobType}) {
3838
<Cell
3939
accessory="DisclosureIndicator"
4040
cellStyle="LeftDetail"
41-
detail={'Contact'}
41+
detail="Contact"
4242
onPress={() => email([job.contactEmail], null, null, job.title, '')}
4343
title={getContactName(job).trim() || job.contactEmail}
4444
/>
@@ -48,21 +48,17 @@ function Information({job}: {job: JobType}) {
4848
const hours = job.hoursPerWeek ? (
4949
<Cell
5050
cellStyle="LeftDetail"
51-
detail={'Hours'}
51+
detail="Hours"
5252
title={job.hoursPerWeek + ending}
5353
/>
5454
) : null
5555

5656
const amount = job.timeOfHours ? (
57-
<Cell
58-
cellStyle="LeftDetail"
59-
detail={'Time of Day'}
60-
title={job.timeOfHours}
61-
/>
57+
<Cell cellStyle="LeftDetail" detail="Time of Day" title={job.timeOfHours} />
6258
) : null
6359

6460
const category = job.type ? (
65-
<Cell cellStyle="LeftDetail" detail={'Category'} title={job.type} />
61+
<Cell cellStyle="LeftDetail" detail="Category" title={job.type} />
6662
) : null
6763

6864
return (

source/views/streaming/streams/list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export class StreamListView extends React.PureComponent<Props, State> {
132132
}
133133

134134
if (this.state.error) {
135-
return <NoticeView text={'Error: ' + this.state.error} />
135+
return <NoticeView text={`Error: ${this.state.error}`} />
136136
}
137137

138138
return (

source/views/transportation/other-modes/detail.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class OtherModesDetailView extends React.PureComponent<Props> {
5656
styles={{Paragraph: styles.paragraph}}
5757
/>
5858

59-
<Button onPress={this.onPress} title={'More Info'} />
59+
<Button onPress={this.onPress} title="More Info" />
6060

6161
<ListFooter
6262
href={GH_NEW_ISSUE_URL}

0 commit comments

Comments
 (0)