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

* fix: duplicate propTypes

* chore(lint): fix extra semicolon
This commit is contained in:
Tim Lai
2022-07-19 14:46:43 -07:00
committed by GitHub
parent 15284a090d
commit d68b7485b1
10 changed files with 20 additions and 45 deletions

View File

@@ -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() {
@@ -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
}
}

View File

@@ -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
}
@@ -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
}
}

View File

@@ -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) {
@@ -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
}
}

View File

@@ -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

View File

@@ -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 (
@@ -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,
@@ -130,9 +129,4 @@ export default class LiveResponse extends React.Component {
</div>
)
}
static propTypes = {
getComponent: PropTypes.func.isRequired,
response: ImPropTypes.map
}
}

View File

@@ -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 {

View File

@@ -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)

View File

@@ -54,7 +54,7 @@ export default class Response extends React.Component {
static defaultProps = {
response: fromJS({}),
onContentTypeChange: () => {}
};
}
_onContentTypeChange = (value) => {
const { onContentTypeChange, controlsAcceptHeader } = this.props

View File

@@ -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,
@@ -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

View File

@@ -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)