Skip to content
This repository has been archived by the owner on Mar 30, 2018. It is now read-only.

Commit

Permalink
fix linting problems
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Sep 26, 2016
1 parent 32b6e37 commit 87da0c9
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 16 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ rules:
import/imports-first: off
jsx-a11y/no-static-element-interactions: off
jsx-a11y/anchor-has-content: off
import/extensions: off
2 changes: 1 addition & 1 deletion src/Modal/Prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class Prompt extends Component {
<p>
<input
className="uk-width-1-1"
ref={node => {
ref={(node) => {
if (node) {
this.input = node
}
Expand Down
5 changes: 4 additions & 1 deletion src/Select/Option.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* eslint-disable */
// temporary disable linting in this file

import cx from 'classnames'
import { Component, PropTypes } from 'react'

Expand All @@ -23,7 +26,7 @@ export default class Option extends Component {
}
}

handleBlockEvent = event => {
handleBlockEvent = (event) => {
event.preventDefault()
event.stopPropagation()
}
Expand Down
9 changes: 6 additions & 3 deletions src/Select/Value.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* eslint-disable */
// temporary disable linting in this file

import cx from 'classnames'
import { Component, PropTypes } from 'react'

Expand All @@ -12,13 +15,13 @@ export default class Value extends Component {
onRemove: PropTypes.func, // method to handle removal of the value
}

handleRemove = event => {
handleRemove = (event) => {
event.preventDefault()
event.stopPropagation()
this.props.onRemove(this.props.value)
}

handleMouseDown = event => {
handleMouseDown = (event) => {
if (event.type === 'mousedown' && event.button !== 0) {
return
}
Expand All @@ -32,7 +35,7 @@ export default class Value extends Component {
}
}

handleTouchEndRemove = event => {
handleTouchEndRemove = (event) => {
// Check if the view is being dragged, In this case
// we don't want to fire the click event (because the user only wants to scroll)
if (this.dragging) return
Expand Down
21 changes: 12 additions & 9 deletions src/Select/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* eslint-disable */
// temporary disable linting in this file

import cx from 'classnames'
import Input from 'react-input-autosize'
import { Component, PropTypes } from 'react'
Expand Down Expand Up @@ -517,7 +520,7 @@ export default class Select extends Component {

handleRemove = (value) => {
const valueArray = this.getValueArray(this.props.value)
this.setValue(valueArray.filter(i => {
this.setValue(valueArray.filter((i) => {
if (i.create) {
return (
i[this.props.valueKey] !== value[this.props.valueKey] &&
Expand All @@ -529,7 +532,7 @@ export default class Select extends Component {
this.focus()
}

handleClearValue = event => {
handleClearValue = (event) => {
// if the event was triggered by a mousedown and not the primary
// button, ignore it.
if (event && event.type === 'mousedown' && event.button !== 0) {
Expand Down Expand Up @@ -656,7 +659,7 @@ export default class Select extends Component {

getOptionLabel = op => op[this.props.labelKey]

getValueArray = value => {
getValueArray = (value) => {
if (this.props.multi) {
let valueArray = value
if (typeof valueArray === 'string') valueArray = valueArray.split(this.props.delimiter)
Expand All @@ -670,7 +673,7 @@ export default class Select extends Component {
return expandedValue ? [expandedValue] : []
}

setValue = newValue => {
setValue = (newValue) => {
let value = newValue
if (this.props.autoBlur) {
this.blurInput()
Expand Down Expand Up @@ -702,7 +705,7 @@ export default class Select extends Component {
filterValue = filterValue.toLowerCase()
}
const skipOptions = excludeOptions ? excludeOptions.map(i => i[this.props.valueKey]) : false
filteredOptions = options.filter(option => {
filteredOptions = options.filter((option) => {
if (skipOptions && skipOptions.indexOf(option[this.props.valueKey]) > -1) return false
if (this.props.filterOption) return this.props.filterOption.call(this, option, filterValue)
if (!filterValue) return true
Expand Down Expand Up @@ -732,7 +735,7 @@ export default class Select extends Component {
if (this.props.allowCreate && filterValue) {
let addNewOption = true
// @TODO: only add the "Add" option if none of the options are an exact match
filteredOptions.forEach(option => {
filteredOptions.forEach((option) => {
if (
String(option.label).toLowerCase() === filterValue ||
String(option.value).toLowerCase() === filterValue
Expand Down Expand Up @@ -929,7 +932,7 @@ export default class Select extends Component {
}
const isSelected = valueArray && valueArray.indexOf(option) > -1
const isFocused = option === focusedOption
const optionRef = isFocused ? node => {
const optionRef = isFocused ? (node) => {
if (node) {
this.focusedNode = node
}
Expand Down Expand Up @@ -1029,7 +1032,7 @@ export default class Select extends Component {
return (
<div
className="uk-dropdown"
ref={node => {
ref={(node) => {
if (node) {
this.menuContainer = node
}
Expand All @@ -1038,7 +1041,7 @@ export default class Select extends Component {
<ul
className="uk-nav uk-nav-autocomplete"
id={`${this._instancePrefix}-list`}
ref={node => {
ref={(node) => {
if (node) {
this.menuNode = node
}
Expand Down
4 changes: 2 additions & 2 deletions src/stories/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Select.displayName = 'Select'
class Form extends Component {
static propTypes = {
children: PropTypes.node.isRequired,
defaultValue: PropTypes.any,
defaultValue: PropTypes.any, // eslint-disable-line react/forbid-prop-types
}
static props = {
defaultValue: null,
Expand All @@ -20,7 +20,7 @@ class Form extends Component {
value: this.props.defaultValue,
}
logChange = action('onChange')
handleChange = value => {
handleChange = (value) => {
this.setState({ value })
this.logChange(value)
}
Expand Down

0 comments on commit 87da0c9

Please sign in to comment.