0
Fork 0
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:
Juan Picado @jotadeveloper 2018-12-15 08:55:39 +01:00
parent 172182357b
commit 0fb344d0c2
No known key found for this signature in database
GPG key ID: 18AC54485952D158
12 changed files with 125 additions and 121 deletions

View file

@ -47,11 +47,11 @@
"prettier/prettier": ["error", null, "@prettier"], "prettier/prettier": ["error", null, "@prettier"],
"react/no-deprecated": 1, "react/no-deprecated": 1,
"react/jsx-no-target-blank": 1, "react/jsx-no-target-blank": 1,
"react/destructuring-assignment": ["error", "always"], "react/destructuring-assignment": ["warn", "always"],
"react/forbid-component-props": ["error", { "forbid": ["style"] }], "react/forbid-component-props": ["warn", { "forbid": ["style"] }],
"react/no-this-in-sfc": ["error"], "react/no-this-in-sfc": ["warn"],
"react/no-unsafe": ["error"], "react/no-unsafe": ["warn"],
"react/sort-comp": ["error", { "react/sort-comp": ["warn", {
"order": [ "order": [
"static-methods", "static-methods",
"lifecycle", "lifecycle",
@ -61,9 +61,9 @@
"/^render.+$/" "/^render.+$/"
] ]
}], }],
"react/void-dom-elements-no-children": ["error"], "react/void-dom-elements-no-children": ["warn"],
"react/no-did-mount-set-state": ["error", "disallow-in-func"], "react/no-did-mount-set-state": ["warn", "disallow-in-func"],
"react/jsx-wrap-multilines": ["error",{ "react/jsx-wrap-multilines": ["warn",{
"declaration": "parens", "declaration": "parens",
"assignment": "parens", "assignment": "parens",
"return": "parens", "return": "parens",
@ -72,29 +72,29 @@
"logical": "parens", "logical": "parens",
"prop": "parens" "prop": "parens"
}], }],
"react/jsx-boolean-value": ["error", "always"], "react/jsx-boolean-value": ["warn", "always"],
"react/jsx-closing-tag-location": ["error"], "react/jsx-closing-tag-location": ["warn"],
"react/jsx-curly-spacing": ["error", "always"], // "react/jsx-curly-spacing": ["warn", "never"],
"react/jsx-equals-spacing": ["error", "never"], "react/jsx-equals-spacing": ["warn", "never"],
"react/jsx-first-prop-new-line": ["error", "multiline-multiprop"], "react/jsx-first-prop-new-line": ["warn", "multiline-multiprop"],
"react/jsx-handler-names": ["error"], "react/jsx-handler-names": ["warn"],
"react/jsx-indent": ["error", 2], "react/jsx-indent": ["warn", 2],
"react/jsx-indent-props": ["error", 2], "react/jsx-indent-props": ["warn", 2],
"react/jsx-key": ["error"], "react/jsx-key": ["warn"],
"react/jsx-max-depth": ["error", { "max": 2}], "react/jsx-max-depth": ["warn", { "max": 2}],
"react/jsx-max-props-per-line": ["error", {"maximum": 3, "when": "multiline" }], "react/jsx-max-props-per-line": ["warn", {"maximum": 3, "when": "multiline" }],
"react/jsx-no-bind": ["error"], "react/jsx-no-bind": ["warn"],
"react/jsx-no-comment-textnodes": ["error"], "react/jsx-no-comment-textnodes": ["warn"],
"react/jsx-no-duplicate-props": ["error"], "react/jsx-no-duplicate-props": ["warn"],
"react/jsx-no-literals": ["error"], "react/jsx-no-literals": ["warn"],
"react/jsx-no-undef": ["error"], "react/jsx-no-undef": ["warn"],
"react/jsx-one-expression-per-line": ["error", {"allow": "literal"}], "react/jsx-one-expression-per-line": ["warn", {"allow": "literal"}],
"react/jsx-curly-brace-presence": ["error", { "props": "always", "children": "ignore" }], "react/jsx-curly-brace-presence": ["warn", { "props": "always", "children": "ignore" }],
"react/jsx-pascal-case": ["error"], "react/jsx-pascal-case": ["warn"],
"react/jsx-props-no-multi-spaces": ["error"], "react/jsx-props-no-multi-spaces": ["warn"],
"react/jsx-sort-default-props": ["error"], "react/jsx-sort-default-props": ["warn"],
"react/jsx-sort-props": ["error"], "react/jsx-sort-props": ["warn"],
"react/jsx-tag-spacing": ["error", { "react/jsx-tag-spacing": ["warn", {
"closingSlash": "never", "closingSlash": "never",
"beforeSelfClosing": "always", "beforeSelfClosing": "always",
"afterOpening": "allow-multiline", "afterOpening": "allow-multiline",
@ -112,6 +112,9 @@
"prefer-spread": 1, "prefer-spread": 1,
"prefer-rest-params": 1, "prefer-rest-params": 1,
"linebreak-style": 0, "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"]
} }
} }

View file

@ -5,7 +5,7 @@
"singleQuote": true, "singleQuote": true,
"requirePragma": true, "requirePragma": true,
"bracketSpacing": true, "bracketSpacing": true,
"jsxBracketSameLine": false, "jsxBracketSameLine": true,
"trailingComma": "es5", "trailingComma": "es5",
"semi": true, "semi": true,
"parser": "flow" "parser": "flow"

View file

@ -41,10 +41,10 @@ export default class App extends Component {
} }
} }
loadLogo = async () => { loadLogo = async () => {
const logoUrl = await logo(); const logoUrl = await logo();
this.setState({ this.setState({
logoUrl logoUrl
}); });
} }
@ -66,7 +66,7 @@ export default class App extends Component {
try { try {
this.req = await API.request('packages', 'GET'); this.req = await API.request('packages', 'GET');
this.setState({ this.setState({
packages: this.req, packages: this.req,
isLoading: false isLoading: false
}); });
} catch (error) { } catch (error) {
@ -88,7 +88,7 @@ export default class App extends Component {
* Toggles the login modal * Toggles the login modal
* Required by: <LoginModal /> <Header /> * Required by: <LoginModal /> <Header />
*/ */
toggleLoginModal = () => { handleToggleLoginModal = () => {
this.setState((prevState) => ({ this.setState((prevState) => ({
showLoginModal: !prevState.showLoginModal, showLoginModal: !prevState.showLoginModal,
error: {} error: {}
@ -99,7 +99,7 @@ export default class App extends Component {
* handles login * handles login
* Required by: <Header /> * Required by: <Header />
*/ */
doLogin = async (usernameValue, passwordValue) => { handleDoLogin = async (usernameValue, passwordValue) => {
const { username, token, error } = await makeLogin( const { username, token, error } = await makeLogin(
usernameValue, usernameValue,
passwordValue 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() { render() {
const { isLoading, isUserLoggedIn, packages } = this.state; const { isLoading, isUserLoggedIn, packages } = this.state;
return ( return (
@ -187,4 +161,30 @@ export default class App extends Component {
</Container> </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 }
/>
);
}
} }

View file

@ -95,7 +95,7 @@ class Header extends Component<IProps, IState> {
{ {
anchorEl: null, anchorEl: null,
}, },
this.props.toggleLoginModal this.props.onToggleLoginModal
); );
}; };
@ -115,7 +115,7 @@ class Header extends Component<IProps, IState> {
const { withoutSearch = false } = this.props; const { withoutSearch = false } = this.props;
return ( return (
<LeftSide> <LeftSide>
<Link style={ { marginRight: '1em' } } to={ '/' }> <Link style={{ marginRight: '1em' }} to={'/'}>
<Logo /> <Logo />
</Link> </Link>
{!withoutSearch && ( {!withoutSearch && (
@ -134,7 +134,7 @@ class Header extends Component<IProps, IState> {
<RightSide> <RightSide>
{!withoutSearch && ( {!withoutSearch && (
<Tooltip disableFocusListener={true} title={'Search packages'}> <Tooltip disableFocusListener={true} title={'Search packages'}>
<IconSearchButton color={ 'inherit' } onClick={ this.handleToggleMNav }> <IconSearchButton color={'inherit'} onClick={this.handleToggleMNav}>
<IconSearch /> <IconSearch />
</IconSearchButton> </IconSearchButton>
</Tooltip> </Tooltip>
@ -173,22 +173,22 @@ class Header extends Component<IProps, IState> {
<AccountCircle /> <AccountCircle />
</IconButton> </IconButton>
<Menu <Menu
anchorEl={ anchorEl } anchorEl={anchorEl}
anchorOrigin={ { anchorOrigin={{
vertical: 'top', vertical: 'top',
horizontal: 'right', horizontal: 'right',
} } }}
id={'sidebar-menu'} id={'sidebar-menu'}
onClose={ this.handleLoggedInMenuClose } onClose={this.handleLoggedInMenuClose}
open={ open } open={open}
transformOrigin={ { transformOrigin={{
vertical: 'top', vertical: 'top',
horizontal: 'right', horizontal: 'right',
} } }}
> >
<MenuItem disabled={ true }> <MenuItem disabled={true}>
<Greetings>{`Hi,`}</Greetings> <Greetings>{`Hi,`}</Greetings>
<Label capitalize={true} limit={ 140 } text={ username } weight={ 'bold' } /> <Label capitalize={true} limit={140} text={username} weight={'bold'} />
</MenuItem> </MenuItem>
<MenuItem id={'header--button-logout'} onClick={onLogout}> <MenuItem id={'header--button-logout'} onClick={onLogout}>
Logout Logout
@ -202,7 +202,7 @@ class Header extends Component<IProps, IState> {
const { scope } = this.props; const { scope } = this.props;
const { openInfoDialog, registryUrl } = this.state; const { openInfoDialog, registryUrl } = this.state;
return ( return (
<RegistryInfoDialog onClose={ this.handleCloseRegistryInfoDialog } open={ openInfoDialog }> <RegistryInfoDialog onClose={this.handleCloseRegistryInfoDialog} open={openInfoDialog}>
<div> <div>
<CopyToClipBoard text={`npm set ${scope} registry ${registryUrl}`} /> <CopyToClipBoard text={`npm set ${scope} registry ${registryUrl}`} />
<CopyToClipBoard text={`npm adduser --registry ${registryUrl}`} /> <CopyToClipBoard text={`npm adduser --registry ${registryUrl}`} />
@ -216,7 +216,7 @@ class Header extends Component<IProps, IState> {
const { withoutSearch = false } = this.props; const { withoutSearch = false } = this.props;
return ( return (
<div> <div>
<NavBar position={ 'static' }> <NavBar position={'static'}>
<InnerNavBar> <InnerNavBar>
{this.renderLeftSide()} {this.renderLeftSide()}
{this.renderRightSide()} {this.renderRightSide()}
@ -229,7 +229,7 @@ class Header extends Component<IProps, IState> {
<InnerMobileNavBar> <InnerMobileNavBar>
<Search /> <Search />
</InnerMobileNavBar> </InnerMobileNavBar>
<Button color={ 'inherit' } onClick={ this.handleDismissMNav }> <Button color={'inherit'} onClick={this.handleDismissMNav}>
Cancel Cancel
</Button> </Button>
</MobileNavBar> </MobileNavBar>

View file

@ -1,19 +1,19 @@
/** /**
* @prettier * @prettier
* @flow * @flow
*/ */
export interface IProps { export interface IProps {
username?: string; username?: string;
onLogout?: Function; onLogout?: Function;
toggleLoginModal: Function; onToggleLoginModal: Function;
scope: string; scope: string;
withoutSearch?: boolean; withoutSearch?: boolean;
} }
export interface IState { export interface IState {
anchorEl?: any; anchorEl?: any;
openInfoDialog: boolean; openInfoDialog: boolean;
registryUrl: string; registryUrl: string;
showMobileNavBar: boolean; showMobileNavBar: boolean;
} }

View file

@ -9,9 +9,7 @@ import { IProps } from './types';
const NotFound = ({ pkg }: IProps) => ( const NotFound = ({ pkg }: IProps) => (
<Wrapper> <Wrapper>
<h1>Error 404 - <h1>Error 404 -{pkg}</h1>
{pkg}
</h1>
<hr /> <hr />
<p>Oops, The package you are trying to access does not exist.</p> <p>Oops, The package you are trying to access does not exist.</p>
</Wrapper> </Wrapper>

View file

@ -38,7 +38,7 @@ const getInitialsName = (name: string) =>
.toUpperCase(); .toUpperCase();
const Package = ({ name: label, version, time, author: { name, avatar }, description, license, keywords = [] }: IProps): Element<Wrapper> => ( const Package = ({ name: label, version, time, author: { name, avatar }, description, license, keywords = [] }: IProps): Element<Wrapper> => (
<Wrapper className={ 'package' } to={ `detail/${label}` }> <Wrapper className={'package'} to={`detail/${label}`}>
<Header> <Header>
<MainInfo> <MainInfo>
<Name>{label}</Name> <Name>{label}</Name>
@ -47,12 +47,13 @@ const Package = ({ name: label, version, time, author: { name, avatar }, descrip
<Overview> <Overview>
{license && ( {license && (
<OverviewItem> <OverviewItem>
<Icon modifiers={ spacing('margin', '4px', '5px', '0px', '0px') } name={ 'license' } pointer={true} /> <Icon modifiers={spacing('margin', '4px', '5px', '0px', '0px')} name={'license'} pointer={true} />
{license} {license}
</OverviewItem> </OverviewItem>
)} )}
<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> <Published modifiers={spacing('margin', '0px', '5px', '0px', '0px')}>{`Published on ${formatDate(time)}`}</Published>
{`${formatDateDistance(time)} ago`} {`${formatDateDistance(time)} ago`}
</OverviewItem> </OverviewItem>

View file

@ -155,21 +155,23 @@ class Search extends Component<IProps, IState> {
return ( return (
<AutoComplete <AutoComplete
suggestions={suggestions}
suggestionsLoaded={loaded}
suggestionsLoading={loading}
suggestionsError={error}
value={search}
placeholder={CONSTANTS.PLACEHOLDER_TEXT}
color={colors.white} color={colors.white}
onBlur={this.onBlur}
onChange={this.handleSearch}
onCleanSuggestions={this.handlePackagesClearRequested}
onClick={this.handleClionSuggestionsFetch={this.handleFetchPackages}.PLAC
startAdornment={ startAdornment={
(<InputAdornment position="start" style={{ color: colors.white }}> <InputAdornment position="start" style={{ color: colors.white }}>
<IconSearch /> <IconSearch />
</InputAdornment>) </InputAdornment>
} }
onSuggestionsFetch={ this.handleFetchPackages } onSuggestionsFetch={this.handleFetchPackages}
onCleanSuggestions={ this.handlePackagesClearRequested } onCleanSuggestions={this.handlePackagesClearRequested}
onClick={ this.handleClickSearch } onClick={this.handleClickSearch}
onChange={ this.handleSearch } onChange={this.handleSearch}
onBlur={ this.onBlur } onBlur={this.onBlur}
/> />
); );
} }

View file

@ -9,8 +9,8 @@ import type { Element } from 'react';
import { IProps } from './types'; import { IProps } from './types';
import { Wrapper } from './styles'; import { Wrapper } from './styles';
const Tag = ({ children }: IProps): Element<Wrapper> => <Wrapper> const Tag = ({ children }: IProps): Element<Wrapper> => (<Wrapper>
{children} {children}
</Wrapper>; </Wrapper>);
export default Tag; export default Tag;

View file

@ -16,7 +16,7 @@
"jest/consistent-test-it": ["error", {"fn": "test"}], "jest/consistent-test-it": ["error", {"fn": "test"}],
"jest/no-jasmine-globals": 2, "jest/no-jasmine-globals": 2,
"jest/expect-expect": [ "jest/expect-expect": [
"error", "warn",
{ {
"assertFunctionNames": ["expect"] "assertFunctionNames": ["expect"]
} }

View file

@ -1,5 +1,5 @@
{ {
"rules": { "rules": {
"jest/expect-expect": 0 "jest/expect-expect": ["warn"]
} }
} }

View file

@ -1,5 +1,5 @@
{ {
"rules": { "rules": {
"jest/expect-expect": 0 "jest/expect-expect": ["warn"]
} }
} }