Skip to content

Commit 7650649

Browse files
author
Emmanouil Konstantinidis
committed
Fix eslint
1 parent 04da183 commit 7650649

File tree

12 files changed

+31343
-47
lines changed

12 files changed

+31343
-47
lines changed

rest_framework_docs/static/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"watch": "npm run watch-js & npm run watch-less",
1414
"build": "npm run build-font-awesome && npm run build-bootstrap-fonts && npm run build-less",
1515
"start": "npm run build && npm run watch-less",
16-
"lint": "eslint 'rest_framework_docs/js/' --ignore-pattern 'rest_framework_docs/js/dist.js' --plugin eslint-plugin-react",
16+
"lint": "eslint 'rest_framework_docs/js/' --ignore-pattern 'rest_framework_docs/js/dist.js'",
1717
"test": "npm run lint"
1818
},
1919
"repository": {

rest_framework_docs/static/rest_framework_docs/js/components/helpers/input.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
var _ = require('underscore');
21
var React = require('react');
32

43
var Input = React.createClass({
@@ -10,7 +9,11 @@ var Input = React.createClass({
109
render: function () {
1110
return (
1211
<div className="form-group">
13-
<label htmlFor={this.props.name} className="col-sm-4 control-label">{this.props.name}</label>
12+
<label
13+
htmlFor={this.props.name}
14+
className="col-sm-4 control-label">
15+
{this.props.name}
16+
</label>
1417
<div className="col-sm-8">
1518
<input
1619
type="text"

rest_framework_docs/static/rest_framework_docs/js/components/liveapi.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
var _ = require('underscore');
21
var React = require('react');
32
var APIRequest = require('superagent');
43

rest_framework_docs/static/rest_framework_docs/js/components/request.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
var _ = require('underscore');
21
var React = require('react');
32

43
var FieldsData = require('./request/fields-data');
@@ -45,7 +44,10 @@ var Request = React.createClass({
4544
<h3>Request</h3>
4645

4746
<Header title='API Endpoint' />
48-
<FieldUrl name='urlEndpoint' value={this.state.urlEndpoint} onChange={this.handleInputChange.bind(this, 'urlEndpoint')} />
47+
<FieldUrl
48+
name='urlEndpoint'
49+
value={this.state.urlEndpoint}
50+
onChange={this.handleInputChange.bind(this, 'urlEndpoint')} />
4951

5052
<Header title='Method' />
5153
<Methods methods={endpoint.methods} active={this.state.method} setMethod={this.setMethod} />
@@ -54,14 +56,20 @@ var Request = React.createClass({
5456
<div className="form-group">
5557
<label htmlFor="authorization" className="col-sm-4 control-label">Authorization</label>
5658
<div className="col-sm-8">
57-
<input type="text" className="form-control input-sm" id="authorization" placeholder="Token" />
59+
<input
60+
type="text"
61+
className="form-control input-sm"
62+
placeholder="Token" />
5863
</div>
5964
</div>
6065

6166
{RequestUtils.shouldAddData(this.state.method) ? null : (
6267
<div>
6368
<Header title='Data' />
64-
<FieldsData fields={endpoint.fields} data={this.state.data} onChange={this.handleDataFieldChange} />
69+
<FieldsData
70+
fields={endpoint.fields}
71+
data={this.state.data}
72+
onChange={this.handleDataFieldChange} />
6573
</div>
6674
)}
6775
</div>

rest_framework_docs/static/rest_framework_docs/js/components/request/field-url.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
var _ = require('underscore');
21
var React = require('react');
32

43
var Input = require('../helpers/input');
@@ -11,7 +10,11 @@ var FieldUrl = React.createClass({
1110

1211
render: function () {
1312
return (
14-
<Input name='Url Endpoint' value={this.props.value} placeholder='Endpoint Url' onChange={this.handleChange} />
13+
<Input
14+
name='Url Endpoint'
15+
value={this.props.value}
16+
placeholder='Endpoint Url'
17+
onChange={this.handleChange} />
1518
);
1619
}
1720
});

rest_framework_docs/static/rest_framework_docs/js/components/request/fields-data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var FieldsData = React.createClass({
2020
required={field.required}
2121
onChange={this.handleChange.bind(this, field.name)} />
2222
);
23-
}, this)
23+
}, this);
2424
},
2525

2626
render: function () {

rest_framework_docs/static/rest_framework_docs/js/components/request/methods.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ var Methods = React.createClass({
99
},
1010

1111
componentWillMount: function() {
12-
var methods =this.props.methods
13-
.replace(/\W+/g, " ")
12+
var methods = this.props.methods
13+
.replace(/\W+/g, ' ')
1414
.replace(/^[ ]+|[ ]+$/g,'')
15-
.split(" ");
15+
.split(' ');
1616

1717
this.setState({
1818
methods: methods
@@ -29,10 +29,17 @@ var Methods = React.createClass({
2929
// var self = this;
3030

3131
return (
32-
<div className="btn-group methods">
32+
<div className='btn-group methods'>
3333
{this.state.methods.map(function (method, i) {
34-
var methodClass = "btn btn-sm method " + method.toLowerCase() + (this.props.active == method ? ' active': null);
35-
return <button key={i} type='button' className={methodClass} onClick={this.setMethod.bind(this, method)}>{method}</button>;
34+
var methodClass = 'btn btn-sm method ' + method.toLowerCase() +
35+
(this.props.active == method ? ' active' : null);
36+
return (
37+
<button
38+
key={i}
39+
type='button'
40+
className={methodClass}
41+
onClick={this.setMethod.bind(this, method)}>{method}</button>
42+
);
3643
}, this)}
3744
</div>
3845
);

rest_framework_docs/static/rest_framework_docs/js/components/response.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
var _ = require('underscore');
21
var React = require('react');
32

43
var JSONpp = require('../utils/jsonpp');
@@ -15,26 +14,26 @@ var Response = React.createClass({
1514
if (!this.props.payload) {
1615
return (
1716
<div>
18-
<h3>Response <span className="label status-code pull-right"></span></h3>
19-
<p className="lead text-center">Awaiting request...</p>
17+
<h3>Response <span className='label status-code pull-right'></span></h3>
18+
<p className='lead text-center'>Awaiting request...</p>
2019
</div>
21-
)
20+
);
2221
}
2322

2423
var responseJSON = JSONpp.prettyPrint(this.props.payload.body);
2524
var statusText = this.props.payload.statusText.toLowerCase();
2625
var statusCodeFirstChar = String(this.props.payload.status).charAt(0);
27-
var statusCodeClass = "label status-code pull-right status-code-" + statusCodeFirstChar;
26+
var statusCodeClass = 'label status-code pull-right status-code-' + statusCodeFirstChar;
2827

2928
return (
3029
<div>
3130
<h3>Response <span className={statusCodeClass}>{this.props.payload.status}</span></h3>
3231

33-
<div><strong>Status</strong>: <span className="status-text">{statusText}</span></div>
32+
<div><strong>Status</strong>: <span className='status-text'>{statusText}</span></div>
3433
<pre><code dangerouslySetInnerHTML={{__html: responseJSON}}></code></pre>
35-
<div className="well well-default text-center">
36-
<button className='btn btn-info'><i className='fa fa-key'></i> Save Token</button>
37-
<h5>Your token will be lost when you refresh the page.</h5>
34+
<div className='well well-default text-center'>
35+
<button className='btn btn-sm btn-info'><i className='fa fa-key'></i> Save Token</button>
36+
<h6>Your token will be lost when you refresh the page.</h6>
3837
</div>
3938
</div>
4039
);

0 commit comments

Comments
 (0)