未验证 提交 142e7b6d 编写于 作者: M Maxime Beauchemin 提交者: GitHub

Finish move to babel 7 (#6573)

* Finish move to babel 7

* Bump jest to 23.6.0

* Address comments
上级 60995198
{
"presets" : ["airbnb", "react", "env"],
"presets" : ["airbnb", "@babel/preset-react", "@babel/preset-env"],
"plugins": ["lodash", "syntax-dynamic-import", "react-hot-loader/babel"],
"env": {
"test": {
......
verbose: true
instrumentation:
root: './src'
extensions: ['.js', '.jsx']
excludes: [
'dist/**',
'visualizations/index.js',
'visualizations/**/*ChartPlugin.js',
]
embed-source: false
variable: __coverage__
compact: true
preserve-comments: false
complete-copy: false
save-baseline: true
baseline-file: ./coverage/coverage-baseline.json
include-all-sources: true
include-pid: false
es-modules: true
reporting:
print: summary
reports:
- lcov
dir: ./coverage
watermarks:
statements: [50, 80]
lines: [50, 80]
functions: [50, 80]
branches: [50, 80]
report-config:
clover: {file: clover.xml}
cobertura: {file: cobertura-coverage.xml}
json: {file: coverage-final.json}
json-summary: {file: coverage-summary.json}
lcovonly: {file: lcov.info}
teamcity: {file: null, blockName: Code Coverage Summary}
text: {file: null, maxCols: 0}
text-lcov: {file: lcov.info}
text-summary: {file: null}
hooks:
hook-run-in-context: false
post-require-hook: null
handle-sigint: false
check:
global:
statements: 0
lines: 0
branches: 0
functions: 0
excludes: []
each:
statements: 0
lines: 0
branches: 0
functions: 0
excludes: []
此差异已折叠。
此差异已折叠。
......@@ -17,7 +17,7 @@
"build": "NODE_ENV=production webpack --mode=production --colors --progress",
"lint": "eslint --ignore-path=.eslintignore --ext .js,.jsx . && tslint -c tslint.json ./{src,spec}/**/*.ts{,x}",
"lint-fix": "eslint --fix --ignore-path=.eslintignore --ext .js,.jsx . && tslint -c tslint.json --fix ./{src,spec}/**/*.ts{,x}",
"sync-backend": "babel-node --presets env src/syncBackend.js",
"sync-backend": "babel-node --preset=@babel/preset-env src/syncBackend.js",
"cypress": "cypress",
"cypress-debug": "cypress open --config watchForFileChanges=true"
},
......@@ -134,22 +134,25 @@
"viewport-mercator-project": "^5.0.0"
},
"devDependencies": {
"@babel/cli": "^7.0.0",
"@babel/cli": "^7.2.3",
"@babel/core": "^7.2.2",
"@babel/node": "^7.2.2",
"@babel/polyfill": "^7.0.0",
"@babel/preset-env": "^7.2.3",
"@babel/preset-react": "^7.0.0",
"@babel/register": "^7.0.0",
"@types/jest": "^23.3.5",
"@types/react": "^16.4.18",
"@types/react-dom": "^16.0.9",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^23.6.0",
"babel-loader": "^7.1.4",
"babel-loader": "^8.0.4",
"babel-plugin-css-modules-transform": "^1.1.0",
"babel-plugin-dynamic-import-node": "^1.2.0",
"babel-plugin-lodash": "^3.3.4",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-preset-airbnb": "^2.1.1",
"babel-preset-env": "^1.7.0",
"babel-preset-airbnb": "^3.2.0",
"cache-loader": "^1.2.2",
"clean-webpack-plugin": "^0.1.19",
"css-loader": "^1.0.0",
......
......@@ -144,12 +144,6 @@ export default function chartReducer(charts = {}, action) {
annotationQuery,
};
},
[actions.SQLLAB_REDIRECT_FAILED](state) {
return { ...state,
chartStatus: 'failed',
chartAlert: t('An error occurred while redirecting to SQL Lab: %s', action.error),
};
},
};
/* eslint-disable no-param-reassign */
......
......@@ -5,8 +5,7 @@ import { exportChart } from '../../../explore/exploreUtils';
import SliceHeader from '../SliceHeader';
import ChartContainer from '../../../chart/ChartContainer';
import MissingChart from '../MissingChart';
import { chartPropType } from '../../../chart/chartReducer';
import { slicePropShape } from '../../util/propShapes';
import { slicePropShape, chartPropShape } from '../../util/propShapes';
const propTypes = {
id: PropTypes.number.isRequired,
......@@ -15,7 +14,7 @@ const propTypes = {
updateSliceName: PropTypes.func.isRequired,
// from redux
chart: PropTypes.shape(chartPropType).isRequired,
chart: PropTypes.shape(chartPropShape).isRequired,
formData: PropTypes.object.isRequired,
datasource: PropTypes.object.isRequired,
slice: slicePropShape.isRequired,
......
......@@ -16,19 +16,6 @@ export default function exploreReducer(state = {}, action) {
isDatasourceMetaLoading: true,
};
},
[actions.POST_DATASOURCE_SUCCEEDED]() {
return {
...state,
isDatasourceMetaLoading: false,
};
},
[actions.POST_DATASOURCE_FAILED]() {
return {
...state,
isDatasourceMetaLoading: false,
controlPanelAlert: action.error,
};
},
[actions.SET_DATASOURCE]() {
return {
...state,
......
......@@ -3498,17 +3498,4 @@ function arrayEquals(arrayA, arrayB) {
return true;
}
/**
* AMD Loader
*/
if (typeof define === "function" && define.amd) {
define(["d3"], function() {
"use strict";
return CalHeatMap;
});
} else if (typeof module === "object" && module.exports) {
module.exports = CalHeatMap;
} else {
window.CalHeatMap = CalHeatMap;
}
export default CalHeatMap;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册