Skip to content

Commit

Permalink
Merge pull request #963 from oliviertassinari/eslint-fix
Browse files Browse the repository at this point in the history
[eslint] fix no-empty and semi rules
  • Loading branch information
Hai Nguyen committed Jun 26, 2015
2 parents c5a114d + 3d5b5a7 commit fb8165f
Show file tree
Hide file tree
Showing 26 changed files with 34 additions and 39 deletions.
2 changes: 0 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@
"no-sequences": 0,
"no-shadow": 0,
"no-shadow-restricted-names": 0,
"no-empty": 0,
"no-extend-native": 0,
"no-undef": 0,
"new-cap": 0,
"quotes": 0,
"semi": 0,
"semi-spacing": 0,
"space-unary-ops": 0,
"space-infix-ops": 0,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"prebuild": "rm -rf lib",
"eslint": "eslint src",
"eslint": "eslint src/**",
"build": "npm run eslint && babel --stage 1 ./src --out-dir ./lib",
"prepublish": "npm run build"
},
Expand Down
2 changes: 1 addition & 1 deletion src/before-after-wrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ let BeforeAfterWrapper = React.createClass({
beforeElementType: 'div',
afterElementType: 'div',
elementType: 'div',
}
};
},

render() {
Expand Down
2 changes: 1 addition & 1 deletion src/checkbox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let Checkbox = React.createClass({
this.props.defaultChecked ||
(this.props.valueLink && this.props.valueLink.value) ||
false,
}
};
},

getTheme() {
Expand Down
4 changes: 1 addition & 3 deletions src/circular-progress.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,8 @@ let CircularProgress = React.createClass({

if (this.props.mode == "determinate"){
let relVal = this._getRelativeValue();
styles.path.transition = Transitions.create("all", "0.3s", null, "linear")
styles.path.transition = Transitions.create("all", "0.3s", null, "linear");
styles.path.strokeDasharray = Math.round(relVal * 1.25) + ",200";
}else{

}

return styles;
Expand Down
4 changes: 2 additions & 2 deletions src/clearfix.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ let ClearFix = React.createClass({
return {
content: "' '",
display: 'table'
}
}
};
};

let after = before();
after.clear = 'both';
Expand Down
4 changes: 2 additions & 2 deletions src/drop-down-icon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ let DropDownIcon = React.createClass({
getInitialState() {
return {
open: false,
}
};
},

getDefaultProps() {
return {
closeOnMenuItemTouchTap: true
}
};
},

componentDidMount() {
Expand Down
2 changes: 1 addition & 1 deletion src/drop-down-menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ let DropDownMenu = React.createClass({
e.target.value = selectedItem[this.props.valueMember];

if (this.props.valueLink)
this.props.valueLink.requestChange(e.target.value)
this.props.valueLink.requestChange(e.target.value);
else
this.props.onChange(e, key, payload);
}
Expand Down
2 changes: 1 addition & 1 deletion src/flat-button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ let FlatButton = React.createClass({
getDefaultProps() {
return {
labelStyle: {}
}
};
},

getInitialState() {
Expand Down
2 changes: 1 addition & 1 deletion src/floating-action-button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ let RaisedButton = React.createClass({
style={this.mergeAndPrefix(
styles.icon,
mini && styles.iconWhenMini,
this.props.iconStyle)}/>
this.props.iconStyle)}/>;
}

let rippleColor = styles.icon.color;
Expand Down
4 changes: 2 additions & 2 deletions src/mixins/classable.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
getDefaultProps(){
return {
className: ''
}
};
},

getClasses(initialClasses, additionalClassObj) {
Expand Down Expand Up @@ -47,4 +47,4 @@ module.exports = {
return classObj;
}

}
};
2 changes: 1 addition & 1 deletion src/mixins/window-listenable.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ module.exports = {
}
}

}
};
2 changes: 1 addition & 1 deletion src/overlay.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ let Overlay = React.createClass({
...other
} = this.props;

let styles = this.mergeAndPrefix(this.getStyles().root, this.props.style, this.props.show && this.getStyles().rootWhenShown)
let styles = this.mergeAndPrefix(this.getStyles().root, this.props.style, this.props.show && this.getStyles().rootWhenShown);

return (
<div {...other} style={styles} />
Expand Down
2 changes: 1 addition & 1 deletion src/radio-button-group.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ let RadioButtonGroup = React.createClass({
label={option.props.label}
labelPosition={this.props.labelPosition}
onCheck={this._onChange}
checked={option.props.value == this.state.selected}/>
checked={option.props.value == this.state.selected}/>;

}, this);

Expand Down
2 changes: 1 addition & 1 deletion src/select-field.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ let SelectField = React.createClass({
e.target.value = payload[this.props.valueMember] || payload;

if (this.props.onChange)
this.props.onChange(e)
this.props.onChange(e);
},

render() {
Expand Down
4 changes: 2 additions & 2 deletions src/slider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ let Slider = React.createClass({
focused: false,
active: false,
hovered: false
}
};
},

componentWillReceiveProps(nextProps) {
Expand Down Expand Up @@ -323,7 +323,7 @@ let Slider = React.createClass({
let i;
for (i = 0; i < (max - min) / step; i++) {
let distance = (pos.left - cursor);
let nextDistance = (cursor + pixelStep) - pos.left
let nextDistance = (cursor + pixelStep) - pos.left;
if (Math.abs(distance) > Math.abs(nextDistance)) {
cursor += pixelStep;
} else {
Expand Down
10 changes: 5 additions & 5 deletions src/styles/themes/light-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@ let LightTheme = {
};

// Properties based on previous properties
obj.flatButton.disabledTextColor = ColorManipulator.fade(obj.flatButton.textColor, 0.3),
obj.floatingActionButton.disabledColor = ColorManipulator.darken(Colors.white, 0.1),
obj.floatingActionButton.disabledTextColor = ColorManipulator.fade(palette.textColor, 0.3)
obj.raisedButton.disabledColor = ColorManipulator.darken(obj.raisedButton.color, 0.1),
obj.raisedButton.disabledTextColor = ColorManipulator.fade(obj.raisedButton.textColor, 0.3)
obj.flatButton.disabledTextColor = ColorManipulator.fade(obj.flatButton.textColor, 0.3);
obj.floatingActionButton.disabledColor = ColorManipulator.darken(Colors.white, 0.1);
obj.floatingActionButton.disabledTextColor = ColorManipulator.fade(palette.textColor, 0.3);
obj.raisedButton.disabledColor = ColorManipulator.darken(obj.raisedButton.color, 0.1);
obj.raisedButton.disabledTextColor = ColorManipulator.fade(obj.raisedButton.textColor, 0.3);
obj.slider.handleSizeActive = obj.slider.handleSize * 2;
obj.toggle.trackRequiredColor = ColorManipulator.fade(obj.toggle.thumbRequiredColor, 0.5);

Expand Down
3 changes: 1 addition & 2 deletions src/styles/transitions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
let AutoPrefix = require('./auto-prefix');


module.exports = {

easeOutFunction: 'cubic-bezier(0.23, 1, 0.32, 1)',
Expand Down Expand Up @@ -37,4 +36,4 @@ module.exports = {
easeFunction + ' ' +
delay;
}
}
};
4 changes: 2 additions & 2 deletions src/text-field.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ let TextField = React.createClass({
inputProps.onChange = this._handleInputChange;
}
if (this.props.children) {
inputElement = React.cloneElement(this.props.children, {...inputProps, ...this.props.children.props})
inputElement = React.cloneElement(this.props.children, {...inputProps, ...this.props.children.props});
}
else {
inputElement = this.props.multiLine ? (
Expand Down Expand Up @@ -355,7 +355,7 @@ let TextField = React.createClass({

_handleInputFocus(e) {
if (this.props.disabled)
return
return;
this.setState({isFocused: true});
if (this.props.onFocus) this.props.onFocus(e);
},
Expand Down
2 changes: 1 addition & 1 deletion src/theme.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function theme(customTheme) {
);
}
});
}
};
}

module.exports = Theme;
Expand Down
2 changes: 1 addition & 1 deletion src/toggle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let Toggle = React.createClass({
this.props.defaultToggled ||
(this.props.valueLink && this.props.valueLink.value) ||
false
}
};
},

getTheme() {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/color-manipulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ module.exports = {
fade(color, amount) {
color = this._decomposeColor(color);
if (color.type === 'rgb' || color.type === 'hsl') color.type += 'a';
return this._convertColorToString(color, amount)
return this._convertColorToString(color, amount);
},

// Desaturates rgb and sets opacity to 0.15
Expand Down
2 changes: 1 addition & 1 deletion src/utils/date-time.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,4 @@ module.exports = {
return ~~(this.monthDiff(d1, d2) / 12);
}

}
};
2 changes: 1 addition & 1 deletion src/utils/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ module.exports = {
el.style.transition = '';
}

}
};
2 changes: 1 addition & 1 deletion src/utils/key-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ module.exports = {
SPACE: 32,
TAB: 9,
UP: 38
}
};
2 changes: 1 addition & 1 deletion src/utils/key-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ module.exports = {
getIncrementalDim(dim) {
return Math.ceil(dim / this.Desktop.INCREMENT) * this.Desktop.INCREMENT;
}
}
};

0 comments on commit fb8165f

Please sign in to comment.