Skip to content

Commit f033df9

Browse files
committed
Lint all.
1 parent 7bb7fe2 commit f033df9

29 files changed

+1454
-1565
lines changed

.size-snapshot.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
{
22
"index.js": {
3-
"bundled": 65954,
4-
"minified": 37732,
5-
"gzipped": 9679,
3+
"bundled": 66704,
4+
"minified": 37966,
5+
"gzipped": 9704,
66
"treeshaked": {
77
"rollup": {
8-
"code": 30085,
8+
"code": 30307,
99
"import_statements": 535
1010
},
1111
"webpack": {
12-
"code": 31592
12+
"code": 31791
1313
}
1414
}
1515
},
1616
"index.mjs": {
17-
"bundled": 65954,
18-
"minified": 37732,
19-
"gzipped": 9679,
17+
"bundled": 66704,
18+
"minified": 37966,
19+
"gzipped": 9704,
2020
"treeshaked": {
2121
"rollup": {
22-
"code": 30085,
22+
"code": 30307,
2323
"import_statements": 535
2424
},
2525
"webpack": {
26-
"code": 31592
26+
"code": 31791
2727
}
2828
}
2929
}

__mocks__/fileMock.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = 'test-file-stub';
1+
module.exports = 'test-file-stub'

__mocks__/react-dnd-html5-backend.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable import/no-extraneous-dependencies */
2-
import { TestBackend } from 'react-dnd-test-backend';
1+
import { TestBackend } from 'react-dnd-test-backend'
32

4-
module.exports = { HTML5Backend: TestBackend };
3+
module.exports = { HTML5Backend: TestBackend }

__mocks__/react-dnd-scrollzone.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module.exports = el => el;
2-
module.exports.createVerticalStrength = () => {};
3-
module.exports.createHorizontalStrength = () => {};
1+
module.exports = (el) => el
2+
module.exports.createVerticalStrength = () => {}
3+
module.exports.createHorizontalStrength = () => {}

__mocks__/react-virtualized.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
import React from 'react';
1+
import React from 'react'
22

33
// eslint-disable-next-line global-require
4-
const reactVirtualized = { ...require('react-virtualized') };
4+
const reactVirtualized = { ...require('react-virtualized') }
55

66
/* eslint-disable react/prop-types */
7-
const MockAutoSizer = props =>
7+
const MockAutoSizer = (props) => (
88
<div>
99
{props.children({
1010
height: 99999,
1111
width: 200,
1212
})}
13-
</div>;
13+
</div>
14+
)
1415
/* eslint-enable react/prop-types */
1516

16-
reactVirtualized.AutoSizer = MockAutoSizer;
17+
reactVirtualized.AutoSizer = MockAutoSizer
1718

18-
module.exports = reactVirtualized;
19+
module.exports = reactVirtualized

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nosferatu500/react-sortable-tree",
3-
"version": "4.0.0-beta.0",
3+
"version": "4.0.0-beta.1",
44
"description": "Drag-and-drop sortable component for nested data and hierarchies",
55
"main": "./index.js",
66
"types": "./index.d.ts",
@@ -39,7 +39,7 @@
3939
"semi": false,
4040
"trailingComma": "es5",
4141
"singleQuote": true,
42-
"jsxBracketSameLine": true,
42+
"bracketSameLine": true,
4343
"tabWidth": 2,
4444
"printWidth": 80
4545
},
@@ -118,7 +118,7 @@
118118
]
119119
},
120120
"dependencies": {
121-
"@nosferatu500/react-dnd-scrollzone": "^2.0.0",
121+
"@nosferatu500/react-dnd-scrollzone": "^2.0.2",
122122
"lodash.isequal": "^4.5.0",
123123
"prop-types": "^15.7.2",
124124
"react-dnd": "^14.0.3",
@@ -131,8 +131,8 @@
131131
"@babel/eslint-parser": "^7.15.4",
132132
"@babel/helper-module-imports": "^7.15.4",
133133
"@babel/plugin-transform-react-jsx": "^7.14.9",
134-
"@babel/preset-env": "^7.15.4",
135-
"@babel/types": "^7.15.4",
134+
"@babel/preset-env": "^7.15.6",
135+
"@babel/types": "^7.15.6",
136136
"@nosferatu500/theme-file-explorer": "^3.0.6",
137137
"@rollup/plugin-babel": "^5.3.0",
138138
"@rollup/plugin-node-resolve": "^13.0.4",
@@ -141,7 +141,7 @@
141141
"@storybook/addons": "^6.3.8",
142142
"@storybook/react": "^6.3.8",
143143
"@storybook/theming": "^6.3.8",
144-
"@testing-library/react": "^12.0.0",
144+
"@testing-library/react": "^12.1.0",
145145
"@types/babel-plugin-macros": "^2.8.5",
146146
"@types/enzyme": "^3.10.9",
147147
"@types/jest": "^27.0.1",
@@ -151,25 +151,25 @@
151151
"@types/react-lifecycles-compat": "^3.0.1",
152152
"@types/react-test-renderer": "^17.0.1",
153153
"@types/react-virtualized": "^9.21.13",
154-
"@typescript-eslint/eslint-plugin": "^4.30.0",
155-
"@typescript-eslint/parser": "^4.30.0",
154+
"@typescript-eslint/eslint-plugin": "^4.31.0",
155+
"@typescript-eslint/parser": "^4.31.0",
156156
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.3",
157157
"acorn-jsx": "^5.3.2",
158158
"babel-plugin-macros": "^3.1.0",
159159
"babel-plugin-tester": "^10.1.0",
160160
"enzyme": "^3.11.0",
161-
"esbuild": "^0.12.25",
161+
"esbuild": "^0.12.26",
162162
"eslint": "^7.32.0",
163163
"eslint-config-prettier": "^8.3.0",
164164
"eslint-plugin-import": "^2.24.2",
165165
"eslint-plugin-jest": "^24.4.0",
166166
"eslint-plugin-prettier": "^4.0.0",
167167
"eslint-plugin-react": "^7.25.1",
168-
"jest": "^27.1.0",
168+
"jest": "^27.1.1",
169169
"jest-enzyme": "^7.1.2",
170170
"json": "^11.0.0",
171171
"postcss": "^8.3.6",
172-
"prettier": "^2.3.2",
172+
"prettier": "^2.4.0",
173173
"react": "^17.0.2",
174174
"react-dnd-test-backend": "^14.0.0",
175175
"react-dnd-touch-backend": "^14.1.0",
@@ -183,7 +183,7 @@
183183
"shx": "^0.3.3",
184184
"ts-jest": "^27.0.5",
185185
"tslib": "^2.3.1",
186-
"typescript": "4.3.5"
186+
"typescript": "^4.4.3"
187187
},
188188
"peerDependencies": {
189189
"react": ">=17.0.0",

stories/add-remove.js

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { Component } from 'react';
2-
import SortableTree, { addNodeUnderParent, removeNodeAtPath } from '../src';
1+
import React, { Component } from 'react'
2+
import SortableTree, { addNodeUnderParent, removeNodeAtPath } from '../src'
33
// In your own app, you would need to use import styles once in the app
44
// import 'react-sortable-tree/styles.css';
55

@@ -52,33 +52,33 @@ const firstNames = [
5252
'Rupert',
5353
'Sigurd',
5454
'Simon',
55-
];
55+
]
5656

5757
export default class App extends Component {
5858
constructor(props) {
59-
super(props);
59+
super(props)
6060

6161
this.state = {
6262
treeData: [{ title: 'Peter Olofsson' }, { title: 'Karl Johansson' }],
6363
addAsFirstChild: false,
64-
};
64+
}
6565
}
6666

6767
render() {
68-
const getNodeKey = ({ treeIndex }) => treeIndex;
68+
const getNodeKey = ({ treeIndex }) => treeIndex
6969
const getRandomName = () =>
70-
firstNames[Math.floor(Math.random() * firstNames.length)];
70+
firstNames[Math.floor(Math.random() * firstNames.length)]
7171
return (
7272
<div>
7373
<div style={{ height: 300 }}>
7474
<SortableTree
7575
treeData={this.state.treeData}
76-
onChange={treeData => this.setState({ treeData })}
76+
onChange={(treeData) => this.setState({ treeData })}
7777
generateNodeProps={({ node, path }) => ({
7878
buttons: [
7979
<button
8080
onClick={() =>
81-
this.setState(state => ({
81+
this.setState((state) => ({
8282
treeData: addNodeUnderParent({
8383
treeData: state.treeData,
8484
parentKey: path[path.length - 1],
@@ -92,21 +92,19 @@ export default class App extends Component {
9292
addAsFirstChild: state.addAsFirstChild,
9393
}).treeData,
9494
}))
95-
}
96-
>
95+
}>
9796
Add Child
9897
</button>,
9998
<button
10099
onClick={() =>
101-
this.setState(state => ({
100+
this.setState((state) => ({
102101
treeData: removeNodeAtPath({
103102
treeData: state.treeData,
104103
path,
105104
getNodeKey,
106105
}),
107106
}))
108-
}
109-
>
107+
}>
110108
Remove
111109
</button>,
112110
],
@@ -116,13 +114,12 @@ export default class App extends Component {
116114

117115
<button
118116
onClick={() =>
119-
this.setState(state => ({
117+
this.setState((state) => ({
120118
treeData: state.treeData.concat({
121119
title: `${getRandomName()} ${getRandomName()}sson`,
122120
}),
123121
}))
124-
}
125-
>
122+
}>
126123
Add more
127124
</button>
128125
<br />
@@ -133,13 +130,13 @@ export default class App extends Component {
133130
type="checkbox"
134131
checked={this.state.addAsFirstChild}
135132
onChange={() =>
136-
this.setState(state => ({
133+
this.setState((state) => ({
137134
addAsFirstChild: !state.addAsFirstChild,
138135
}))
139136
}
140137
/>
141138
</label>
142139
</div>
143-
);
140+
)
144141
}
145142
}

stories/barebones-no-context.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import React, { Component } from 'react';
2-
import { DndProvider } from 'react-dnd';
3-
import { HTML5Backend } from 'react-dnd-html5-backend';
4-
import { SortableTreeWithoutDndContext as SortableTree } from '../src';
1+
import React, { Component } from 'react'
2+
import { DndProvider } from 'react-dnd'
3+
import { HTML5Backend } from 'react-dnd-html5-backend'
4+
import { SortableTreeWithoutDndContext as SortableTree } from '../src'
55
// In your own app, you would need to use import styles once in the app
66
// import 'react-sortable-tree/styles.css';
77

88
export default class App extends Component {
99
constructor(props) {
10-
super(props);
10+
super(props)
1111

1212
this.state = {
1313
treeData: [
1414
{ title: 'Chicken', expanded: true, children: [{ title: 'Egg' }] },
1515
],
16-
};
16+
}
1717
}
1818

1919
render() {
@@ -22,10 +22,10 @@ export default class App extends Component {
2222
<DndProvider backend={HTML5Backend}>
2323
<SortableTree
2424
treeData={this.state.treeData}
25-
onChange={treeData => this.setState({ treeData })}
25+
onChange={(treeData) => this.setState({ treeData })}
2626
/>
2727
</DndProvider>
2828
</div>
29-
);
29+
)
3030
}
3131
}

stories/barebones.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
import React, { Component } from 'react';
2-
import SortableTree from '../src';
1+
import React, { Component } from 'react'
2+
import SortableTree from '../src'
33
// In your own app, you would need to use import styles once in the app
44
// import 'react-sortable-tree/styles.css';
55

66
export default class App extends Component {
77
constructor(props) {
8-
super(props);
8+
super(props)
99

1010
this.state = {
1111
treeData: [
1212
{ title: 'Chicken', expanded: true, children: [{ title: 'Egg' }] },
1313
],
14-
};
14+
}
1515
}
1616

1717
render() {
1818
return (
1919
<div style={{ height: 300 }}>
2020
<SortableTree
2121
treeData={this.state.treeData}
22-
onChange={treeData => this.setState({ treeData })}
22+
onChange={(treeData) => this.setState({ treeData })}
2323
/>
2424
</div>
25-
);
25+
)
2626
}
2727
}

0 commit comments

Comments
 (0)