fix many linting errors

This commit is contained in:
Cassie Tarakajian 2018-05-08 18:35:18 -07:00
parent 90c76c1d08
commit 617cffc869
5 changed files with 38 additions and 32 deletions

View file

@ -6,11 +6,6 @@
"node": true, "node": true,
"mocha": true "mocha": true
}, },
"ecmaFeatures": {
"jsx": true,
"es6": true,
"classes": true
},
"rules": { "rules": {
"linebreak-style": 0, "linebreak-style": 0,
"react/no-multi-comp": 0, "react/no-multi-comp": 0,
@ -51,6 +46,20 @@
"to" "to"
] ]
} }
],
"jsx-a11y/label-has-for": [
2,
{
"components": [
"Label"
],
"required": {
"every": [
"id"
]
},
"allowChildren": false
}
] ]
}, },
"plugins": [ "plugins": [

View file

@ -41,12 +41,12 @@ class CopyableInput extends React.Component {
ref={(element) => { this.tooltip = element; }} ref={(element) => { this.tooltip = element; }}
onMouseLeave={this.onMouseLeaveHandler} onMouseLeave={this.onMouseLeaveHandler}
> >
<label className="copyable-input__label" htmlFor="copyable-input__value"> <label className="copyable-input__label" htmlFor={`copyable-input__value-${label}`}>
{label} {label}
<input <input
type="text" type="text"
className="copyable-input__value" className="copyable-input__value"
id="copyable-input__value" id={`copyable-input__value-${label}`}
value={value} value={value}
ref={(element) => { this.input = element; }} ref={(element) => { this.input = element; }}
readOnly readOnly

View file

@ -9,11 +9,12 @@ class EditorAccessibility extends React.Component {
const messages = []; const messages = [];
if (this.props.lintMessages.length > 0) { if (this.props.lintMessages.length > 0) {
this.props.lintMessages.forEach((lintMessage, i) => { this.props.lintMessages.forEach((lintMessage, i) => {
messages.push(<li key={lintMessage.id}> messages.push((
<li key={lintMessage.id}>
{lintMessage.severity} in line {lintMessage.severity} in line
{lintMessage.line} : {lintMessage.line} :
{lintMessage.message} {lintMessage.message}
</li>); </li>));
}); });
} else { } else {
messages.push(<li tabIndex="0" key={0}> There are no lint messages </li>); messages.push(<li tabIndex="0" key={0}> There are no lint messages </li>);

View file

@ -63,7 +63,7 @@ export function validateAndLoginUser(previousPath, formProps, dispatch) {
resolve(); resolve();
}) })
.catch((response) => { .catch((response) => {
reject({ password: response.data.message, _error: 'Login failed!' }); reject({ password: response.data.message, _error: 'Login failed!' }); // eslint-disable-line
}); });
}); });
} }
@ -212,5 +212,5 @@ export function updateSettings(formValues) {
dispatch(updateSettingsSuccess(response.data)); dispatch(updateSettingsSuccess(response.data));
browserHistory.push('/'); browserHistory.push('/');
}) })
.catch(response => Promise.reject({ currentPassword: response.data.error })); .catch(response => Promise.reject(new Error(response.data.error)));
} }

View file

@ -13,12 +13,12 @@
.copyable-input__value { .copyable-input__value {
width: 100%; width: 100%;
font-size: #{16 / $base-font-size}rem; font-size: #{16 / $base-font-size}rem;
margin-top: #{5 / $base-font-size}rem;
} }
.copyable-input__label { .copyable-input__label {
width: 100%; width: 100%;
font-size: #{12 / $base-font-size}rem; font-size: #{12 / $base-font-size}rem;
padding-bottom: #{5 / $base-font-size}rem;
@include themify() { @include themify() {
color: getThemifyVariable('inactive-text-color'); color: getThemifyVariable('inactive-text-color');
} }
@ -34,7 +34,6 @@
width: 100%; width: 100%;
} }
.copyable-input {
.tooltipped::after { .tooltipped::after {
@include themify() { @include themify() {
background-color: getThemifyVariable('button-background-hover-color'); background-color: getThemifyVariable('button-background-hover-color');
@ -42,7 +41,6 @@
} }
font-family: Montserrat, sans-serif; font-family: Montserrat, sans-serif;
font-size: #{12 / $base-font-size}rem; font-size: #{12 / $base-font-size}rem;
bottom: #{41 / $base-font-size}rem;
} }
.tooltipped-n::before, .tooltipped-n::before,
@ -52,6 +50,4 @@
color: getThemifyVariable('button-background-hover-color'); color: getThemifyVariable('button-background-hover-color');
border-top-color: getThemifyVariable('button-background-hover-color'); border-top-color: getThemifyVariable('button-background-hover-color');
} }
top: #{14 / $base-font-size}rem;
}
} }