Skip to content

Commit f195d01

Browse files
committed
Autofix ESLint problems
1 parent 664e44d commit f195d01

File tree

11 files changed

+35
-35
lines changed

11 files changed

+35
-35
lines changed

src/core/components/content-type.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { PropTypes } from "react"
22
import ImPropTypes from "react-immutable-proptypes"
3-
import { fromJS } from 'immutable'
3+
import { fromJS } from "immutable"
44

55
const noop = ()=>{}
66

src/core/components/models.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ export default class Models extends Component {
1010
render(){
1111
let { specSelectors, getComponent, layoutSelectors, layoutActions } = this.props
1212
let definitions = specSelectors.definitions()
13-
let showModels = layoutSelectors.isShown('models', true)
13+
let showModels = layoutSelectors.isShown("models", true)
1414

1515
const Model = getComponent("model")
1616
const Collapse = getComponent("Collapse")
1717

1818
if (!definitions.size) return null
1919

2020
return <section className={ showModels ? "models is-open" : "models"}>
21-
<h4 onClick={() => layoutActions.show('models', !showModels)}>
21+
<h4 onClick={() => layoutActions.show("models", !showModels)}>
2222
<span>Models</span>
2323
<svg width="20" height="20">
2424
<use xlinkHref="#large-arrow" />

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default class OnlineValidatorBadge extends React.Component {
3131
return null
3232
}
3333

34-
return (<span style={{ float: "right"}}>
34+
return (<span style={{ float: "right"}}>
3535
<a target="_blank" href={`${ this.state.validatorUrl }/debug?url=${ this.state.url }`}>
3636
<img alt="Online validator badge" src={`${ this.state.validatorUrl }?url=${ this.state.url }`} />
3737
</a>

src/core/components/response.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { PropTypes } from "react"
2-
import { fromJS } from 'immutable'
2+
import { fromJS } from "immutable"
33
import { getSampleSchema } from "core/utils"
44

55
const getExampleComponent = ( sampleResponse, examples, HighlightCode ) => {

src/core/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ module.exports = function SwaggerUI(opts) {
7979

8080
if(!queryConfig.url && typeof mergedConfig.spec === "object" && Object.keys(mergedConfig.spec).length) {
8181
system.specActions.updateUrl("")
82-
system.specActions.updateLoadingStatus("success");
82+
system.specActions.updateLoadingStatus("success")
8383
system.specActions.updateSpec(JSON.stringify(mergedConfig.spec))
8484
} else if(system.specActions.download && mergedConfig.url) {
8585
system.specActions.updateUrl(mergedConfig.url)

src/core/plugins/split-pane-mode/components/split-pane-mode.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ export default class SplitPaneMode extends React.Component {
5757
const mode = layoutSelectors.whatMode(MODE_KEY)
5858
const left = mode === MODE_RIGHT ? <noscript/> : children[0]
5959
const right = mode === MODE_LEFT ? <noscript/> : children[1]
60-
const size = this.sizeFromMode(mode, '50%')
60+
const size = this.sizeFromMode(mode, "50%")
6161

6262
return (
6363
<SplitPane
64-
disabledClass={''}
65-
ref={'splitPane'}
64+
disabledClass={""}
65+
ref={"splitPane"}
6666
split='vertical'
67-
defaultSize={'50%'}
67+
defaultSize={"50%"}
6868
primary="second"
6969
minSize={0}
7070
size={size}

src/core/utils.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ export const getSampleSchema = (schema, contentType="", config={}) => {
539539
let match = schema.$$ref.match(/\S*\/(\S+)$/)
540540
schema.xml.name = match[1]
541541
} else if (schema.type || schema.items || schema.properties || schema.additionalProperties) {
542-
return '<?xml version="1.0" encoding="UTF-8"?>\n<!-- XML example cannot be generated -->'
542+
return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- XML example cannot be generated -->"
543543
} else {
544544
return null
545545
}
@@ -555,13 +555,13 @@ export const parseSeach = () => {
555555
let search = window.location.search
556556

557557
if ( search != "" ) {
558-
let params = search.substr(1).split("&");
558+
let params = search.substr(1).split("&")
559559

560560
for (let i in params) {
561-
i = params[i].split("=");
562-
map[decodeURIComponent(i[0])] = decodeURIComponent(i[1]);
561+
i = params[i].split("=")
562+
map[decodeURIComponent(i[0])] = decodeURIComponent(i[1])
563563
}
564564
}
565565

566-
return map;
566+
return map
567567
}

src/plugins/topbar/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Topbar from './topbar.jsx'
1+
import Topbar from "./topbar.jsx"
22

33
export default function () {
44
return {

src/standalone/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import StandaloneLayout from './layout'
2-
import '../style/main.scss'
1+
import StandaloneLayout from "./layout"
2+
import "../style/main.scss"
33

44
import TopbarPlugin from "plugins/topbar"
55

src/standalone/layout.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { PropTypes } from 'react'
1+
import React, { PropTypes } from "react"
22

33
export default class StandaloneLayout extends React.Component {
44

test/core/curlify.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe("curlify", function() {
2121

2222
let curlified = curl(Im.fromJS(req))
2323

24-
expect(curlified).toEqual('curl -X POST http://example.com -H "Accept: application/json" -H "content-type: application/json" -d {"id":0,"name":"doggie","status":"available"}')
24+
expect(curlified).toEqual("curl -X POST http://example.com -H \"Accept: application/json\" -H \"content-type: application/json\" -d {\"id\":0,\"name\":\"doggie\",\"status\":\"available\"}")
2525
})
2626

2727
it("does not change the case of header in curl", function() {
@@ -35,7 +35,7 @@ describe("curlify", function() {
3535

3636
let curlified = curl(Im.fromJS(req))
3737

38-
expect(curlified).toEqual('curl -X POST http://example.com -H "conTenT Type: application/Moar"')
38+
expect(curlified).toEqual("curl -X POST http://example.com -H \"conTenT Type: application/Moar\"")
3939
})
4040

4141
it("prints a curl statement with an array of query params", function() {
@@ -46,7 +46,7 @@ describe("curlify", function() {
4646

4747
let curlified = curl(Im.fromJS(req))
4848

49-
expect(curlified).toEqual('curl -X GET http://swaggerhub.com/v1/one?name=john|smith')
49+
expect(curlified).toEqual("curl -X GET http://swaggerhub.com/v1/one?name=john|smith")
5050
})
5151

5252
it("prints a curl statement with an array of query params and auth", function() {
@@ -60,7 +60,7 @@ describe("curlify", function() {
6060

6161
let curlified = curl(Im.fromJS(req))
6262

63-
expect(curlified).toEqual('curl -X GET http://swaggerhub.com/v1/one?name=john|smith -H "authorization: Basic Zm9vOmJhcg=="')
63+
expect(curlified).toEqual("curl -X GET http://swaggerhub.com/v1/one?name=john|smith -H \"authorization: Basic Zm9vOmJhcg==\"")
6464
})
6565

6666
it("prints a curl statement with html", function() {
@@ -71,13 +71,13 @@ describe("curlify", function() {
7171
accept: "application/json"
7272
},
7373
body: {
74-
description: '<b>Test</b>'
74+
description: "<b>Test</b>"
7575
}
7676
}
7777

7878
let curlified = curl(Im.fromJS(req))
7979

80-
expect(curlified).toEqual('curl -X GET http://swaggerhub.com/v1/one?name=john|smith -H "accept: application/json" -d {"description":"<b>Test</b>"}')
80+
expect(curlified).toEqual("curl -X GET http://swaggerhub.com/v1/one?name=john|smith -H \"accept: application/json\" -d {\"description\":\"<b>Test</b>\"}")
8181
})
8282

8383
it("handles post body with html", function() {
@@ -88,28 +88,28 @@ describe("curlify", function() {
8888
accept: "application/json"
8989
},
9090
body: {
91-
description: '<b>Test</b>'
91+
description: "<b>Test</b>"
9292
}
9393
}
9494

9595
let curlified = curl(Im.fromJS(req))
9696

97-
expect(curlified).toEqual('curl -X POST http://swaggerhub.com/v1/one?name=john|smith -H "accept: application/json" -d {"description":"<b>Test</b>"}')
97+
expect(curlified).toEqual("curl -X POST http://swaggerhub.com/v1/one?name=john|smith -H \"accept: application/json\" -d {\"description\":\"<b>Test</b>\"}")
9898
})
9999

100100
it("handles post body with special chars", function() {
101101
var req = {
102102
url: "http://swaggerhub.com/v1/one?name=john|smith",
103103
method: "POST",
104104
body: {
105-
description: '@prefix nif:<http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#> .\n' +
106-
'@prefix itsrdf: <http://www.w3.org/2005/11/its/rdf#> .'
105+
description: "@prefix nif:<http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#> .\n" +
106+
"@prefix itsrdf: <http://www.w3.org/2005/11/its/rdf#> ."
107107
}
108108
}
109109

110110
let curlified = curl(Im.fromJS(req))
111111

112-
expect(curlified).toEqual('curl -X POST http://swaggerhub.com/v1/one?name=john|smith -d {"description":"@prefix nif:<http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#> .@prefix itsrdf: <http://www.w3.org/2005/11/its/rdf#> ."}')
112+
expect(curlified).toEqual("curl -X POST http://swaggerhub.com/v1/one?name=john|smith -d {\"description\":\"@prefix nif:<http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#> .@prefix itsrdf: <http://www.w3.org/2005/11/its/rdf#> .\"}")
113113
})
114114

115115
it("handles delete form with parameters", function() {
@@ -123,7 +123,7 @@ describe("curlify", function() {
123123

124124
let curlified = curl(Im.fromJS(req))
125125

126-
expect(curlified).toEqual('curl -X DELETE http://example.com -H "accept: application/x-www-form-urlencoded"')
126+
expect(curlified).toEqual("curl -X DELETE http://example.com -H \"accept: application/x-www-form-urlencoded\"")
127127
})
128128

129129
it("should print a curl with formData", function() {
@@ -136,7 +136,7 @@ describe("curlify", function() {
136136

137137
let curlified = curl(Im.fromJS(req))
138138

139-
expect(curlified).toEqual('curl -X POST http://example.com -H "content-type: multipart/form-data" -F id=123 -F name=Sahar')
139+
expect(curlified).toEqual("curl -X POST http://example.com -H \"content-type: multipart/form-data\" -F id=123 -F name=Sahar")
140140
})
141141

142142
it("prints a curl post statement from an object", function() {
@@ -153,7 +153,7 @@ describe("curlify", function() {
153153

154154
let curlified = curl(Im.fromJS(req))
155155

156-
expect(curlified).toEqual('curl -X POST http://example.com -H "accept: application/json" -d {"id":10101}')
156+
expect(curlified).toEqual("curl -X POST http://example.com -H \"accept: application/json\" -d {\"id\":10101}")
157157
})
158158

159159
it("prints a curl post statement from a string containing a single quote", function() {
@@ -163,12 +163,12 @@ describe("curlify", function() {
163163
headers: {
164164
accept: "application/json"
165165
},
166-
body: '{"id":"foo\'bar"}'
166+
body: "{\"id\":\"foo'bar\"}"
167167
}
168168

169169
let curlified = curl(Im.fromJS(req))
170170

171-
expect(curlified).toEqual('curl -X POST http://example.com -H "accept: application/json" -d "{\\"id\\":\\"foo\'bar\\"}"')
171+
expect(curlified).toEqual("curl -X POST http://example.com -H \"accept: application/json\" -d \"{\\\"id\\\":\\\"foo'bar\\\"}\"")
172172
})
173173

174174
})

0 commit comments

Comments
 (0)