Skip to content

Commit 6c10170

Browse files
committed
Upgrade to Babel 6
1 parent 1a87137 commit 6c10170

File tree

5 files changed

+66
-19
lines changed

5 files changed

+66
-19
lines changed

.eslintrc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"indent": [2, 2, {"SwitchCase": 1}],
7070
"init-declarations": 0,
7171
"key-spacing": [2, {"beforeColon": false, "afterColon": true}],
72+
"keyword-spacing": 2,
7273
"linebreak-style": 2,
7374
"lines-around-comment": 0,
7475
"max-depth": 0,
@@ -100,7 +101,6 @@
100101
"no-else-return": 2,
101102
"no-empty": 2,
102103
"no-empty-character-class": 2,
103-
"no-empty-label": 2,
104104
"no-eq-null": 0,
105105
"no-eval": 2,
106106
"no-ex-assign": 2,
@@ -194,12 +194,10 @@
194194
"semi": [2, "always"],
195195
"semi-spacing": [2, {"before": false, "after": true}],
196196
"sort-vars": 0,
197-
"space-after-keywords": [2, "always"],
198197
"space-before-blocks": [2, "always"],
199198
"space-before-function-paren": [2, {"anonymous": "always", "named": "never"}],
200199
"space-in-parens": 0,
201200
"space-infix-ops": [2, {"int32Hint": false}],
202-
"space-return-throw-case": 2,
203201
"space-unary-ops": [2, {"words": true, "nonwords": false}],
204202
"spaced-comment": [2, "always"],
205203
"strict": 0,

package.json

Lines changed: 63 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,54 @@
2020
"options": {
2121
"mocha": "--require resources/mocha-bootload src/**/__tests__/**/*.js"
2222
},
23+
"babel": {
24+
"plugins": [
25+
"transform-async-to-generator",
26+
"transform-class-properties",
27+
"transform-flow-strip-types",
28+
"transform-es2015-template-literals",
29+
"transform-es2015-literals",
30+
"transform-es2015-function-name",
31+
"transform-es2015-arrow-functions",
32+
[
33+
"transform-es2015-classes",
34+
{
35+
"loose": true
36+
}
37+
],
38+
"transform-es2015-shorthand-properties",
39+
[
40+
"transform-es2015-spread",
41+
{
42+
"loose": true
43+
}
44+
],
45+
"transform-es2015-parameters",
46+
[
47+
"transform-es2015-destructuring",
48+
{
49+
"loose": true
50+
}
51+
],
52+
"add-module-exports",
53+
"transform-es2015-block-scoping",
54+
[
55+
"transform-es2015-modules-commonjs",
56+
{
57+
"loose": true
58+
}
59+
]
60+
]
61+
},
2362
"scripts": {
2463
"test": "npm run lint && npm run check && npm run testonly",
25-
"testonly": "mocha $npm_package_options_mocha",
64+
"testonly": "babel-node ./node_modules/.bin/_mocha $npm_package_options_mocha",
2665
"lint": "eslint src",
2766
"check": "flow check",
2867
"build": "babel src --ignore __tests__ --out-dir dist/ ; cp src/index.js dist/index.js.flow ; cp src/index.d.ts dist/",
29-
"watch": "babel --optional runtime resources/watch.js | node",
30-
"cover": "babel-node node_modules/.bin/isparta cover --root src --report html node_modules/.bin/_mocha -- $npm_package_options_mocha",
31-
"cover:lcov": "babel-node node_modules/.bin/isparta cover --root src --report lcovonly node_modules/.bin/_mocha -- $npm_package_options_mocha",
68+
"watch": "babel resources/watch.js | node",
69+
"cover": "babel-node node_modules/.bin/isparta cover --root src --report html _mocha -- $npm_package_options_mocha",
70+
"cover:lcov": "babel-node node_modules/.bin/isparta cover --root src --report lcovonly _mocha -- $npm_package_options_mocha",
3271
"preversion": ". ./resources/checkgit.sh && npm test",
3372
"prepublish": ". ./resources/prepublish.sh"
3473
},
@@ -41,16 +80,29 @@
4180
"PATENTS"
4281
],
4382
"devDependencies": {
44-
"babel": "5.8.21",
45-
"babel-runtime": "^5.8.x",
46-
"babel-core": "5.8.22",
47-
"babel-eslint": "4.1.8",
83+
"babel-cli": "6.14.0",
84+
"babel-eslint": "6.1.2",
85+
"babel-plugin-add-module-exports": "0.2.1",
86+
"babel-plugin-transform-async-to-generator": "6.8.0",
87+
"babel-plugin-transform-class-properties": "6.11.5",
88+
"babel-plugin-transform-es2015-arrow-functions": "6.8.0",
89+
"babel-plugin-transform-es2015-block-scoping": "6.15.0",
90+
"babel-plugin-transform-es2015-classes": "6.14.0",
91+
"babel-plugin-transform-es2015-destructuring": "6.9.0",
92+
"babel-plugin-transform-es2015-function-name": "6.9.0",
93+
"babel-plugin-transform-es2015-literals": "6.8.0",
94+
"babel-plugin-transform-es2015-modules-commonjs": "6.14.0",
95+
"babel-plugin-transform-es2015-parameters": "6.11.4",
96+
"babel-plugin-transform-es2015-shorthand-properties": "6.8.0",
97+
"babel-plugin-transform-es2015-spread": "6.8.0",
98+
"babel-plugin-transform-es2015-template-literals": "6.8.0",
99+
"babel-plugin-transform-flow-strip-types": "6.14.0",
48100
"chai": "3.5.0",
49101
"coveralls": "2.11.14",
50-
"eslint": "1.10.3",
51-
"eslint-plugin-babel": "2.2.0",
102+
"eslint": "3.5.0",
103+
"eslint-plugin-babel": "3.3.0",
52104
"flow-bin": "0.32.0",
53-
"isparta": "3.0.3",
105+
"isparta": "4.0.0",
54106
"mocha": "3.0.2",
55107
"sane": "1.4.1"
56108
},

resources/mocha-bootload.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
* of patent rights can be found in the PATENTS file in the same directory.
88
*/
99

10-
require('babel/register')({
11-
optional: ['runtime', 'es7.asyncFunctions']
12-
});
13-
1410
process.on('unhandledRejection', function (error) {
1511
console.error('Unhandled Promise Rejection:');
1612
console.error(error && error.stack || error);

resources/prepublish.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ cp dist/* .
2929
node -e "var package = require('./package.json'); \
3030
delete package.scripts; \
3131
delete package.options; \
32+
delete package.babel; \
3233
delete package.devDependencies; \
3334
require('fs').writeFileSync('package.json', JSON.stringify(package));"

src/__tests__/abuse-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe('Provides descriptive error messages for API abuse', () => {
6060
idLoader.loadMany();
6161
}).to.throw(
6262
'The loader.loadMany() function must be called with Array<key> ' +
63-
`but got: undefined.`
63+
'but got: undefined.'
6464
);
6565

6666
expect(() => {

0 commit comments

Comments
 (0)