Linter error fixes

This commit is contained in:
Kyle Shockey
2017-03-23 16:36:45 -07:00
parent 518551a5dd
commit e1fcbfbf09
44 changed files with 80 additions and 130 deletions

View File

@@ -277,8 +277,6 @@ export let getLineNumberForPathAsync = promisifySyncFn(getLineNumberForPath)
function promisifySyncFn(fn) {
return function(...args) {
return new Promise(function(resolve, reject) {
resolve(fn(...args))
})
return new Promise((resolve) => resolve(fn(...args)))
}
}

View File

@@ -4,7 +4,6 @@ import btoa from "btoa"
import {
SHOW_AUTH_POPUP,
AUTHORIZE,
PRE_AUTHORIZE_OAUTH2,
AUTHORIZE_OAUTH2,
LOGOUT
} from "./actions"
@@ -21,7 +20,6 @@ export default {
// refactor withMutations
securities.entrySeq().forEach( ([ key, security ]) => {
let type = security.getIn(["schema", "type"])
let name = security.get("name")
if ( type === "apiKey" ) {
map = map.set(key, security)

View File

@@ -10,7 +10,7 @@ export const shownDefinitions = createSelector(
export const definitionsToAuthorize = createSelector(
state,
auth =>( { specSelectors } ) => {
() =>( { specSelectors } ) => {
let definitions = specSelectors.securityDefinitions()
let list = List()
@@ -66,7 +66,6 @@ export const authorized = createSelector(
export const isAuthorized = ( state, securities ) =>( { authSelectors } ) => {
let authorized = authSelectors.authorized()
let isAuth = false
return !!securities.toJS().filter( ( security ) => {
let isAuthorized = true

View File

@@ -1,5 +1,3 @@
import { Map } from "immutable"
// Add security to the final `execute` call ( via `extras` )
export const execute = ( oriAction, { authSelectors, specSelectors }) => ({ path, method, operation, extras }) => {
let securities = {
@@ -10,4 +8,3 @@ export const execute = ( oriAction, { authSelectors, specSelectors }) => ({ path
return oriAction({ path, method, operation, securities, ...extras })
}

View File

@@ -4,7 +4,7 @@ import { createSelector } from "reselect"
import { Map } from "immutable"
export default function downloadUrlPlugin (toolbox) {
let { fn, Im } = toolbox
let { fn } = toolbox
const actions = {
download: (url)=> ({ errActions, specSelectors, specActions }) => {

View File

@@ -20,14 +20,14 @@ export function newThrownErrBatch(errors) {
}
}
export function newSpecErr(err, action) {
export function newSpecErr(err) {
return {
type: NEW_SPEC_ERR,
payload: err
}
}
export function newAuthErr(err, action) {
export function newAuthErr(err) {
return {
type: NEW_AUTH_ERR,
payload: err

View File

@@ -1,4 +1,3 @@
import concat from "lodash/concat"
import reduce from "lodash/reduce"
let request = require.context("./transformers/", true, /\.js$/)
let errorTransformers = []

View File

@@ -1,6 +1,5 @@
import get from "lodash/get"
import last from "lodash/get"
import { fromJS, List } from "immutable"
import { fromJS } from "immutable"
export function transform(errors, { jsSpec }) {
// LOOK HERE THIS TRANSFORMER IS CURRENTLY DISABLED 😃

View File

@@ -184,7 +184,7 @@ export const logRequest = (req) => {
// Actually fire the request via fn.execute
// (For debugging) and ease of testing
export const executeRequest = (req) => ({fn, specActions, errActions}) => {
export const executeRequest = (req) => ({fn, specActions}) => {
let { pathName, method } = req
let parsedRequest = Object.assign({}, req)
if ( pathName && method ) {

View File

@@ -51,7 +51,6 @@ export default {
[VALIDATE_PARAMS]: ( state, { payload: { pathMethod } } ) => {
let operation = state.getIn( [ "resolved", "paths", ...pathMethod ] )
let parameters = operation.get("parameters")
let isXml = /xml/i.test(operation.get("consumes_value"))
return state.updateIn( [ "resolved", "paths", ...pathMethod, "parameters" ], fromJS([]), parameters => {
@@ -64,9 +63,6 @@ export default {
})
},
[ClEAR_VALIDATE_PARAMS]: ( state, { payload: { pathMethod } } ) => {
let operation = state.getIn( [ "resolved", "paths", ...pathMethod ] )
let parameters = operation.get("parameters")
return state.updateIn( [ "resolved", "paths", ...pathMethod, "parameters" ], fromJS([]), parameters => {
return parameters.withMutations( parameters => {
for ( let i = 0, len = parameters.count(); i < len; i++ ) {

View File

@@ -224,7 +224,7 @@ export const requestFor = (state, path, method) => {
return requests(state).getIn([path, method], null)
}
export const allowTryItOutFor = (state, path, method ) => {
export const allowTryItOutFor = () => {
// This is just a hook for now.
return true
}

View File

@@ -3,10 +3,6 @@ import ReactDOM from "react-dom"
import { connect, Provider } from "react-redux"
import omit from "lodash/omit"
const NotFoundComponent = name => ()=> <span style={{color: "red"}}> "{name}" component not found </span>
const SystemWrapper = (getSystem, ComponentToWrap ) => class extends Component {
render() {
return <ComponentToWrap {...getSystem() } {...this.props} {...this.context} />
@@ -75,10 +71,10 @@ const createClass = component => React.createClass({
}
})
const Fallback = ({ error, name }) => <div style={{ // eslint-disable-line react/prop-types
const Fallback = ({ name }) => <div style={{ // eslint-disable-line react/prop-types
padding: "1em",
"color": "#aaa"
}}>😱 <i>Could not render { name ? name : "this component" }, see console.</i></div>
}}>😱 <i>Could not render { name || name === "t" ? name : "this component" }, see the console.</i></div>
const wrapRender = (component) => {
const isStateless = component => !(component.prototype && component.prototype.isReactComponent)