diff --git a/package.json b/package.json index 96ca72f50..a74913fd8 100644 --- a/package.json +++ b/package.json @@ -18,18 +18,7 @@ "atom-keymap": "8.0.2", "atom-select-list": "0.0.15", "atom-ui": "0.4.1", - "babel-core": "6.22.1", - "babel-plugin-add-module-exports": "0.2.1", - "babel-plugin-transform-async-to-generator": "6.22.0", - "babel-plugin-transform-class-properties": "6.23.0", - "babel-plugin-transform-decorators-legacy": "1.3.4", - "babel-plugin-transform-do-expressions": "6.22.0", - "babel-plugin-transform-es2015-modules-commonjs": "6.23.0", - "babel-plugin-transform-export-extensions": "6.22.0", - "babel-plugin-transform-flow-strip-types": "6.22.0", - "babel-plugin-transform-function-bind": "6.22.0", - "babel-plugin-transform-object-rest-spread": "6.23.0", - "babel-plugin-transform-react-jsx": "6.23.0", + "babel-core": "5.8.38", "cached-run-in-this-context": "0.4.1", "chai": "3.5.0", "chart.js": "^2.3.0", diff --git a/script/package.json b/script/package.json index 9441213ac..9a4bcb84a 100644 --- a/script/package.json +++ b/script/package.json @@ -3,6 +3,7 @@ "description": "Atom build scripts", "dependencies": { "async": "2.0.1", + "babel-core": "5.8.38", "coffeelint": "1.15.7", "colors": "1.1.2", "csslint": "1.0.2", diff --git a/spec/main-process/file-recovery-service.test.js b/spec/main-process/file-recovery-service.test.js index 4821dbc9b..862b7f428 100644 --- a/spec/main-process/file-recovery-service.test.js +++ b/spec/main-process/file-recovery-service.test.js @@ -112,7 +112,7 @@ describe("FileRecoveryService", () => { const mockWindow = {} const filePath = temp.path() fs.writeFileSync(filePath, "content") - fs.chmodSync(filePath, 0o444) + fs.chmodSync(filePath, 0444) let logs = [] this.stub(console, 'log', (message) => logs.push(message)) diff --git a/src/babel.js b/src/babel.js index d72b29ffd..a944f2e8c 100644 --- a/src/babel.js +++ b/src/babel.js @@ -6,7 +6,6 @@ var defaultOptions = require('../static/babelrc.json') var babel = null var babelVersionDirectory = null -var options = null var PREFIXES = [ '/** @babel */', @@ -48,27 +47,16 @@ exports.compile = function (sourceCode, filePath) { var noop = function () {} Logger.prototype.debug = noop Logger.prototype.verbose = noop - - options = {ast: false, babelrc: false} - for (var key in defaultOptions) { - if (key === 'plugins') { - const plugins = [] - for (const [pluginName, pluginOptions] of defaultOptions[key]) { - plugins.push([require.resolve(`babel-plugin-${pluginName}`), pluginOptions]) - } - options[key] = plugins - } else { - options[key] = defaultOptions[key] - } - } } if (process.platform === 'win32') { filePath = 'file:///' + path.resolve(filePath).replace(/\\/g, '/') } - options.filename = filePath - + var options = {filename: filePath} + for (var key in defaultOptions) { + options[key] = defaultOptions[key] + } return babel.transform(sourceCode, options).code } diff --git a/static/babelrc.json b/static/babelrc.json index 11474dd8d..26b70dc41 100644 --- a/static/babelrc.json +++ b/static/babelrc.json @@ -1,16 +1,7 @@ { + "breakConfig": true, "sourceMap": "inline", - "plugins": [ - ["add-module-exports", {}], - ["transform-async-to-generator", {}], - ["transform-decorators-legacy", {}], - ["transform-class-properties", {}], - ["transform-es2015-modules-commonjs", {"strictMode": false}], - ["transform-export-extensions", {}], - ["transform-do-expressions", {}], - ["transform-function-bind", {}], - ["transform-object-rest-spread", {}], - ["transform-flow-strip-types", {}], - ["transform-react-jsx", {}] - ] + "blacklist": ["es6.forOf", "useStrict"], + "optional": ["asyncToGenerator"], + "stage": 0 }