Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

Commit b9e746c

Browse files
committed
Enable eslint rule: no-trailing-spaces
1 parent 66813a4 commit b9e746c

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

.eslintrc

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"rules": {
77
"react/jsx-uses-react": "error",
88
"react/jsx-uses-vars": "error",
9+
"no-trailing-spaces": "error",
910
"array-bracket-spacing": 0,
1011
"comma-dangle": 0
1112
}

lib/__tests__/Autocomplete-test.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import { getStates, matchStateToTerm, styles } from '../utils'
88

99
function AutocompleteComponentJSX(extraProps) {
1010
return (
11-
<Autocomplete
11+
<Autocomplete
1212
labelText="Choose a state from the US"
1313
inputProps={{ name: 'US state' }}
1414
getItemValue={(item) => item.name}
1515
items={getStates()}
1616
renderItem={(item, isHighlighted) => (
1717
<div
18-
style={isHighlighted ? styles.highlightedItem : styles.item}
18+
style={isHighlighted ? styles.highlightedItem : styles.item}
1919
key={item.abbr}
2020
>{item.name}</div>
2121
)}
@@ -197,7 +197,7 @@ describe('Autocomplete kewDown->ArrowDown event handlers', () => {
197197

198198
it('should highlight the "n+1" item in the menu when "n" is selected', () => {
199199
autocompleteWrapper.setState({ 'isOpen': true })
200-
200+
201201
const n = 4
202202
// Set input to be an empty value, which displays all 50 states as items in the menu
203203
autocompleteInputWrapper.simulate('change', { target: { value: '' } })
@@ -211,7 +211,7 @@ describe('Autocomplete kewDown->ArrowDown event handlers', () => {
211211

212212
it('should highlight the 1st item in the menu when the last is selected', () => {
213213
autocompleteWrapper.setState({ 'isOpen': true })
214-
214+
215215
// Set input to be an empty value, which displays all 50 states as items in the menu
216216
autocompleteInputWrapper.simulate('change', { target: { value: '' } })
217217
autocompleteWrapper.setState({ 'highlightedIndex': 49 })
@@ -243,7 +243,7 @@ describe('Autocomplete kewDown->ArrowUp event handlers', () => {
243243

244244
it('should highlight the "n-1" item in the menu when "n" is selected', () => {
245245
autocompleteWrapper.setState({ 'isOpen': true })
246-
246+
247247
const n = 4
248248
// Set input to be an empty value, which displays all 50 states as items in the menu
249249
autocompleteInputWrapper.simulate('change', { target: { value: '' } })
@@ -257,7 +257,7 @@ describe('Autocomplete kewDown->ArrowUp event handlers', () => {
257257

258258
it('should highlight the last item in the menu when the 1st is selected', () => {
259259
autocompleteWrapper.setState({ 'isOpen': true })
260-
260+
261261
// Set input to be an empty value, which displays all 50 states as items in the menu
262262
autocompleteInputWrapper.simulate('change', { target: { value: '' } })
263263
autocompleteWrapper.setState({ 'highlightedIndex': 0 })
@@ -286,9 +286,9 @@ describe('Autocomplete kewDown->Enter event handlers', () => {
286286
autocompleteWrapper.setState({ 'isOpen': true })
287287
autocompleteInputWrapper.simulate('focus')
288288
autocompleteWrapper.setProps({ value, onSelect(v) { value = v } })
289-
289+
290290
// simulate keyUp of backspace, triggering autocomplete suggestion on an empty string, which should result in nothing highlighted
291-
autocompleteInputWrapper.simulate('keyUp', { key : 'Backspace', keyCode: 8, which: 8 })
291+
autocompleteInputWrapper.simulate('keyUp', { key : 'Backspace', keyCode: 8, which: 8 })
292292
expect(autocompleteWrapper.state('highlightedIndex')).toBe(null)
293293

294294
autocompleteInputWrapper.simulate('keyDown', { key : 'Enter', keyCode: 13, which: 13 })
@@ -304,9 +304,9 @@ describe('Autocomplete kewDown->Enter event handlers', () => {
304304
autocompleteWrapper.setState({ 'isOpen': true })
305305
autocompleteInputWrapper.simulate('focus')
306306
autocompleteWrapper.setProps({ value, onSelect(v) { value = v } })
307-
307+
308308
// simulate keyUp of last key, triggering autocomplete suggestion + selection of the suggestion in the menu
309-
autocompleteInputWrapper.simulate('keyUp', { key : 'r', keyCode: 82, which: 82 })
309+
autocompleteInputWrapper.simulate('keyUp', { key : 'r', keyCode: 82, which: 82 })
310310

311311
// Hit enter, updating state.value with the selected Autocomplete suggestion
312312
autocompleteInputWrapper.simulate('keyDown', { key : 'Enter', keyCode: 13, which: 13, preventDefault() { defaultPrevented = true } })
@@ -348,9 +348,9 @@ describe('Autocomplete click event handlers', () => {
348348
})
349349
autocompleteWrapper.setState({ isOpen: true })
350350
autocompleteInputWrapper.simulate('change', { target: { value } })
351-
351+
352352
// simulate keyUp of last key, triggering autocomplete suggestion + selection of the suggestion in the menu
353-
autocompleteInputWrapper.simulate('keyUp', { key : 'r', keyCode: 82, which: 82 })
353+
autocompleteInputWrapper.simulate('keyUp', { key : 'r', keyCode: 82, which: 82 })
354354

355355
// Click inside input, updating state.value with the selected Autocomplete suggestion
356356
autocompleteInputWrapper.simulate('click')

0 commit comments

Comments
 (0)