From 64d6bbef6a7f2158a108a51fb78c14d7ba5fda54 Mon Sep 17 00:00:00 2001 From: Hoang Trinh Date: Thu, 20 Jun 2019 15:14:31 +0700 Subject: [PATCH] Upgrade To Babel v7 --- package.json | 15 +++++++++------ src/client/.babelrc | 5 +++-- src/client/.eslintrc.json | 21 +++++++++++++++++---- src/server/.babelrc | 4 ++-- 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 3f9c6ce..9e5fb0d 100644 --- a/package.json +++ b/package.json @@ -19,20 +19,22 @@ "license": "MIT", "dependencies": {}, "devDependencies": { + "@babel/cli": "^7.4.4", + "@babel/core": "^7.4.5", + "@babel/plugin-proposal-class-properties": "^7.4.4", + "@babel/polyfill": "^7.4.4", + "@babel/preset-env": "^7.4.5", + "@babel/preset-react": "^7.0.0", "@google/clasp": "^1.7.0", "@types/google-apps-script": "0.0.26", - "babel-cli": "^6.26.0", - "babel-core": "^6.26.3", - "babel-eslint": "^8.2.6", - "babel-loader": "^7.1.5", + "babel-eslint": "^10.0.2", + "babel-loader": "^8.0.6", "babel-plugin-add-module-exports": "^0.2.1", "babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-es3-member-expression-literals": "^6.22.0", "babel-plugin-transform-es3-property-literals": "^6.22.0", "babel-plugin-transform-object-assign": "^6.22.0", "babel-plugin-transform-object-rest-spread": "^6.26.0", - "babel-preset-env": "^1.7.0", - "babel-preset-react": "^6.24.1", "clean-webpack-plugin": "^0.1.19", "copy-webpack-plugin": "^4.6.0", "css-loader": "^1.0.1", @@ -41,6 +43,7 @@ "eslint-config-prettier": "^2.9.0", "eslint-config-standard": "^11.0.0", "eslint-loader": "^2.1.2", + "eslint-plugin-babel": "^5.3.0", "eslint-plugin-googleappsscript": "^1.0.2", "eslint-plugin-import": "^2.17.3", "eslint-plugin-jsx-a11y": "^6.2.1", diff --git a/src/client/.babelrc b/src/client/.babelrc index 1515f32..7f2024f 100644 --- a/src/client/.babelrc +++ b/src/client/.babelrc @@ -1,3 +1,4 @@ { - "presets": ["react"] -} \ No newline at end of file + "presets": ["@babel/react"], + "plugins": ["@babel/plugin-proposal-class-properties"] +} diff --git a/src/client/.eslintrc.json b/src/client/.eslintrc.json index 9a02a4f..ccb72f4 100644 --- a/src/client/.eslintrc.json +++ b/src/client/.eslintrc.json @@ -1,8 +1,15 @@ { "root": true, "parser": "babel-eslint", - "extends": ["plugin:react/recommended", "eslint:recommended", "google"], - "plugins": ["react"], + "extends": [ + "plugin:react/recommended", + "eslint:recommended", + "google" + ], + "plugins": [ + "babel", + "react" + ], "env": { "browser": true }, @@ -14,6 +21,12 @@ "rules": { "import/prefer-default-export": 0, "no-console": 0, - "require-jsdoc" : 0 + "require-jsdoc": 0, + "semi": [ + 2, + "never" + ], + "no-invalid-this": 0, + "babel/no-invalid-this": 1 } -} \ No newline at end of file +} diff --git a/src/server/.babelrc b/src/server/.babelrc index 3539fbc..f1ae1dc 100644 --- a/src/server/.babelrc +++ b/src/server/.babelrc @@ -1,6 +1,6 @@ { "presets": [ - ["env", { + ["@babel/env", { "modules": false }] ], @@ -11,4 +11,4 @@ "transform-object-rest-spread", "transform-object-assign" ] -} \ No newline at end of file +}