Skip to content

Commit 97a68dd

Browse files
committed
Fix lint
1 parent 4f8f819 commit 97a68dd

File tree

9 files changed

+18
-13
lines changed

9 files changed

+18
-13
lines changed

demo/client/components/DemoEditor/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ window.Draft = Draft;
3131

3232
const plugins = [prismPlugin, createMarkdownShortcutsPlugin()];
3333

34-
const contentState = ContentState.createFromText('');
35-
const initialEditorState = EditorState.createWithContent(contentState);
36-
3734
export default class DemoEditor extends Component {
38-
state = {
39-
editorState: initialEditorState,
40-
};
35+
constructor(props) {
36+
super(props);
37+
const contentState = ContentState.createFromText('');
38+
const editorState = EditorState.createWithContent(contentState);
39+
this.state = { editorState };
40+
}
4141

4242
componentDidMount = () => {
4343
const { editor } = this;
@@ -63,7 +63,7 @@ export default class DemoEditor extends Component {
6363
return (
6464
<div className={styles.root}>
6565
{placeholder}
66-
<div className={styles.editor} onClick={this.focus}>
66+
<div className={styles.editor} onClick={this.focus} onKeyDown={this.focus}>
6767
<Editor
6868
editorState={editorState}
6969
onChange={this.onChange}

demo/webpack.config.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* eslint-disable no-var */
22
var path = require('path');
33
var webpack = require('webpack');
4-
var webpackBaseConfig = require('./webpack.config.base');
54
var ExtractTextPlugin = require('extract-text-webpack-plugin');
5+
var webpackBaseConfig = require('./webpack.config.base');
66

77
// Set up dev host and HMR host. For the dev host this is pretty self
88
// explanatory: We use a different live-reload server to serve our static JS

src/__test__/plugin-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint no-unused-expressions: 0 */
12
import { expect } from 'chai';
23
import sinon from 'sinon';
34
import { JSDOM, VirtualConsole } from 'jsdom';

src/components/Image/__test__/Image-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { shallow, configure } from 'enzyme';
55
import chai, { expect } from 'chai';
66
import chaiEnzyme from 'chai-enzyme';
77

8-
import Image from '../';
8+
import Image from "..";
99

1010
configure({ adapter: new Adapter() });
1111
chai.use(chaiEnzyme());

src/components/Link/__test__/Link-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
/* eslint jsx-a11y/anchor-is-valid: 0 */
12
import React from 'react';
23
import { ContentState } from 'draft-js';
34
import Adapter from 'enzyme-adapter-react-16';
45
import { shallow, configure } from 'enzyme';
56
import chai, { expect } from 'chai';
67
import chaiEnzyme from 'chai-enzyme';
78

8-
import Link from '../';
9+
import Link from '..';
910

1011
configure({ adapter: new Adapter() });
1112
chai.use(chaiEnzyme());

src/components/Link/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import React from 'react';
22

33
const Link = props => {
4-
const { href, title } = props.contentState.getEntity(props.entityKey).getData();
4+
const { contentState, children, entityKey } = props;
5+
const { href, title } = contentState.getEntity(entityKey).getData();
56
return (
67
<a href={href} title={title}>
7-
{props.children}
8+
{children}
89
</a>
910
);
1011
};

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const createMarkdownShortcutsPlugin = (config = { insertEmptyBlockOnReturnWithMo
8787
blockRenderMap: Map({
8888
'code-block': {
8989
element: 'code',
90-
wrapper: <pre spellCheck={'false'} />,
90+
wrapper: <pre spellCheck="false" />,
9191
},
9292
}).merge(checkboxBlockRenderMap),
9393
decorators: [createLinkDecorator(config, store), createImageDecorator(config, store)],

src/modifiers/__test__/handleImage-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint no-unused-expressions: 0 */
12
import sinon from 'sinon';
23
import { expect } from 'chai';
34
import Draft, { EditorState, SelectionState } from 'draft-js';

src/modifiers/__test__/handleLink-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint no-unused-expressions: 0 */
12
import sinon from 'sinon';
23
import { expect } from 'chai';
34
import Draft, { EditorState, SelectionState } from 'draft-js';

0 commit comments

Comments
 (0)