mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-03-11 02:15:57 -05:00
chore: set all to warning
This commit is contained in:
parent
172182357b
commit
0fb344d0c2
12 changed files with 125 additions and 121 deletions
67
.eslintrc
67
.eslintrc
|
@ -47,11 +47,11 @@
|
|||
"prettier/prettier": ["error", null, "@prettier"],
|
||||
"react/no-deprecated": 1,
|
||||
"react/jsx-no-target-blank": 1,
|
||||
"react/destructuring-assignment": ["error", "always"],
|
||||
"react/forbid-component-props": ["error", { "forbid": ["style"] }],
|
||||
"react/no-this-in-sfc": ["error"],
|
||||
"react/no-unsafe": ["error"],
|
||||
"react/sort-comp": ["error", {
|
||||
"react/destructuring-assignment": ["warn", "always"],
|
||||
"react/forbid-component-props": ["warn", { "forbid": ["style"] }],
|
||||
"react/no-this-in-sfc": ["warn"],
|
||||
"react/no-unsafe": ["warn"],
|
||||
"react/sort-comp": ["warn", {
|
||||
"order": [
|
||||
"static-methods",
|
||||
"lifecycle",
|
||||
|
@ -61,9 +61,9 @@
|
|||
"/^render.+$/"
|
||||
]
|
||||
}],
|
||||
"react/void-dom-elements-no-children": ["error"],
|
||||
"react/no-did-mount-set-state": ["error", "disallow-in-func"],
|
||||
"react/jsx-wrap-multilines": ["error",{
|
||||
"react/void-dom-elements-no-children": ["warn"],
|
||||
"react/no-did-mount-set-state": ["warn", "disallow-in-func"],
|
||||
"react/jsx-wrap-multilines": ["warn",{
|
||||
"declaration": "parens",
|
||||
"assignment": "parens",
|
||||
"return": "parens",
|
||||
|
@ -72,29 +72,29 @@
|
|||
"logical": "parens",
|
||||
"prop": "parens"
|
||||
}],
|
||||
"react/jsx-boolean-value": ["error", "always"],
|
||||
"react/jsx-closing-tag-location": ["error"],
|
||||
"react/jsx-curly-spacing": ["error", "always"],
|
||||
"react/jsx-equals-spacing": ["error", "never"],
|
||||
"react/jsx-first-prop-new-line": ["error", "multiline-multiprop"],
|
||||
"react/jsx-handler-names": ["error"],
|
||||
"react/jsx-indent": ["error", 2],
|
||||
"react/jsx-indent-props": ["error", 2],
|
||||
"react/jsx-key": ["error"],
|
||||
"react/jsx-max-depth": ["error", { "max": 2}],
|
||||
"react/jsx-max-props-per-line": ["error", {"maximum": 3, "when": "multiline" }],
|
||||
"react/jsx-no-bind": ["error"],
|
||||
"react/jsx-no-comment-textnodes": ["error"],
|
||||
"react/jsx-no-duplicate-props": ["error"],
|
||||
"react/jsx-no-literals": ["error"],
|
||||
"react/jsx-no-undef": ["error"],
|
||||
"react/jsx-one-expression-per-line": ["error", {"allow": "literal"}],
|
||||
"react/jsx-curly-brace-presence": ["error", { "props": "always", "children": "ignore" }],
|
||||
"react/jsx-pascal-case": ["error"],
|
||||
"react/jsx-props-no-multi-spaces": ["error"],
|
||||
"react/jsx-sort-default-props": ["error"],
|
||||
"react/jsx-sort-props": ["error"],
|
||||
"react/jsx-tag-spacing": ["error", {
|
||||
"react/jsx-boolean-value": ["warn", "always"],
|
||||
"react/jsx-closing-tag-location": ["warn"],
|
||||
// "react/jsx-curly-spacing": ["warn", "never"],
|
||||
"react/jsx-equals-spacing": ["warn", "never"],
|
||||
"react/jsx-first-prop-new-line": ["warn", "multiline-multiprop"],
|
||||
"react/jsx-handler-names": ["warn"],
|
||||
"react/jsx-indent": ["warn", 2],
|
||||
"react/jsx-indent-props": ["warn", 2],
|
||||
"react/jsx-key": ["warn"],
|
||||
"react/jsx-max-depth": ["warn", { "max": 2}],
|
||||
"react/jsx-max-props-per-line": ["warn", {"maximum": 3, "when": "multiline" }],
|
||||
"react/jsx-no-bind": ["warn"],
|
||||
"react/jsx-no-comment-textnodes": ["warn"],
|
||||
"react/jsx-no-duplicate-props": ["warn"],
|
||||
"react/jsx-no-literals": ["warn"],
|
||||
"react/jsx-no-undef": ["warn"],
|
||||
"react/jsx-one-expression-per-line": ["warn", {"allow": "literal"}],
|
||||
"react/jsx-curly-brace-presence": ["warn", { "props": "always", "children": "ignore" }],
|
||||
"react/jsx-pascal-case": ["warn"],
|
||||
"react/jsx-props-no-multi-spaces": ["warn"],
|
||||
"react/jsx-sort-default-props": ["warn"],
|
||||
"react/jsx-sort-props": ["warn"],
|
||||
"react/jsx-tag-spacing": ["warn", {
|
||||
"closingSlash": "never",
|
||||
"beforeSelfClosing": "always",
|
||||
"afterOpening": "allow-multiline",
|
||||
|
@ -112,6 +112,9 @@
|
|||
"prefer-spread": 1,
|
||||
"prefer-rest-params": 1,
|
||||
"linebreak-style": 0,
|
||||
"quote-props":["error", "as-needed"]
|
||||
"quote-props":["warn", "as-needed"],
|
||||
"verdaccio/jsx-no-style": ["warn"],
|
||||
"verdaccio/jsx-spread": ["warn"],
|
||||
"jest/expect-expect": ["warn"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"singleQuote": true,
|
||||
"requirePragma": true,
|
||||
"bracketSpacing": true,
|
||||
"jsxBracketSameLine": false,
|
||||
"jsxBracketSameLine": true,
|
||||
"trailingComma": "es5",
|
||||
"semi": true,
|
||||
"parser": "flow"
|
||||
|
|
|
@ -88,7 +88,7 @@ export default class App extends Component {
|
|||
* Toggles the login modal
|
||||
* Required by: <LoginModal /> <Header />
|
||||
*/
|
||||
toggleLoginModal = () => {
|
||||
handleToggleLoginModal = () => {
|
||||
this.setState((prevState) => ({
|
||||
showLoginModal: !prevState.showLoginModal,
|
||||
error: {}
|
||||
|
@ -99,7 +99,7 @@ export default class App extends Component {
|
|||
* handles login
|
||||
* Required by: <Header />
|
||||
*/
|
||||
doLogin = async (usernameValue, passwordValue) => {
|
||||
handleDoLogin = async (usernameValue, passwordValue) => {
|
||||
const { username, token, error } = await makeLogin(
|
||||
usernameValue,
|
||||
passwordValue
|
||||
|
@ -142,32 +142,6 @@ export default class App extends Component {
|
|||
});
|
||||
}
|
||||
|
||||
renderHeader = () => {
|
||||
const { logoUrl, user, scope } = this.state;
|
||||
return (
|
||||
<Header
|
||||
logo={ logoUrl }
|
||||
onLogout={ this.handleLogout }
|
||||
scope={ scope }
|
||||
toggleLoginModal={ this.toggleLoginModal }
|
||||
username={ user.username }
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
renderLoginModal = () => {
|
||||
const { error, showLoginModal } = this.state;
|
||||
return (
|
||||
<LoginModal
|
||||
error={ error }
|
||||
onCancel={ this.toggleLoginModal }
|
||||
onChange={ this.setUsernameAndPassword }
|
||||
onSubmit={ this.doLogin }
|
||||
visibility={ showLoginModal }
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { isLoading, isUserLoggedIn, packages } = this.state;
|
||||
return (
|
||||
|
@ -187,4 +161,30 @@ export default class App extends Component {
|
|||
</Container>
|
||||
);
|
||||
}
|
||||
|
||||
renderLoginModal = () => {
|
||||
const { error, showLoginModal } = this.state;
|
||||
return (
|
||||
<LoginModal
|
||||
error={ error }
|
||||
onCancel={ this.handleToggleLoginModal }
|
||||
onChange={ this.handleSetUsernameAndPassword }
|
||||
onSubmit={ this.handleDoLogin }
|
||||
visibility={ showLoginModal }
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
renderHeader = () => {
|
||||
const { logoUrl, user, scope } = this.state;
|
||||
return (
|
||||
<Header
|
||||
logo={ logoUrl }
|
||||
onLogout={ this.handleLogout }
|
||||
onToggleLoginModal={ this.handleToggleLoginModal }
|
||||
scope={ scope }
|
||||
username={ user.username }
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ class Header extends Component<IProps, IState> {
|
|||
{
|
||||
anchorEl: null,
|
||||
},
|
||||
this.props.toggleLoginModal
|
||||
this.props.onToggleLoginModal
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
export interface IProps {
|
||||
username?: string;
|
||||
onLogout?: Function;
|
||||
toggleLoginModal: Function;
|
||||
onToggleLoginModal: Function;
|
||||
scope: string;
|
||||
withoutSearch?: boolean;
|
||||
}
|
||||
|
|
|
@ -9,9 +9,7 @@ import { IProps } from './types';
|
|||
|
||||
const NotFound = ({ pkg }: IProps) => (
|
||||
<Wrapper>
|
||||
<h1>Error 404 -
|
||||
{pkg}
|
||||
</h1>
|
||||
<h1>Error 404 -{pkg}</h1>
|
||||
<hr />
|
||||
<p>Oops, The package you are trying to access does not exist.</p>
|
||||
</Wrapper>
|
||||
|
|
|
@ -52,7 +52,8 @@ const Package = ({ name: label, version, time, author: { name, avatar }, descrip
|
|||
</OverviewItem>
|
||||
)}
|
||||
<OverviewItem>
|
||||
<Icon name={ 'time' } pointer={ true } />
|
||||
<Icon name={'time'}
|
||||
pointer={ true } />
|
||||
<Published modifiers={spacing('margin', '0px', '5px', '0px', '0px')}>{`Published on ${formatDate(time)} •`}</Published>
|
||||
{`${formatDateDistance(time)} ago`}
|
||||
</OverviewItem>
|
||||
|
|
|
@ -155,15 +155,17 @@ class Search extends Component<IProps, IState> {
|
|||
|
||||
return (
|
||||
<AutoComplete
|
||||
suggestions={suggestions}
|
||||
suggestionsLoaded={loaded}
|
||||
suggestionsLoading={loading}
|
||||
suggestionsError={error}
|
||||
value={search}
|
||||
placeholder={CONSTANTS.PLACEHOLDER_TEXT}
|
||||
color={colors.white}
|
||||
onBlur={this.onBlur}
|
||||
onChange={this.handleSearch}
|
||||
onCleanSuggestions={this.handlePackagesClearRequested}
|
||||
onClick={this.handleClionSuggestionsFetch={this.handleFetchPackages}.PLAC
|
||||
startAdornment={
|
||||
(<InputAdornment position="start" style={{ color: colors.white }}>
|
||||
<InputAdornment position="start" style={{ color: colors.white }}>
|
||||
<IconSearch />
|
||||
</InputAdornment>)
|
||||
</InputAdornment>
|
||||
}
|
||||
onSuggestionsFetch={this.handleFetchPackages}
|
||||
onCleanSuggestions={this.handlePackagesClearRequested}
|
||||
|
|
|
@ -9,8 +9,8 @@ import type { Element } from 'react';
|
|||
import { IProps } from './types';
|
||||
import { Wrapper } from './styles';
|
||||
|
||||
const Tag = ({ children }: IProps): Element<Wrapper> => <Wrapper>
|
||||
const Tag = ({ children }: IProps): Element<Wrapper> => (<Wrapper>
|
||||
{children}
|
||||
</Wrapper>;
|
||||
</Wrapper>);
|
||||
|
||||
export default Tag;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"jest/consistent-test-it": ["error", {"fn": "test"}],
|
||||
"jest/no-jasmine-globals": 2,
|
||||
"jest/expect-expect": [
|
||||
"error",
|
||||
"warn",
|
||||
{
|
||||
"assertFunctionNames": ["expect"]
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"rules": {
|
||||
"jest/expect-expect": 0
|
||||
"jest/expect-expect": ["warn"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"rules": {
|
||||
"jest/expect-expect": 0
|
||||
"jest/expect-expect": ["warn"]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue