mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-06 22:40:26 -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:
parent
2d5d8ba84f
commit
2a30f5263a
2 changed files with 35 additions and 31 deletions
18
.eslintrc
18
.eslintrc
|
@ -63,7 +63,7 @@
|
||||||
}],
|
}],
|
||||||
"react/void-dom-elements-no-children": ["warn"],
|
"react/void-dom-elements-no-children": ["warn"],
|
||||||
"react/no-did-mount-set-state": ["warn", "disallow-in-func"],
|
"react/no-did-mount-set-state": ["warn", "disallow-in-func"],
|
||||||
"react/jsx-wrap-multilines": ["warn",{
|
"react/jsx-wrap-multilines": ["error",{
|
||||||
"declaration": "parens",
|
"declaration": "parens",
|
||||||
"assignment": "parens",
|
"assignment": "parens",
|
||||||
"return": "parens",
|
"return": "parens",
|
||||||
|
@ -87,25 +87,25 @@
|
||||||
"react/jsx-no-comment-textnodes": ["warn"],
|
"react/jsx-no-comment-textnodes": ["warn"],
|
||||||
"react/jsx-no-duplicate-props": ["warn"],
|
"react/jsx-no-duplicate-props": ["warn"],
|
||||||
"react/jsx-no-literals": ["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-one-expression-per-line": ["warn", {"allow": "single-child"}],
|
||||||
"react/jsx-curly-brace-presence": ["warn", { "props": "always", "children": "ignore" }],
|
"react/jsx-curly-brace-presence": ["warn", { "props": "always", "children": "ignore" }],
|
||||||
"react/jsx-pascal-case": ["error"],
|
"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-default-props": ["warn"],
|
||||||
"react/jsx-sort-props": ["warn"],
|
"react/jsx-sort-props": ["warn"],
|
||||||
"react/jsx-tag-spacing": ["warn", {
|
"react/jsx-tag-spacing": ["error", {
|
||||||
"closingSlash": "never",
|
"closingSlash": "never",
|
||||||
"beforeSelfClosing": "always",
|
"beforeSelfClosing": "always",
|
||||||
"afterOpening": "allow-multiline",
|
"afterOpening": "allow-multiline",
|
||||||
"beforeClosing": "allow"
|
"beforeClosing": "allow"
|
||||||
}],
|
}],
|
||||||
"no-useless-escape": 2,
|
"no-useless-escape": ["error"],
|
||||||
"no-invalid-this": 0,
|
"no-invalid-this": 0,
|
||||||
"handle-callback-err": 2,
|
"handle-callback-err": ["error"],
|
||||||
"no-fallthrough": 2,
|
"no-fallthrough": ["error"],
|
||||||
"no-new-require": 2,
|
"no-new-require": ["error"],
|
||||||
"max-len": [2, 160],
|
"max-len": ["error", 160],
|
||||||
"camelcase": 0,
|
"camelcase": 0,
|
||||||
"require-jsdoc": 0,
|
"require-jsdoc": 0,
|
||||||
"valid-jsdoc": 0,
|
"valid-jsdoc": 0,
|
||||||
|
|
|
@ -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
|
* As user focuses out from input, we cancel all the request from requestList
|
||||||
* and set the API state parameters to default boolean values.
|
* and set the API state parameters to default boolean values.
|
||||||
|
@ -150,29 +172,11 @@ class Search extends Component<IProps, IState> {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
render(): Node {
|
renderAdorment() {
|
||||||
const { suggestions, search, loaded, loading, error } = this.state;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AutoComplete
|
<InputAdornment position="start" style={{ color: colors.white }}>
|
||||||
suggestions={suggestions}
|
<IconSearch />
|
||||||
suggestionsLoaded={loaded}
|
</InputAdornment>
|
||||||
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}
|
|
||||||
/>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue