Skip to content

Commit

Permalink
fix(lint): upcoming eslint@8 reported errors (#8105)
Browse files Browse the repository at this point in the history
* fix: duplicate propTypes

* chore(lint): fix extra semicolon
  • Loading branch information
tim-lai committed Jul 19, 2022
1 parent 15284a0 commit d68b748
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 45 deletions.
12 changes: 3 additions & 9 deletions src/core/components/auth/auth-item.jsx
Expand Up @@ -4,10 +4,12 @@ import ImPropTypes from "react-immutable-proptypes"

export default class Auths extends React.Component {
static propTypes = {
authorized: ImPropTypes.orderedMap.isRequired,
schema: ImPropTypes.orderedMap.isRequired,
name: PropTypes.string.isRequired,
getComponent: PropTypes.func.isRequired,
onAuthChange: PropTypes.func.isRequired,
authorized: ImPropTypes.orderedMap.isRequired
errSelectors: PropTypes.object.isRequired,
}

render() {
Expand Down Expand Up @@ -51,12 +53,4 @@ export default class Auths extends React.Component {
</div>)
}

static propTypes = {
errSelectors: PropTypes.object.isRequired,
getComponent: PropTypes.func.isRequired,
authSelectors: PropTypes.object.isRequired,
specSelectors: PropTypes.object.isRequired,
authActions: PropTypes.object.isRequired,
definitions: ImPropTypes.iterable.isRequired
}
}
11 changes: 2 additions & 9 deletions src/core/components/auth/auths.jsx
Expand Up @@ -4,10 +4,11 @@ import ImPropTypes from "react-immutable-proptypes"

export default class Auths extends React.Component {
static propTypes = {
definitions: PropTypes.object.isRequired,
definitions: ImPropTypes.iterable.isRequired,
getComponent: PropTypes.func.isRequired,
authSelectors: PropTypes.object.isRequired,
authActions: PropTypes.object.isRequired,
errSelectors: PropTypes.object.isRequired,
specSelectors: PropTypes.object.isRequired
}

Expand Down Expand Up @@ -119,12 +120,4 @@ export default class Auths extends React.Component {
)
}

static propTypes = {
errSelectors: PropTypes.object.isRequired,
getComponent: PropTypes.func.isRequired,
authSelectors: PropTypes.object.isRequired,
specSelectors: PropTypes.object.isRequired,
authActions: PropTypes.object.isRequired,
definitions: ImPropTypes.iterable.isRequired
}
}
16 changes: 5 additions & 11 deletions src/core/components/auth/basic-auth.jsx
Expand Up @@ -4,10 +4,12 @@ import ImPropTypes from "react-immutable-proptypes"

export default class BasicAuth extends React.Component {
static propTypes = {
authorized: PropTypes.object,
authorized: ImPropTypes.map,
schema: ImPropTypes.map,
getComponent: PropTypes.func.isRequired,
schema: PropTypes.object.isRequired,
onChange: PropTypes.func.isRequired
onChange: PropTypes.func.isRequired,
name: PropTypes.string.isRequired,
errSelectors: PropTypes.object.isRequired,
}

constructor(props, context) {
Expand Down Expand Up @@ -89,12 +91,4 @@ export default class BasicAuth extends React.Component {
)
}

static propTypes = {
name: PropTypes.string.isRequired,
errSelectors: PropTypes.object.isRequired,
getComponent: PropTypes.func.isRequired,
onChange: PropTypes.func,
schema: ImPropTypes.map,
authorized: ImPropTypes.map
}
}
2 changes: 1 addition & 1 deletion src/core/components/headers.jsx
Expand Up @@ -8,7 +8,7 @@ export default class Headers extends React.Component {
static propTypes = {
headers: PropTypes.object.isRequired,
getComponent: PropTypes.func.isRequired
};
}

render() {
let { headers, getComponent } = this.props
Expand Down
8 changes: 1 addition & 7 deletions src/core/components/live-response.jsx
@@ -1,7 +1,6 @@
import React from "react"
import PropTypes from "prop-types"
import ImPropTypes from "react-immutable-proptypes"
import { Iterable } from "immutable"

const Headers = ( { headers } )=>{
return (
Expand Down Expand Up @@ -29,7 +28,7 @@ Duration.propTypes = {

export default class LiveResponse extends React.Component {
static propTypes = {
response: PropTypes.instanceOf(Iterable).isRequired,
response: ImPropTypes.map,
path: PropTypes.string.isRequired,
method: PropTypes.string.isRequired,
displayRequestDuration: PropTypes.bool.isRequired,
Expand Down Expand Up @@ -130,9 +129,4 @@ export default class LiveResponse extends React.Component {
</div>
)
}

static propTypes = {
getComponent: PropTypes.func.isRequired,
response: ImPropTypes.map
}
}
2 changes: 1 addition & 1 deletion src/core/components/operations.jsx
Expand Up @@ -23,7 +23,7 @@ export default class Operations extends React.Component {
authSelectors: PropTypes.object.isRequired,
getConfigs: PropTypes.func.isRequired,
fn: PropTypes.func.isRequired
};
}

render() {
let {
Expand Down
4 changes: 2 additions & 2 deletions src/core/components/param-body.jsx
Expand Up @@ -20,14 +20,14 @@ export default class ParamBody extends PureComponent {
isExecute: PropTypes.bool,
specSelectors: PropTypes.object.isRequired,
pathMethod: PropTypes.array.isRequired
};
}

static defaultProp = {
consumes: fromJS(["application/json"]),
param: fromJS({}),
onChange: NOOP,
onChangeConsumes: NOOP,
};
}

constructor(props, context) {
super(props, context)
Expand Down
2 changes: 1 addition & 1 deletion src/core/components/response.jsx
Expand Up @@ -54,7 +54,7 @@ export default class Response extends React.Component {
static defaultProps = {
response: fromJS({}),
onContentTypeChange: () => {}
};
}

_onContentTypeChange = (value) => {
const { onContentTypeChange, controlsAcceptHeader } = this.props
Expand Down
4 changes: 2 additions & 2 deletions src/core/components/try-it-out-button.jsx
Expand Up @@ -10,7 +10,7 @@ export default class TryItOutButton extends React.Component {
enabled: PropTypes.bool, // Try it out is enabled, ie: the user has access to the form
hasUserEditedBody: PropTypes.bool, // Try it out is enabled, ie: the user has access to the form
isOAS3: PropTypes.bool, // Try it out is enabled, ie: the user has access to the form
};
}

static defaultProps = {
onTryoutClick: Function.prototype,
Expand All @@ -19,7 +19,7 @@ export default class TryItOutButton extends React.Component {
enabled: false,
hasUserEditedBody: false,
isOAS3: false,
};
}

render() {
const { onTryoutClick, onCancelClick, onResetClick, enabled, hasUserEditedBody, isOAS3 } = this.props
Expand Down
4 changes: 2 additions & 2 deletions src/core/plugins/oas3/components/request-body-editor.jsx
Expand Up @@ -13,12 +13,12 @@ export default class RequestBodyEditor extends PureComponent {
value: PropTypes.string,
defaultValue: PropTypes.string,
errors: PropTypes.array,
};
}

static defaultProps = {
onChange: NOOP,
userHasEditedBody: false,
};
}

constructor(props, context) {
super(props, context)
Expand Down

0 comments on commit d68b748

Please sign in to comment.