upgrade to babel 6

This commit is contained in:
Stas Vilchik 2015-12-15 14:53:36 +01:00
parent 075f913eff
commit 5d2c52a27a
7 changed files with 23 additions and 16 deletions

View File

@ -0,0 +1,6 @@
{
"presets": ["es2015", "react"],
"ignore": [
"**/libs/**"
]
}

View File

@ -1,2 +0,0 @@
instrumentation:
root: 'src/main/js'

View File

@ -5,9 +5,13 @@
"repository": "SonarSource/sonarqube",
"license": "LGPL-3.0",
"devDependencies": {
"babel": "5.8.23",
"babel-eslint": "^4.1.6",
"babelify": "6.3.0",
"babel-cli": "^6.3.17",
"babel-eslint": "4.1.6",
"babel-polyfill": "^6.3.14",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-register": "^6.3.13",
"babelify": "7.2.0",
"backbone": "1.2.3",
"backbone.marionette": "2.4.3",
"blueimp-md5": "1.1.1",
@ -39,10 +43,10 @@
"gulp-util": "3.0.6",
"handlebars": "2.0.0",
"hbsfy": "2.3.1",
"isparta": "3.0.4",
"isparta": "^4.0.0",
"jquery": "2.1.4",
"jsdom": "6.5.1",
"mocha": "2.3.3",
"mocha": "^2.3.4",
"moment": "2.10.6",
"numeral": "1.5.3",
"react": "0.14.2",
@ -61,8 +65,8 @@
"scripts": {
"build-fast": "gulp --fast",
"build": "gulp",
"test": "./node_modules/.bin/mocha --opts tests/mocha.opts tests",
"coverage": "./node_modules/.bin/babel-node ./node_modules/.bin/isparta cover --dir './target/coverage' ./node_modules/.bin/_mocha -- --opts tests/mocha.opts tests",
"test": "mocha --opts tests/mocha.opts tests",
"coverage": "babel-node node_modules/.bin/isparta cover --root 'src/main/js' --include-all-sources --excludes '**/libs/**' --dir 'target/coverage' node_modules/.bin/_mocha -- --opts tests/mocha.opts tests",
"lint": "eslint src/main/js"
},
"browserify-shim": {

View File

@ -62,7 +62,7 @@ export default React.createClass({
changeYear: true,
onSelect: this.onDateInputChange
};
if ($.fn.datepicker) {
if ($.fn && $.fn.datepicker) {
$(this.refs.minDate).datepicker(opts);
$(this.refs.maxDate).datepicker(opts);
}

View File

@ -19,21 +19,21 @@ export const TooltipsMixin = {
},
initTooltips () {
if ($.fn.tooltip) {
if ($.fn && $.fn.tooltip) {
$('[data-toggle="tooltip"]', ReactDOM.findDOMNode(this))
.tooltip({ container: 'body', placement: 'bottom', html: true });
}
},
hideTooltips () {
if ($.fn.tooltip) {
if ($.fn && $.fn.tooltip) {
$('[data-toggle="tooltip"]', ReactDOM.findDOMNode(this))
.tooltip('hide');
}
},
destroyTooltips () {
if ($.fn.tooltip) {
if ($.fn && $.fn.tooltip) {
$('[data-toggle="tooltip"]', ReactDOM.findDOMNode(this))
.tooltip('destroy');
}

View File

@ -1,4 +1,4 @@
import 'babelify/polyfill';
import 'babel-polyfill';
import $ from 'jquery';
import _ from 'underscore';
import Backbone from 'backbone';

View File

@ -1,4 +1,3 @@
--recursive
--compilers js:babel/register
--compilers jsx:babel/register
--compilers js:babel-register
--require tests/jsdom-setup.js