Skip to content

Commit dccb796

Browse files
SaraVieiraokonet
authored andcommitted
fix(490): Put build dependencies to devDependencies (react-dropzone#491)
lint / build dependencies incorrectly marked as `dependencies` closes react-dropzone#490
1 parent a5471a5 commit dccb796

File tree

5 files changed

+449
-362
lines changed

5 files changed

+449
-362
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
]
1818
}
1919
],
20+
"react/require-default-props": 0,
2021

2122
// Import
2223
"import/no-extraneous-dependencies": [

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,41 +58,41 @@
5858
},
5959
"dependencies": {
6060
"attr-accept": "^1.0.3",
61-
"babel-preset-env": "^1.6.0",
62-
"babel-preset-stage-1": "^6.24.1",
63-
"eslint-config-prettier": "^2.3.0",
64-
"eslint-plugin-prettier": "^2.2.0",
6561
"prop-types": "^15.5.7"
6662
},
6763
"devDependencies": {
68-
"@commitlint/cli": "^3.0.3",
64+
"@commitlint/cli": "^3.2.0",
6965
"@commitlint/config-angular": "^3.0.3",
70-
"@commitlint/prompt": "^3.1.2",
71-
"@commitlint/prompt-cli": "^3.0.3",
66+
"@commitlint/prompt": "^3.2.0",
67+
"@commitlint/prompt-cli": "^3.2.0",
7268
"babel-cli": "^6.9.0",
7369
"babel-core": "^6.9.1",
7470
"babel-eslint": "^7.1.1",
75-
"babel-jest": "^20.0.3",
76-
"babel-loader": "^7.1.1",
71+
"babel-jest": "^21.0.0",
72+
"babel-loader": "^7.1.2",
7773
"babel-plugin-add-module-exports": "^0.2.1",
74+
"babel-preset-env": "^1.6.0",
7875
"babel-preset-react": "^6.3.13",
76+
"babel-preset-stage-1": "^6.24.1",
7977
"babel-register": "^6.9.0",
8078
"commitizen": "^2.9.6",
81-
"css-loader": "^0.28.1",
79+
"css-loader": "^0.28.7",
8280
"enzyme": "^2.6.0",
83-
"eslint": "^4.4.1",
84-
"eslint-config-okonet": "^4.0.2",
81+
"eslint": "^4.6.1",
82+
"eslint-config-okonet": "^5.0.1",
83+
"eslint-config-prettier": "^2.4.0",
84+
"eslint-plugin-prettier": "^2.2.0",
8585
"husky": "^0.14.3",
8686
"imagemin-cli": "^3.0.0",
8787
"imagemin-pngquant": "^5.0.0",
88-
"jest": "^20.0.1",
89-
"jest-enzyme": "^3.2.0",
90-
"lint-staged": "^4.0.0",
88+
"jest": "^21.0.1",
89+
"jest-enzyme": "^3.8.2",
90+
"lint-staged": "^4.1.0",
9191
"markdownlint-cli": "^0.3.1",
92-
"prettier": "^1.3.1",
92+
"prettier": "^1.6.1",
9393
"react": "^15.4.1",
9494
"react-dom": "^15.4.1",
95-
"react-styleguidist": "^6.0.15",
95+
"react-styleguidist": "^6.0.23",
9696
"react-test-renderer": "^15.6.1",
9797
"rimraf": "^2.5.2",
9898
"semantic-release": "^7.0.2",

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ export default Dropzone
415415
Dropzone.propTypes = {
416416
/**
417417
* Allow specific types of files. See https://github.com/okonet/attr-accept for more information.
418-
* Keep in mind that mime type determination is not reliable accross platforms. CSV files,
418+
* Keep in mind that mime type determination is not reliable across platforms. CSV files,
419419
* for example, are reported as text/plain under macOS but as application/vnd.ms-excel under
420420
* Windows. In some cases there might not be a mime type set at all.
421421
* See: https://github.com/react-dropzone/react-dropzone/issues/276

src/index.spec.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,8 @@ describe('Dropzone', () => {
9999

100100
it('should render children function', () => {
101101
const content = <p>some content</p>
102-
const dropzone = mount(
103-
<Dropzone>
104-
{content}
105-
</Dropzone>
106-
)
107-
const dropzoneWithFunction = mount(
108-
<Dropzone>
109-
{() => content}
110-
</Dropzone>
111-
)
102+
const dropzone = mount(<Dropzone>{content}</Dropzone>)
103+
const dropzoneWithFunction = mount(<Dropzone>{() => content}</Dropzone>)
112104
expect(dropzoneWithFunction.html()).toEqual(dropzone.html())
113105
})
114106
})
@@ -224,10 +216,25 @@ describe('Dropzone', () => {
224216

225217
it('should reset the value of input', () => {
226218
const dropzone = mount(<Dropzone />)
227-
expect(dropzone.render().find('input').attr('value')).toBeUndefined()
228-
expect(dropzone.render().find('input').attr('value', 10)).not.toBeUndefined()
219+
expect(
220+
dropzone
221+
.render()
222+
.find('input')
223+
.attr('value')
224+
).toBeUndefined()
225+
expect(
226+
dropzone
227+
.render()
228+
.find('input')
229+
.attr('value', 10)
230+
).not.toBeUndefined()
229231
dropzone.simulate('click')
230-
expect(dropzone.render().find('input').attr('value')).toBeUndefined()
232+
expect(
233+
dropzone
234+
.render()
235+
.find('input')
236+
.attr('value')
237+
).toBeUndefined()
231238
})
232239

233240
it('should trigger click even on the input', done => {
@@ -355,11 +362,7 @@ describe('Dropzone', () => {
355362
})
356363

357364
it('should set proper dragActive state on dragEnter', () => {
358-
const dropzone = mount(
359-
<Dropzone>
360-
{props => <DummyChildComponent {...props} />}
361-
</Dropzone>
362-
)
365+
const dropzone = mount(<Dropzone>{props => <DummyChildComponent {...props} />}</Dropzone>)
363366
const child = dropzone.find(DummyChildComponent)
364367
dropzone.simulate('dragEnter', { dataTransfer: { files } })
365368
expect(child).toHaveProp('isDragActive', true)
@@ -369,9 +372,7 @@ describe('Dropzone', () => {
369372

370373
it('should set proper dragReject state on dragEnter', () => {
371374
const dropzone = mount(
372-
<Dropzone accept="image/*">
373-
{props => <DummyChildComponent {...props} />}
374-
</Dropzone>
375+
<Dropzone accept="image/*">{props => <DummyChildComponent {...props} />}</Dropzone>
375376
)
376377
const child = dropzone.find(DummyChildComponent)
377378
dropzone.simulate('dragEnter', {
@@ -462,9 +463,7 @@ describe('Dropzone', () => {
462463

463464
it('should set proper dragActive state if accept prop changes mid-drag', () => {
464465
const dropzone = mount(
465-
<Dropzone accept="image/*">
466-
{props => <DummyChildComponent {...props} />}
467-
</Dropzone>
466+
<Dropzone accept="image/*">{props => <DummyChildComponent {...props} />}</Dropzone>
468467
)
469468
const child = dropzone.find(DummyChildComponent)
470469
dropzone.simulate('dragEnter', { dataTransfer: { files: images } })
@@ -942,7 +941,7 @@ describe('Dropzone', () => {
942941

943942
const InnerDragAccepted = () => <p>Accepted</p>
944943
const InnerDragRejected = () => <p>Rejected</p>
945-
const InnerDropzone = () =>
944+
const InnerDropzone = () => (
946945
<Dropzone
947946
onDrop={innerDropSpy}
948947
onDropAccepted={innerDropAcceptedSpy}
@@ -955,6 +954,7 @@ describe('Dropzone', () => {
955954
return <p>No drag</p>
956955
}}
957956
</Dropzone>
957+
)
958958

959959
describe('dropping on the inner dropzone', () => {
960960
it('mounts both dropzones', () => {

0 commit comments

Comments
 (0)