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

View File

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

View File

@ -9,11 +9,12 @@ class EditorAccessibility extends React.Component {
const messages = [];
if (this.props.lintMessages.length > 0) {
this.props.lintMessages.forEach((lintMessage, i) => {
messages.push(<li key={lintMessage.id}>
{lintMessage.severity} in line
{lintMessage.line} :
{lintMessage.message}
</li>);
messages.push((
<li key={lintMessage.id}>
{lintMessage.severity} in line
{lintMessage.line} :
{lintMessage.message}
</li>));
});
} else {
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();
})
.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));
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 {
width: 100%;
font-size: #{16 / $base-font-size}rem;
margin-top: #{5 / $base-font-size}rem;
}
.copyable-input__label {
width: 100%;
font-size: #{12 / $base-font-size}rem;
padding-bottom: #{5 / $base-font-size}rem;
@include themify() {
color: getThemifyVariable('inactive-text-color');
}
@ -34,24 +34,20 @@
width: 100%;
}
.copyable-input {
.tooltipped::after {
@include themify() {
background-color: getThemifyVariable('button-background-hover-color');
color: getThemifyVariable('button-hover-color');
}
font-family: Montserrat, sans-serif;
font-size: #{12 / $base-font-size}rem;
bottom: #{41 / $base-font-size}rem;
.tooltipped::after {
@include themify() {
background-color: getThemifyVariable('button-background-hover-color');
color: getThemifyVariable('button-hover-color');
}
font-family: Montserrat, sans-serif;
font-size: #{12 / $base-font-size}rem;
}
.tooltipped-n::before,
.tooltipped::before,
{
@include themify() {
color: getThemifyVariable('button-background-hover-color');
border-top-color: getThemifyVariable('button-background-hover-color');
}
top: #{14 / $base-font-size}rem;
.tooltipped-n::before,
.tooltipped::before,
{
@include themify() {
color: getThemifyVariable('button-background-hover-color');
border-top-color: getThemifyVariable('button-background-hover-color');
}
}