mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -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"
|
||||
|
|
|
@ -41,10 +41,10 @@ export default class App extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
loadLogo = async () => {
|
||||
loadLogo = async () => {
|
||||
const logoUrl = await logo();
|
||||
this.setState({
|
||||
logoUrl
|
||||
this.setState({
|
||||
logoUrl
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ export default class App extends Component {
|
|||
try {
|
||||
this.req = await API.request('packages', 'GET');
|
||||
this.setState({
|
||||
packages: this.req,
|
||||
packages: this.req,
|
||||
isLoading: false
|
||||
});
|
||||
} catch (error) {
|
||||
|
@ -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
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -115,7 +115,7 @@ class Header extends Component<IProps, IState> {
|
|||
const { withoutSearch = false } = this.props;
|
||||
return (
|
||||
<LeftSide>
|
||||
<Link style={ { marginRight: '1em' } } to={ '/' }>
|
||||
<Link style={{ marginRight: '1em' }} to={'/'}>
|
||||
<Logo />
|
||||
</Link>
|
||||
{!withoutSearch && (
|
||||
|
@ -134,7 +134,7 @@ class Header extends Component<IProps, IState> {
|
|||
<RightSide>
|
||||
{!withoutSearch && (
|
||||
<Tooltip disableFocusListener={true} title={'Search packages'}>
|
||||
<IconSearchButton color={ 'inherit' } onClick={ this.handleToggleMNav }>
|
||||
<IconSearchButton color={'inherit'} onClick={this.handleToggleMNav}>
|
||||
<IconSearch />
|
||||
</IconSearchButton>
|
||||
</Tooltip>
|
||||
|
@ -173,22 +173,22 @@ class Header extends Component<IProps, IState> {
|
|||
<AccountCircle />
|
||||
</IconButton>
|
||||
<Menu
|
||||
anchorEl={ anchorEl }
|
||||
anchorOrigin={ {
|
||||
anchorEl={anchorEl}
|
||||
anchorOrigin={{
|
||||
vertical: 'top',
|
||||
horizontal: 'right',
|
||||
} }
|
||||
}}
|
||||
id={'sidebar-menu'}
|
||||
onClose={ this.handleLoggedInMenuClose }
|
||||
open={ open }
|
||||
transformOrigin={ {
|
||||
onClose={this.handleLoggedInMenuClose}
|
||||
open={open}
|
||||
transformOrigin={{
|
||||
vertical: 'top',
|
||||
horizontal: 'right',
|
||||
} }
|
||||
}}
|
||||
>
|
||||
<MenuItem disabled={ true }>
|
||||
<MenuItem disabled={true}>
|
||||
<Greetings>{`Hi,`}</Greetings>
|
||||
<Label capitalize={true} limit={ 140 } text={ username } weight={ 'bold' } />
|
||||
<Label capitalize={true} limit={140} text={username} weight={'bold'} />
|
||||
</MenuItem>
|
||||
<MenuItem id={'header--button-logout'} onClick={onLogout}>
|
||||
Logout
|
||||
|
@ -202,7 +202,7 @@ class Header extends Component<IProps, IState> {
|
|||
const { scope } = this.props;
|
||||
const { openInfoDialog, registryUrl } = this.state;
|
||||
return (
|
||||
<RegistryInfoDialog onClose={ this.handleCloseRegistryInfoDialog } open={ openInfoDialog }>
|
||||
<RegistryInfoDialog onClose={this.handleCloseRegistryInfoDialog} open={openInfoDialog}>
|
||||
<div>
|
||||
<CopyToClipBoard text={`npm set ${scope} registry ${registryUrl}`} />
|
||||
<CopyToClipBoard text={`npm adduser --registry ${registryUrl}`} />
|
||||
|
@ -216,7 +216,7 @@ class Header extends Component<IProps, IState> {
|
|||
const { withoutSearch = false } = this.props;
|
||||
return (
|
||||
<div>
|
||||
<NavBar position={ 'static' }>
|
||||
<NavBar position={'static'}>
|
||||
<InnerNavBar>
|
||||
{this.renderLeftSide()}
|
||||
{this.renderRightSide()}
|
||||
|
@ -229,7 +229,7 @@ class Header extends Component<IProps, IState> {
|
|||
<InnerMobileNavBar>
|
||||
<Search />
|
||||
</InnerMobileNavBar>
|
||||
<Button color={ 'inherit' } onClick={ this.handleDismissMNav }>
|
||||
<Button color={'inherit'} onClick={this.handleDismissMNav}>
|
||||
Cancel
|
||||
</Button>
|
||||
</MobileNavBar>
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
/**
|
||||
* @prettier
|
||||
* @flow
|
||||
*/
|
||||
|
||||
export interface IProps {
|
||||
username?: string;
|
||||
onLogout?: Function;
|
||||
toggleLoginModal: Function;
|
||||
scope: string;
|
||||
withoutSearch?: boolean;
|
||||
}
|
||||
|
||||
export interface IState {
|
||||
anchorEl?: any;
|
||||
openInfoDialog: boolean;
|
||||
registryUrl: string;
|
||||
showMobileNavBar: boolean;
|
||||
}
|
||||
/**
|
||||
* @prettier
|
||||
* @flow
|
||||
*/
|
||||
|
||||
export interface IProps {
|
||||
username?: string;
|
||||
onLogout?: Function;
|
||||
onToggleLoginModal: Function;
|
||||
scope: string;
|
||||
withoutSearch?: boolean;
|
||||
}
|
||||
|
||||
export interface IState {
|
||||
anchorEl?: any;
|
||||
openInfoDialog: boolean;
|
||||
registryUrl: string;
|
||||
showMobileNavBar: 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>
|
||||
|
|
|
@ -38,7 +38,7 @@ const getInitialsName = (name: string) =>
|
|||
.toUpperCase();
|
||||
|
||||
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>
|
||||
<MainInfo>
|
||||
<Name>{label}</Name>
|
||||
|
@ -47,12 +47,13 @@ const Package = ({ name: label, version, time, author: { name, avatar }, descrip
|
|||
<Overview>
|
||||
{license && (
|
||||
<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}
|
||||
</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,21 +155,23 @@ 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 }
|
||||
onClick={ this.handleClickSearch }
|
||||
onChange={ this.handleSearch }
|
||||
onBlur={ this.onBlur }
|
||||
onSuggestionsFetch={this.handleFetchPackages}
|
||||
onCleanSuggestions={this.handlePackagesClearRequested}
|
||||
onClick={this.handleClickSearch}
|
||||
onChange={this.handleSearch}
|
||||
onBlur={this.onBlur}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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…
Reference in a new issue