mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -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"
|
||||
}],
|
||||
"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-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-indent": ["warn", 2],
|
||||
"react/jsx-indent": ["error", 2],
|
||||
"react/jsx-indent-props": ["warn", 2],
|
||||
"react/jsx-key": ["warn"],
|
||||
"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 } = {}) {
|
||||
return type === 'error' && (
|
||||
<SnackbarContent
|
||||
className={classes.loginError}
|
||||
message={
|
||||
(<div
|
||||
className={classes.loginErrorMsg}
|
||||
id={"client-snackbar"}
|
||||
>
|
||||
<ErrorIcon className={classes.loginIcon} />
|
||||
<span>
|
||||
<div>
|
||||
<strong>
|
||||
{title}
|
||||
</strong>
|
||||
</div>
|
||||
<div>
|
||||
{description}
|
||||
</div>
|
||||
</span>
|
||||
</div>)
|
||||
}
|
||||
message={this.renderMessage(title, description)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -51,9 +51,7 @@ describe('<Package /> component', () => {
|
|||
expect(wrapper.find(Field).someWhere(n => {
|
||||
return (
|
||||
n.children().first().get(0).props.children[0].props.text === 'Description' &&
|
||||
n.children().childAt(1).containsMatchingElement(<span>
|
||||
{props.description}
|
||||
</span>)
|
||||
n.children().childAt(1).containsMatchingElement(<span>{props.description}</span>)
|
||||
)
|
||||
})).toBe(true);
|
||||
|
||||
|
|
Loading…
Reference in a new issue