diff --git a/.eslintrc b/.eslintrc index d0707a444..12d1b974b 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,4 +1,7 @@ { "root": true, - "extends": ["@vant"] + "extends": ["@vant"], + "rules": { + "no-unused-vars": ["error", { "vars": "all", "args": "none" }] + } } diff --git a/babel.config.js b/babel.config.js index 8175adeb9..d7da7b5cc 100644 --- a/babel.config.js +++ b/babel.config.js @@ -24,6 +24,7 @@ module.exports = function (api) { useESModules } ], + 'transform-vue-jsx', '@babel/plugin-syntax-dynamic-import', '@babel/plugin-transform-object-assign' ] diff --git a/package.json b/package.json index 540bf25ca..525ecc383 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,7 @@ "devDependencies": { "@babel/core": "^7.2.2", "@babel/plugin-syntax-dynamic-import": "^7.0.0", + "@babel/plugin-syntax-jsx": "^7.2.0", "@babel/plugin-transform-object-assign": "^7.0.0", "@babel/plugin-transform-runtime": "^7.1.0", "@babel/polyfill": "^7.2.5", @@ -80,8 +81,10 @@ "@vue/test-utils": "^1.0.0-beta.26", "autoprefixer": "^9.4.3", "babel-core": "^7.0.0-0", + "babel-helper-vue-jsx-merge-props": "^2.0.3", "babel-jest": "^23.6.0", "babel-loader": "^8.0.4", + "babel-plugin-transform-vue-jsx": "4.0.1", "codecov": "^3.1.0", "cross-env": "^5.2.0", "css-loader": "^2.1.0", diff --git a/yarn.lock b/yarn.lock index 0f9747cf4..63f743754 100644 --- a/yarn.lock +++ b/yarn.lock @@ -281,6 +281,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-syntax-jsx@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.2.0.tgz#0b85a3b4bc7cdf4cc4b8bf236335b907ca22e7c7" + integrity sha512-VyN4QANJkRW6lDBmENzRszvZf3/4AXaj9YR7GwrWeeN9tEBPuXbmDYVU9bYBN0D70zCWVwUy0HWq2553VCb6Hw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-object-rest-spread@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e" @@ -1353,6 +1360,11 @@ babel-generator@^6.18.0, babel-generator@^6.26.0: source-map "^0.5.7" trim-right "^1.0.1" +babel-helper-vue-jsx-merge-props@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz#22aebd3b33902328e513293a8e4992b384f9f1b6" + integrity sha512-gsLiKK7Qrb7zYJNgiXKpXblxbV5ffSwR0f5whkPAaBAR4fhi6bwRZxX9wBlIc5M/v8CCkXUbXZL4N/nSE97cqg== + babel-helpers@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" @@ -1415,6 +1427,13 @@ babel-plugin-transform-strict-mode@^6.24.1: babel-runtime "^6.22.0" babel-types "^6.24.1" +babel-plugin-transform-vue-jsx@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-vue-jsx/-/babel-plugin-transform-vue-jsx-4.0.1.tgz#2c8bddce87a6ef09eaa59869ff1bfbeeafc5f88d" + integrity sha512-wbOz7ITB5cloLSjKUU1hWn8zhR+Dwah/RZiTiJY/CQliCwhowmzu6m7NEF+y5EJX/blDzGjRtZvC10Vdb3Q7vw== + dependencies: + esutils "^2.0.2" + babel-preset-jest@^23.2.0: version "23.2.0" resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-23.2.0.tgz#8ec7a03a138f001a1a8fb1e8113652bf1a55da46"