mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-06 22:40:26 -05:00
chore: enable react/jsx-first-prop-new-line as error
This commit is contained in:
parent
3354c93b06
commit
529fa5656b
3 changed files with 27 additions and 24 deletions
|
@ -73,12 +73,12 @@
|
||||||
"prop": "parens"
|
"prop": "parens"
|
||||||
}],
|
}],
|
||||||
"react/jsx-boolean-value": ["error", "always"],
|
"react/jsx-boolean-value": ["error", "always"],
|
||||||
"react/jsx-closing-tag-location": ["warn"],
|
"react/jsx-closing-tag-location": ["error"],
|
||||||
"react/jsx-curly-spacing": ["error", "never"],
|
"react/jsx-curly-spacing": ["error", "never"],
|
||||||
"react/jsx-equals-spacing": ["warn", "never"],
|
"react/jsx-equals-spacing": ["warn", "never"],
|
||||||
"react/jsx-first-prop-new-line": ["warn", "multiline-multiprop"],
|
"react/jsx-first-prop-new-line": ["error", "multiline-multiprop"],
|
||||||
"react/jsx-handler-names": ["warn"],
|
"react/jsx-handler-names": ["warn"],
|
||||||
"react/jsx-indent": ["warn", 2],
|
"react/jsx-indent": ["error", 2],
|
||||||
"react/jsx-indent-props": ["warn", 2],
|
"react/jsx-indent-props": ["warn", 2],
|
||||||
"react/jsx-key": ["warn"],
|
"react/jsx-key": ["warn"],
|
||||||
"react/jsx-max-depth": ["warn", { "max": 2}],
|
"react/jsx-max-depth": ["warn", { "max": 2}],
|
||||||
|
|
|
@ -99,28 +99,33 @@ export default class LoginModal extends Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderMessage(title, description) {
|
||||||
|
const errorMessage = (
|
||||||
|
<span>
|
||||||
|
<div>
|
||||||
|
<strong>
|
||||||
|
{title}
|
||||||
|
</strong>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{description}
|
||||||
|
</div>
|
||||||
|
</span>);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={classes.loginErrorMsg}
|
||||||
|
id={"client-snackbar"}>
|
||||||
|
<ErrorIcon className={classes.loginIcon} />
|
||||||
|
{errorMessage()}
|
||||||
|
</div>);
|
||||||
|
}
|
||||||
|
|
||||||
renderLoginError({ type, title, description } = {}) {
|
renderLoginError({ type, title, description } = {}) {
|
||||||
return type === 'error' && (
|
return type === 'error' && (
|
||||||
<SnackbarContent
|
<SnackbarContent
|
||||||
className={classes.loginError}
|
className={classes.loginError}
|
||||||
message={
|
message={this.renderMessage(title, description)}
|
||||||
(<div
|
|
||||||
className={classes.loginErrorMsg}
|
|
||||||
id={"client-snackbar"}
|
|
||||||
>
|
|
||||||
<ErrorIcon className={classes.loginIcon} />
|
|
||||||
<span>
|
|
||||||
<div>
|
|
||||||
<strong>
|
|
||||||
{title}
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
{description}
|
|
||||||
</div>
|
|
||||||
</span>
|
|
||||||
</div>)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,9 +51,7 @@ describe('<Package /> component', () => {
|
||||||
expect(wrapper.find(Field).someWhere(n => {
|
expect(wrapper.find(Field).someWhere(n => {
|
||||||
return (
|
return (
|
||||||
n.children().first().get(0).props.children[0].props.text === 'Description' &&
|
n.children().first().get(0).props.children[0].props.text === 'Description' &&
|
||||||
n.children().childAt(1).containsMatchingElement(<span>
|
n.children().childAt(1).containsMatchingElement(<span>{props.description}</span>)
|
||||||
{props.description}
|
|
||||||
</span>)
|
|
||||||
)
|
)
|
||||||
})).toBe(true);
|
})).toBe(true);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue