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 { export default class Auths extends React.Component {
static propTypes = { static propTypes = {
authorized: ImPropTypes.orderedMap.isRequired,
schema: ImPropTypes.orderedMap.isRequired, schema: ImPropTypes.orderedMap.isRequired,
name: PropTypes.string.isRequired, name: PropTypes.string.isRequired,
getComponent: PropTypes.func.isRequired,
onAuthChange: PropTypes.func.isRequired, onAuthChange: PropTypes.func.isRequired,
authorized: ImPropTypes.orderedMap.isRequired errSelectors: PropTypes.object.isRequired,
} }
render() { render() {
@@ -51,12 +53,4 @@ export default class Auths extends React.Component {
</div>) </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 { export default class Auths extends React.Component {
static propTypes = { static propTypes = {
definitions: PropTypes.object.isRequired, definitions: ImPropTypes.iterable.isRequired,
getComponent: PropTypes.func.isRequired, getComponent: PropTypes.func.isRequired,
authSelectors: PropTypes.object.isRequired, authSelectors: PropTypes.object.isRequired,
authActions: PropTypes.object.isRequired, authActions: PropTypes.object.isRequired,
errSelectors: PropTypes.object.isRequired,
specSelectors: 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 { export default class BasicAuth extends React.Component {
static propTypes = { static propTypes = {
authorized: PropTypes.object, authorized: ImPropTypes.map,
schema: ImPropTypes.map,
getComponent: PropTypes.func.isRequired, 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) { 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 = { static propTypes = {
headers: PropTypes.object.isRequired, headers: PropTypes.object.isRequired,
getComponent: PropTypes.func.isRequired getComponent: PropTypes.func.isRequired
}; }
render() { render() {
let { headers, getComponent } = this.props let { headers, getComponent } = this.props

View File

@@ -1,7 +1,6 @@
import React from "react" import React from "react"
import PropTypes from "prop-types" import PropTypes from "prop-types"
import ImPropTypes from "react-immutable-proptypes" import ImPropTypes from "react-immutable-proptypes"
import { Iterable } from "immutable"
const Headers = ( { headers } )=>{ const Headers = ( { headers } )=>{
return ( return (
@@ -29,7 +28,7 @@ Duration.propTypes = {
export default class LiveResponse extends React.Component { export default class LiveResponse extends React.Component {
static propTypes = { static propTypes = {
response: PropTypes.instanceOf(Iterable).isRequired, response: ImPropTypes.map,
path: PropTypes.string.isRequired, path: PropTypes.string.isRequired,
method: PropTypes.string.isRequired, method: PropTypes.string.isRequired,
displayRequestDuration: PropTypes.bool.isRequired, displayRequestDuration: PropTypes.bool.isRequired,
@@ -130,9 +129,4 @@ export default class LiveResponse extends React.Component {
</div> </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, authSelectors: PropTypes.object.isRequired,
getConfigs: PropTypes.func.isRequired, getConfigs: PropTypes.func.isRequired,
fn: PropTypes.func.isRequired fn: PropTypes.func.isRequired
}; }
render() { render() {
let { let {

View File

@@ -20,14 +20,14 @@ export default class ParamBody extends PureComponent {
isExecute: PropTypes.bool, isExecute: PropTypes.bool,
specSelectors: PropTypes.object.isRequired, specSelectors: PropTypes.object.isRequired,
pathMethod: PropTypes.array.isRequired pathMethod: PropTypes.array.isRequired
}; }
static defaultProp = { static defaultProp = {
consumes: fromJS(["application/json"]), consumes: fromJS(["application/json"]),
param: fromJS({}), param: fromJS({}),
onChange: NOOP, onChange: NOOP,
onChangeConsumes: NOOP, onChangeConsumes: NOOP,
}; }
constructor(props, context) { constructor(props, context) {
super(props, context) super(props, context)

View File

@@ -54,7 +54,7 @@ export default class Response extends React.Component {
static defaultProps = { static defaultProps = {
response: fromJS({}), response: fromJS({}),
onContentTypeChange: () => {} onContentTypeChange: () => {}
}; }
_onContentTypeChange = (value) => { _onContentTypeChange = (value) => {
const { onContentTypeChange, controlsAcceptHeader } = this.props 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 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 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 isOAS3: PropTypes.bool, // Try it out is enabled, ie: the user has access to the form
}; }
static defaultProps = { static defaultProps = {
onTryoutClick: Function.prototype, onTryoutClick: Function.prototype,
@@ -19,7 +19,7 @@ export default class TryItOutButton extends React.Component {
enabled: false, enabled: false,
hasUserEditedBody: false, hasUserEditedBody: false,
isOAS3: false, isOAS3: false,
}; }
render() { render() {
const { onTryoutClick, onCancelClick, onResetClick, enabled, hasUserEditedBody, isOAS3 } = this.props const { onTryoutClick, onCancelClick, onResetClick, enabled, hasUserEditedBody, isOAS3 } = this.props

View File

@@ -13,12 +13,12 @@ export default class RequestBodyEditor extends PureComponent {
value: PropTypes.string, value: PropTypes.string,
defaultValue: PropTypes.string, defaultValue: PropTypes.string,
errors: PropTypes.array, errors: PropTypes.array,
}; }
static defaultProps = { static defaultProps = {
onChange: NOOP, onChange: NOOP,
userHasEditedBody: false, userHasEditedBody: false,
}; }
constructor(props, context) { constructor(props, context) {
super(props, context) super(props, context)