Skip to content

Commit e1fcbfb

Browse files
committed
Linter error fixes
1 parent 518551a commit e1fcbfb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+80
-130
lines changed

src/core/components/auth/authorize-btn.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default class AuthorizeBtn extends React.Component {
66
}
77

88
onClick =() => {
9-
let { authActions, authSelectors, errActions} = this.props
9+
let { authActions, authSelectors } = this.props
1010
let definitions = authSelectors.definitionsToAuthorize()
1111

1212
authActions.showDefinitions(definitions)

src/core/components/auth/auths.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,12 @@ export default class Auths extends React.Component {
4242
}
4343

4444
render() {
45-
let { definitions, getComponent, authSelectors, errSelectors, specSelectors } = this.props
45+
let { definitions, getComponent, authSelectors, errSelectors } = this.props
4646
const ApiKeyAuth = getComponent("apiKeyAuth")
4747
const BasicAuth = getComponent("basicAuth")
4848
const Oauth2 = getComponent("oauth2", true)
4949
const Button = getComponent("Button")
50-
const JumpToPath = getComponent("JumpToPath", true)
5150

52-
let specStr = specSelectors.specStr()
5351
let authorized = authSelectors.authorized()
5452

5553
let authorizedAuth = definitions.filter( (definition, key) => {

src/core/components/auth/oauth2.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ export default class Oauth2 extends React.Component {
1616
authSelectors: PropTypes.object.isRequired,
1717
authActions: PropTypes.object.isRequired,
1818
errSelectors: PropTypes.object.isRequired,
19-
errActions: PropTypes.object.isRequired
19+
errActions: PropTypes.object.isRequired,
20+
getConfigs: PropTypes.function
2021
}
2122

2223
constructor(props, context) {

src/core/components/errors.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { PropTypes } from "react"
2-
import Im, { List } from "immutable"
2+
import { List } from "immutable"
33
import Collapse from "react-collapse"
4-
import sortBy from "lodash/sortBy"
54

65
export default class Errors extends React.Component {
76

src/core/components/execute.jsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { Component, PropTypes } from "react"
2-
import { fromJS } from "immutable"
32

43
export default class Execute extends Component {
54

@@ -29,9 +28,6 @@ export default class Execute extends Component {
2928
onChangeProducesWrapper = ( val ) => this.props.specActions.changeProducesValue([this.props.path, this.props.method], val)
3029

3130
render(){
32-
let { getComponent, operation, specActions, path, method } = this.props
33-
const ContentType = getComponent( "contentType" )
34-
3531
return (
3632
<button className="btn execute opblock-control__btn" onClick={ this.onClick }>
3733
Execute

src/core/components/layout-utils.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import React, { PropTypes } from "react"
22
import OriCollapse from "react-collapse"
33
import _Markdown from "react-remarkable"
44

5-
const noop = () => {}
6-
75
function xclass(...args) {
86
return args.filter(a => !!a).join(" ").trim()
97
}
@@ -44,12 +42,14 @@ export class Col extends React.Component {
4442
const {
4543
hide,
4644
keepContents,
47-
48-
mobile, /* we don't want these in the final component, since React now complains. So we extract them */
45+
/* we don't want these in the `rest` object that passes to the final component,
46+
since React now complains. So we extract them */
47+
/* eslint-disable no-unused-vars */
48+
mobile,
4949
tablet,
5050
desktop,
5151
large,
52-
52+
/* eslint-enable no-unused-vars */
5353
...rest
5454
} = this.props
5555

src/core/components/model.jsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { Component, PropTypes } from "react"
22
import ImPropTypes from "react-immutable-proptypes"
3-
import isObject from "lodash/isObject"
43
import { List } from "immutable"
54
const braceOpen = "{"
65
const braceClose = "}"
@@ -128,7 +127,6 @@ class Primitive extends Component {
128127
let format = schema.get("format")
129128
let xml = schema.get("xml")
130129
let enumArray = schema.get("enum")
131-
let description = schema.get("description")
132130
let properties = schema.filter( ( v, key) => ["enum", "type", "format", "$$ref"].indexOf(key) === -1 )
133131
let style = required ? { fontWeight: "bold" } : {}
134132
let propStyle = { color: "#999", fontStyle: "italic" }
@@ -251,9 +249,6 @@ export default class ModelComponent extends Component {
251249
}
252250

253251
render(){
254-
let { name, schema } = this.props
255-
let title = schema.get("title") || name
256-
257252
return <div className="model-box">
258253
<Model { ...this.props } depth={ 1 } expandDepth={ this.props.expandDepth || 0 }/>
259254
</div>

src/core/components/models.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import React, { Component, PropTypes } from "react"
44
export default class Models extends Component {
55
static propTypes = {
66
getComponent: PropTypes.func,
7-
specSelectors: PropTypes.object
7+
specSelectors: PropTypes.object,
8+
layoutSelectors: PropTypes.object,
9+
layoutActions: PropTypes.object
810
}
911

1012
render(){

src/core/components/online-validator-badge.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
import React from "react"
1+
import React, { PropTypes } from "react"
22

33
export default class OnlineValidatorBadge extends React.Component {
4+
static propTypes = {
5+
getComponent: PropTypes.func.isRequired,
6+
getConfigs: PropTypes.func.isRequired,
7+
specSelectors: PropTypes.object.isRequired
8+
}
9+
410
constructor(props, context) {
511
super(props, context)
612
let { specSelectors, getConfigs } = props

src/core/components/operation.jsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { PropTypes } from "react"
2-
import { Map, fromJS } from "immutable"
32
import shallowCompare from "react-addons-shallow-compare"
43
import { getList } from "core/utils"
54
import * as CustomPropTypes from "core/proptypes"
@@ -112,9 +111,7 @@ export default class Operation extends React.Component {
112111
specActions,
113112
specSelectors,
114113
authActions,
115-
authSelectors,
116-
layoutSelectors,
117-
layoutActions,
114+
authSelectors
118115
} = this.props
119116

120117
let summary = operation.get("summary")

src/core/components/operations.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { PropTypes } from "react"
2-
import {presets} from "react-motion"
32

43
export default class Operations extends React.Component {
54

@@ -33,7 +32,6 @@ export default class Operations extends React.Component {
3332

3433
const Operation = getComponent("operation")
3534
const Collapse = getComponent("Collapse")
36-
const Schemes = getComponent("schemes")
3735

3836
let showSummary = layoutSelectors.showSummary()
3937

src/core/components/overview.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export default class Overview extends React.Component {
3030
{
3131
taggedOps.map( (tagObj, tag) => {
3232
let operations = tagObj.get("operations")
33-
let tagDetails = tagObj.get("tagDetails")
3433

3534
let showTagId = ["overview-tags", tag]
3635
let showTag = layoutSelectors.isShown(showTagId, true)
@@ -45,7 +44,7 @@ export default class Overview extends React.Component {
4544
<Collapse isOpened={showTag} animated>
4645
{
4746
operations.map( op => {
48-
let { path, method, operation, id } = op.toObject() // toObject is shallow
47+
let { path, method, id } = op.toObject() // toObject is shallow
4948
let showOpIdPrefix = "operations"
5049
let showOpId = id
5150
let shown = layoutSelectors.isShown([showOpIdPrefix, showOpId])

src/core/components/param-body.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component, PropTypes } from "react"
22
import shallowCompare from "react-addons-shallow-compare"
3-
import { Set, fromJS, List } from "immutable"
3+
import { fromJS, List } from "immutable"
44
import { getSampleSchema } from "core/utils"
55

66
const NOOP = Function.prototype
@@ -50,7 +50,7 @@ export default class ParamBody extends Component {
5050
}
5151

5252
updateValues = (props) => {
53-
let { specSelectors, pathMethod, param, isExecute, consumesValue="", onChangeConsumes } = props
53+
let { specSelectors, pathMethod, param, isExecute, consumesValue="" } = props
5454
let parameter = specSelectors ? specSelectors.getParameter(pathMethod, param.get("name")) : {}
5555
let isXml = /xml/i.test(consumesValue)
5656
let paramValue = isXml ? parameter.get("value_xml") : parameter.get("value")

src/core/components/parameters.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component, PropTypes } from "react"
22
import ImPropTypes from "react-immutable-proptypes"
3-
import Im, { fromJS } from "immutable"
3+
import Im from "immutable"
44

55
// More readable, just iterate over maps, only
66
const eachMap = (iterable, fn) => iterable.valueSeq().filter(Im.Map.isMap).map(fn)
@@ -87,7 +87,7 @@ export default class Parameters extends Component {
8787
</thead>
8888
<tbody>
8989
{
90-
eachMap(parameters, (parameter, k) => (
90+
eachMap(parameters, (parameter) => (
9191
<ParameterRow fn={ fn }
9292
getComponent={ getComponent }
9393
param={ parameter }

src/core/components/schemes.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ export default class Schemes extends React.Component {
1717
}
1818

1919
onChange =( e ) => {
20-
let { path, method, specActions } = this.props
21-
2220
this.setScheme( e.target.value )
2321
}
2422

src/core/components/try-it-out-button.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ export default class TryItOutButton extends React.Component {
44

55
static propTypes = {
66
onTryoutClick: PropTypes.func,
7+
onCancelClick: PropTypes.func,
78
enabled: PropTypes.bool, // Try it out is enabled, ie: the user has access to the form
89
};
910

1011
static defaultProps = {
1112
onTryoutClick: Function.prototype,
13+
onCancelClick: Function.prototype,
1214
enabled: false,
1315
};
1416

src/core/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ module.exports = function SwaggerUI(opts) {
6868
var system = store.getSystem()
6969
let queryConfig = parseSeach()
7070

71-
const downloadSpec = (configs) => {
71+
const downloadSpec = () => {
7272
if(typeof constructorConfig !== "object") {
7373
return system
7474
}
@@ -96,7 +96,7 @@ module.exports = function SwaggerUI(opts) {
9696
}
9797

9898
if (!system.specActions.getConfigByUrl || (system.specActions.getConfigByUrl && !system.specActions.getConfigByUrl(downloadSpec))) {
99-
return downloadSpec(constructorConfig)
99+
return downloadSpec()
100100
}
101101

102102
}

src/core/json-schema-components.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import React, { PropTypes, Component } from "react"
2-
import { arrayify } from "core/utils"
32
import shallowCompare from "react-addons-shallow-compare"
43
import { List, fromJS } from "immutable"
5-
import assign from "object-assign"
64
//import "less/json-schema-form"
75

86
const noop = ()=> {}
@@ -53,7 +51,7 @@ export class JsonSchema_string extends Component {
5351
}
5452
onEnumChange = (val) => this.props.onChange(val)
5553
render() {
56-
let { getComponent, value, schema, fn, required, description } = this.props
54+
let { getComponent, value, schema, required, description } = this.props
5755
let enumValue = schema["enum"]
5856
let errors = schema.errors || []
5957

@@ -119,13 +117,13 @@ export class JsonSchema_array extends Component {
119117
}
120118

121119
onEnumChange = (value) => {
122-
this.setState(state => ({
120+
this.setState(() => ({
123121
value: value
124122
}), this.onChange)
125123
}
126124

127125
render() {
128-
let { getComponent, onChange, required, schema, fn } = this.props
126+
let { getComponent, required, schema, fn } = this.props
129127

130128
let itemSchema = fn.inferSchema(schema.items)
131129

src/core/path-translator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function transformPathToArray(property, jsSpec) {
2626
return a.concat(b)
2727
}, [])
2828
.concat([""]) // add an empty item into the array, so we don't get stuck with something in our buffer below
29-
.reduce((buffer, curr, i, arr) => {
29+
.reduce((buffer, curr) => {
3030
let obj = pathArr.length ? get(jsSpec, pathArr) : jsSpec
3131

3232
if(get(obj, makeAccessArray(buffer, curr))) {

src/core/plugins/ast/ast.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,6 @@ export let getLineNumberForPathAsync = promisifySyncFn(getLineNumberForPath)
277277

278278
function promisifySyncFn(fn) {
279279
return function(...args) {
280-
return new Promise(function(resolve, reject) {
281-
resolve(fn(...args))
282-
})
280+
return new Promise((resolve) => resolve(fn(...args)))
283281
}
284282
}

src/core/plugins/auth/reducers.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import btoa from "btoa"
44
import {
55
SHOW_AUTH_POPUP,
66
AUTHORIZE,
7-
PRE_AUTHORIZE_OAUTH2,
87
AUTHORIZE_OAUTH2,
98
LOGOUT
109
} from "./actions"
@@ -21,7 +20,6 @@ export default {
2120
// refactor withMutations
2221
securities.entrySeq().forEach( ([ key, security ]) => {
2322
let type = security.getIn(["schema", "type"])
24-
let name = security.get("name")
2523

2624
if ( type === "apiKey" ) {
2725
map = map.set(key, security)

src/core/plugins/auth/selectors.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const shownDefinitions = createSelector(
1010

1111
export const definitionsToAuthorize = createSelector(
1212
state,
13-
auth =>( { specSelectors } ) => {
13+
() =>( { specSelectors } ) => {
1414
let definitions = specSelectors.securityDefinitions()
1515
let list = List()
1616

@@ -66,7 +66,6 @@ export const authorized = createSelector(
6666

6767
export const isAuthorized = ( state, securities ) =>( { authSelectors } ) => {
6868
let authorized = authSelectors.authorized()
69-
let isAuth = false
7069

7170
return !!securities.toJS().filter( ( security ) => {
7271
let isAuthorized = true
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { Map } from "immutable"
2-
31
// Add security to the final `execute` call ( via `extras` )
42
export const execute = ( oriAction, { authSelectors, specSelectors }) => ({ path, method, operation, extras }) => {
53
let securities = {
@@ -10,4 +8,3 @@ export const execute = ( oriAction, { authSelectors, specSelectors }) => ({ path
108

119
return oriAction({ path, method, operation, securities, ...extras })
1210
}
13-

src/core/plugins/download-url.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { createSelector } from "reselect"
44
import { Map } from "immutable"
55

66
export default function downloadUrlPlugin (toolbox) {
7-
let { fn, Im } = toolbox
7+
let { fn } = toolbox
88

99
const actions = {
1010
download: (url)=> ({ errActions, specSelectors, specActions }) => {

src/core/plugins/err/actions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ export function newThrownErrBatch(errors) {
2020
}
2121
}
2222

23-
export function newSpecErr(err, action) {
23+
export function newSpecErr(err) {
2424
return {
2525
type: NEW_SPEC_ERR,
2626
payload: err
2727
}
2828
}
2929

30-
export function newAuthErr(err, action) {
30+
export function newAuthErr(err) {
3131
return {
3232
type: NEW_AUTH_ERR,
3333
payload: err

src/core/plugins/err/error-transformers/hook.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import concat from "lodash/concat"
21
import reduce from "lodash/reduce"
32
let request = require.context("./transformers/", true, /\.js$/)
43
let errorTransformers = []

src/core/plugins/err/error-transformers/transformers/parameter-oneof.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import get from "lodash/get"
2-
import last from "lodash/get"
3-
import { fromJS, List } from "immutable"
2+
import { fromJS } from "immutable"
43

54
export function transform(errors, { jsSpec }) {
65
// LOOK HERE THIS TRANSFORMER IS CURRENTLY DISABLED 😃

0 commit comments

Comments
 (0)