Update linting

old
Javi Velasco 2016-04-10 17:49:23 +02:00
parent baf4414719
commit c3ef6bd25a
7 changed files with 35 additions and 38 deletions

View File

@ -164,7 +164,7 @@
"no-with": [2],
"one-var": [0],
"operator-assignment": [0, "always"],
"operator-linebreak": [2, "after"],
"operator-linebreak": [2, "before"],
"padded-blocks": [0],
"prefer-const": [2],
"prefer-spread": [2],

View File

@ -32,11 +32,11 @@ $shadow-key-penumbra-opacity: 0.14 !default;
$shadow-ambient-shadow-opacity: 0.12 !default;
//-- Depth Shadows
$zdepth-shadow-1: 0 1px 6px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.24);
$zdepth-shadow-2: 0 3px 10px rgba(0,0,0,0.16), 0 3px 10px rgba(0,0,0,0.23);
$zdepth-shadow-3: 0 10px 30px rgba(0,0,0,0.19), 0 6px 10px rgba(0,0,0,0.23);
$zdepth-shadow-4: 0 14px 45px rgba(0,0,0,0.25), 0 10px 18px rgba(0,0,0,0.22);
$zdepth-shadow-5: 0 19px 60px rgba(0,0,0,0.30), 0 15px 20px rgba(0,0,0,0.22);
$zdepth-shadow-1: 0 1px 6px rgba(0,0,0,.12), 0 1px 4px rgba(0,0,0,.24);
$zdepth-shadow-2: 0 3px 10px rgba(0,0,0,.16), 0 3px 10px rgba(0,0,0,.23);
$zdepth-shadow-3: 0 10px 30px rgba(0,0,0,.19), 0 6px 10px rgba(0,0,0,.23);
$zdepth-shadow-4: 0 14px 45px rgba(0,0,0,.25), 0 10px 18px rgba(0,0,0,.22);
$zdepth-shadow-5: 0 19px 60px rgba(0,0,0,.3), 0 15px 20px rgba(0,0,0,.22);
//-- Animation
$animation-duration: .35s;

View File

@ -113,8 +113,8 @@ class Autocomplete extends React.Component {
const query = this.state.query.toLowerCase().trim() || '';
const values = this.values();
for (const [key, value] of this.source()) {
if (value.toLowerCase().trim().startsWith(query) &&
(!values.has(key) || !this.props.multiple)) {
if (value.toLowerCase().trim().startsWith(query)
&& (!values.has(key) || !this.props.multiple)) {
suggest.set(key, value);
}
}

View File

@ -33,10 +33,9 @@ class Calendar extends React.Component {
}
scrollToActive () {
this.refs.years.scrollTop =
this.refs.activeYear.offsetTop -
this.refs.years.offsetHeight / 2 +
this.refs.activeYear.offsetHeight / 2;
this.refs.years.scrollTop = this.refs.activeYear.offsetTop
- this.refs.years.offsetHeight / 2
+ this.refs.activeYear.offsetHeight / 2;
}
handleDayClick = (day) => {

View File

@ -83,11 +83,12 @@ class Input extends React.Component {
{InputElement}
{icon ? <FontIcon className={style.icon} value={icon} /> : null}
<span className={style.bar}></span>
{labelText ?
<label className={labelClassName}>
{labelText}
{required ? <span className={style.required}> * </span> : null}
</label> : null}
{labelText
? <label className={labelClassName}>
{labelText}
{required ? <span className={style.required}> * </span> : null}
</label>
: null}
{hint ? <span className={style.hint}>{hint}</span> : null}
{error ? <span className={style.error}>{error}</span> : null}
{maxLength ? <span className={style.counter}>{length}/{maxLength}</span> : null}

View File

@ -21,13 +21,11 @@ class Tabs extends React.Component {
};
componentDidMount () {
!this.props.disableAnimatedBottomBorder &&
this.updatePointer(this.props.index);
!this.props.disableAnimatedBottomBorder && this.updatePointer(this.props.index);
}
componentWillReceiveProps (nextProps) {
!this.props.disableAnimatedBottomBorder &&
this.updatePointer(nextProps.index);
!this.props.disableAnimatedBottomBorder && this.updatePointer(nextProps.index);
}
componentWillUnmount () {

View File

@ -11,11 +11,11 @@ function generateDesciption (description) {
function generatePropType (type) {
let values;
if (Array.isArray(type.value)) {
values = '(`' +
type.value.map(function (typeValue) {
values = '(`'
+ type.value.map(function (typeValue) {
return typeValue.name || typeValue.value;
}).join('`,`') +
'`)';
}).join('`,`')
+ '`)';
} else {
values = type.value;
}
@ -33,11 +33,11 @@ function generateProp (propName, prop) {
}
return (
`| \`${propName}\` ${prop.required ? '(required)' : ''}` +
`| ${(prop.type ? generatePropType(prop.type) : '')} ` +
`| ${(prop.defaultValue ? `\`${prop.defaultValue}\`` : '')} ` +
`| ${(prop.description ? prop.description : '')} ` +
'|'
`| \`${propName}\` ${prop.required ? '(required)' : ''}`
+ `| ${(prop.type ? generatePropType(prop.type) : '')} `
+ `| ${(prop.defaultValue ? `\`${prop.defaultValue}\`` : '')} `
+ `| ${(prop.description ? prop.description : '')} `
+ '|'
);
}
@ -45,20 +45,19 @@ function generateProps (props) {
const title = '### Properties';
return (
`${title}\n` +
'| Name | Type | Default | Description |\n' +
'|:-----|:-----|:-----|:-----|\n' +
Object.keys(props).sort().map(propName => {
`${title}\n`
+ '| Name | Type | Default | Description |\n'
+ '|:-----|:-----|:-----|:-----|\n'
+ Object.keys(props).sort().map(propName => {
return generateProp(propName, props[propName]);
}).join('\n')
);
}
function generateMarkdown (name, reactAPI) {
const markdownString =
generateTitle(name) + '\n' +
(reactAPI.description ? generateDesciption(reactAPI.description) + '\n' : '\n') +
generateProps(reactAPI.props);
const markdownString = generateTitle(name) + '\n'
+ (reactAPI.description ? generateDesciption(reactAPI.description) + '\n' : '\n')
+ generateProps(reactAPI.props);
return markdownString;
}