Skip to content

Commit 6fc08fb

Browse files
committed
revert just-camel-case; use to-camel-case; upgrade xo
1 parent c38db85 commit 6fc08fb

File tree

6 files changed

+645
-823
lines changed

6 files changed

+645
-823
lines changed

package.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,30 +46,31 @@
4646
"babel-core": "^7.0.0-bridge.0",
4747
"babel-jest": "^23.6.0",
4848
"es-check": "^4.0.0",
49+
"eslint": "^5.7.0",
4950
"eslint-config-jest-files": "^0.1.3",
5051
"eslint-config-unicorn-camelcase": "^0.1.1",
5152
"eslint-plugin-prettier": "^3.0.0",
5253
"flux-standard-action": "^2.0.3",
5354
"husky": "^1.1.2",
5455
"jest": "^23.6.0",
5556
"lint-staged": "^7.3.0",
56-
"npm-run-all": "^4.1.2",
57+
"npm-run-all": "^4.1.3",
5758
"prettier": "^1.14.3",
5859
"rimraf": "^2.6.2",
59-
"rollup": "^0.66.2",
60-
"rollup-plugin-babel": "^4.0.1",
60+
"rollup": "^0.66.6",
61+
"rollup-plugin-babel": "^4.0.3",
6162
"rollup-plugin-commonjs": "^9.2.0",
6263
"rollup-plugin-node-resolve": "^3.4.0",
63-
"rollup-plugin-replace": "^2.0.0",
64+
"rollup-plugin-replace": "^2.1.0",
6465
"rollup-plugin-terser": "^3.0.0",
65-
"xo": "^0.20.3"
66+
"xo": "^0.23.0"
6667
},
6768
"dependencies": {
6869
"invariant": "^2.2.4",
69-
"just-camel-case": "^3.1.0",
7070
"just-curry-it": "^3.1.0",
7171
"loose-envify": "^1.4.0",
72-
"reduce-reducers": "^0.4.3"
72+
"reduce-reducers": "^0.4.3",
73+
"to-camel-case": "^1.0.0"
7374
},
7475
"husky": {
7576
"hooks": {
@@ -88,7 +89,9 @@
8889
"unicorn-camelcase",
8990
"jest-files"
9091
],
91-
"ignores": ["rollup.config.js"]
92+
"ignores": [
93+
"rollup.config.js"
94+
]
9295
},
9396
"prettier": {
9497
"singleQuote": true,

rollup.config.js

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,9 @@ export default [
3434
input: 'src/index.js',
3535
output: { file: 'es/redux-actions.mjs', format: 'es', indent: false },
3636
plugins: [
37-
nodeResolve({
38-
jsnext: true
39-
}),
37+
nodeResolve(),
4038
commonjs(),
41-
replace({
42-
'process.env.NODE_ENV': JSON.stringify('production')
43-
}),
39+
replace({ 'process.env.NODE_ENV': JSON.stringify('production') }),
4440
terser({
4541
compress: {
4642
pure_getters: true,
@@ -62,14 +58,10 @@ export default [
6258
indent: false
6359
},
6460
plugins: [
65-
nodeResolve({
66-
jsnext: true
67-
}),
61+
nodeResolve(),
6862
commonjs(),
6963
babel(),
70-
replace({
71-
'process.env.NODE_ENV': JSON.stringify('development')
72-
})
64+
replace({ 'process.env.NODE_ENV': JSON.stringify('development') })
7365
]
7466
},
7567

@@ -83,14 +75,10 @@ export default [
8375
indent: false
8476
},
8577
plugins: [
86-
nodeResolve({
87-
jsnext: true
88-
}),
78+
nodeResolve(),
8979
commonjs(),
9080
babel(),
91-
replace({
92-
'process.env.NODE_ENV': JSON.stringify('production')
93-
}),
81+
replace({ 'process.env.NODE_ENV': JSON.stringify('production') }),
9482
terser({
9583
compress: {
9684
pure_getters: true,

src/utils/camelCase.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import justCamelCase from 'just-camel-case';
2-
3-
const camelCase = string => justCamelCase(string, { strict: true });
1+
import camelCase from 'to-camel-case';
42

53
const namespacer = '/';
64

src/utils/ownKeys.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ import isMap from './isMap';
22

33
export default function ownKeys(object) {
44
if (isMap(object)) {
5+
// We are using loose transforms in babel. Here we are trying to convert an
6+
// interable to an array. Loose mode expects everything to already be an
7+
// array. The problem is that our eslint rules encourage us to prefer
8+
// spread over Array.from.
9+
//
10+
// Instead of disabling loose mode we simply disable the warning.
11+
// eslint-disable-next-line unicorn/prefer-spread
512
return Array.from(object.keys());
613
}
714

test/camelCase.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ test('includes forward slashes in words', () => {
99
});
1010

1111
test('does nothing to an already camel-cased action type', () => {
12-
expect(camelCase('myAction')).toBe('myaction');
12+
expect(camelCase('myAction')).toBe('myAction');
1313
});

0 commit comments

Comments
 (0)