Skip to content

Commit 8b179c8

Browse files
committed
Fix lint errors in demo
1 parent db63761 commit 8b179c8

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

.eslintrc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"extends": "eslint:recommended",
33
"ecmaFeatures": {
44
"jsx": true,
5-
"modules": true
5+
"modules": true,
6+
"spread": true
67
},
78
"env": {
89
"browser": true,
@@ -17,6 +18,7 @@
1718
"semi": [2, "always"],
1819
"quotes": [2, "single"],
1920
"indent": [2, 2, {"SwitchCase": 1}],
20-
"eol-last": 2
21+
"eol-last": 2,
22+
"react/jsx-uses-react": 1
2123
}
2224
}

demo/src/js/components/Editor.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React, { Component, PropTypes } from 'react';
2-
import brace from 'brace';
3-
import AceEditor from 'react-ace';
2+
import brace from 'brace'; // eslint-disable-line no-unused-vars
43
import 'brace/mode/html';
54
import 'brace/theme/chrome';
5+
import AceEditor from 'react-ace';
66

77
import 'sass/editor';
88

@@ -27,6 +27,10 @@ export default class Editor extends Component {
2727
render() {
2828
const { onUpdateClick } = this.props;
2929
const { html } = this.state;
30+
const editorProps = {
31+
$blockScrolling: Infinity,
32+
wrap: true
33+
};
3034
return (
3135
<div id="editor">
3236
<AceEditor mode="html"
@@ -37,10 +41,7 @@ export default class Editor extends Component {
3741
height="auto"
3842
onChange={this.onChange}
3943
onLoad={this.onEditorLoad}
40-
editorProps={{
41-
$blockScrolling: Infinity,
42-
wrap: true
43-
}}
44+
editorProps={ editorProps }
4445
/>
4546
<div className="buttons">
4647
<button onClick={ () => onUpdateClick(html) }>Update HTML</button>
@@ -51,8 +52,8 @@ export default class Editor extends Component {
5152
}
5253

5354
Editor.propTypes = {
54-
initialHtml: React.PropTypes.string.isRequired,
55-
onUpdateClick: React.PropTypes.func.isRequired
55+
initialHtml: PropTypes.string.isRequired,
56+
onUpdateClick: PropTypes.func.isRequired
5657
};
5758

5859
export default Editor;

demo/src/js/reducers.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export default function reducer(state=initialState, action) {
55
switch (action.type) {
66
case 'UPDATE_HTML':
77
return {
8-
...state,
98
html: action.html
109
};
1110
default:

0 commit comments

Comments
 (0)