0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

chore: fix react/jsx-wrap-multilines error

enable
react/jsx-no-undef
react/jsx-wrap-multilines
react/jsx-tag-spacing

replace 2 by error on eslint in some configs
This commit is contained in:
Juan Picado @jotadeveloper 2018-12-15 17:34:32 +01:00
parent 2d5d8ba84f
commit 2a30f5263a
No known key found for this signature in database
GPG key ID: 18AC54485952D158
2 changed files with 35 additions and 31 deletions

View file

@ -63,7 +63,7 @@
}],
"react/void-dom-elements-no-children": ["warn"],
"react/no-did-mount-set-state": ["warn", "disallow-in-func"],
"react/jsx-wrap-multilines": ["warn",{
"react/jsx-wrap-multilines": ["error",{
"declaration": "parens",
"assignment": "parens",
"return": "parens",
@ -87,25 +87,25 @@
"react/jsx-no-comment-textnodes": ["warn"],
"react/jsx-no-duplicate-props": ["warn"],
"react/jsx-no-literals": ["warn"],
"react/jsx-no-undef": ["warn"],
"react/jsx-no-undef": ["error"],
"react/jsx-one-expression-per-line": ["warn", {"allow": "single-child"}],
"react/jsx-curly-brace-presence": ["warn", { "props": "always", "children": "ignore" }],
"react/jsx-pascal-case": ["error"],
"react/jsx-props-no-multi-spaces": ["warn"],
"react/jsx-props-no-multi-spaces": ["error"],
"react/jsx-sort-default-props": ["warn"],
"react/jsx-sort-props": ["warn"],
"react/jsx-tag-spacing": ["warn", {
"react/jsx-tag-spacing": ["error", {
"closingSlash": "never",
"beforeSelfClosing": "always",
"afterOpening": "allow-multiline",
"beforeClosing": "allow"
}],
"no-useless-escape": 2,
"no-useless-escape": ["error"],
"no-invalid-this": 0,
"handle-callback-err": 2,
"no-fallthrough": 2,
"no-new-require": 2,
"max-len": [2, 160],
"handle-callback-err": ["error"],
"no-fallthrough": ["error"],
"no-new-require": ["error"],
"max-len": ["error", 160],
"camelcase": 0,
"require-jsdoc": 0,
"valid-jsdoc": 0,

View file

@ -133,6 +133,28 @@ class Search extends Component<IProps, IState> {
}
};
render(): Node {
const { suggestions, search, loaded, loading, error } = this.state;
return (
<AutoComplete
suggestions={suggestions}
suggestionsLoaded={loaded}
suggestionsLoading={loading}
suggestionsError={error}
value={search}
placeholder={CONSTANTS.PLACEHOLDER_TEXT}
color={colors.white}
startAdornment={this.renderAdorment()}
onSuggestionsFetch={this.handleFetchPackages}
onCleanSuggestions={this.handlePackagesClearRequested}
onClick={this.handleClickSearch}
onChange={this.handleSearch}
onBlur={this.onBlur}
/>
);
}
/**
* As user focuses out from input, we cancel all the request from requestList
* and set the API state parameters to default boolean values.
@ -150,29 +172,11 @@ class Search extends Component<IProps, IState> {
);
};
render(): Node {
const { suggestions, search, loaded, loading, error } = this.state;
renderAdorment() {
return (
<AutoComplete
suggestions={suggestions}
suggestionsLoaded={loaded}
suggestionsLoading={loading}
suggestionsError={error}
value={search}
placeholder={CONSTANTS.PLACEHOLDER_TEXT}
color={colors.white}
startAdornment={
<InputAdornment position="start" style={{ color: colors.white }}>
<IconSearch />
</InputAdornment>
}
onSuggestionsFetch={this.handleFetchPackages}
onCleanSuggestions={this.handlePackagesClearRequested}
onClick={this.handleClickSearch}
onChange={this.handleSearch}
onBlur={this.onBlur}
/>
<InputAdornment position="start" style={{ color: colors.white }}>
<IconSearch />
</InputAdornment>
);
}
}