Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lint): upcoming eslint@8 reported errors #8105

Merged
merged 2 commits into from Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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