Skip to content

Commit

Permalink
Reformat and use single quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
tillarnold committed Mar 3, 2016
1 parent 0c4988e commit 7d2f566
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions tasks/jshint.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ var rewire = require('rewire');
var proxyquire = require('proxyquire');

try {
var babelCore = require("babel-core");
} catch (e) {
var babelCore = require('babel-core');
}
catch (e) {
throw new Error('babel-core: The module `babel-core` was not found. ' +
'To fix this error run `npm install babel-core --save-dev`.', e);
'To fix this error run `npm install babel-core --save-dev`.', e);
}

try {
require("babel-plugin-transform-react-jsx");
} catch (e) {
require('babel-plugin-transform-react-jsx');
}
catch (e) {
throw new Error('babel transform-react-jsx: The module `babel-plugin-transform-react-jsx` was not found. ' +
'To fix this error run `npm install babel-plugin-transform-react-jsx --save-dev`.', e);
}
Expand Down Expand Up @@ -46,7 +49,7 @@ var gruntContribJshint = proxyquire('grunt-contrib-jshint/tasks/jshint', {
});

//return the modified grunt-contrib-jshint version
module.exports = function (grunt) {
module.exports = function(grunt) {
var additionalSuffixes = grunt.config(['jshint', 'options', 'additionalSuffixes']) || [];

var defaultSuffixes = ['.jsx', '.react.js'].concat(additionalSuffixes);
Expand All @@ -63,9 +66,10 @@ module.exports = function (grunt) {

try {
compiled = babelCore.transform(code, {
plugins: ["transform-react-jsx"]
plugins: ['transform-react-jsx']
});
} catch (err) {
}
catch (err) {
throw new Error('grunt-jsxhint: Error while running JSXTransformer on ' + file + '\n' + err.message);
}

Expand Down

0 comments on commit 7d2f566

Please sign in to comment.