Skip to content
This repository has been archived by the owner on May 11, 2018. It is now read-only.

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
hzoo committed Nov 2, 2016
1 parent bffbfdb commit 153d5ad
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 15 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fixtures
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
},
"rules": {
"max-len": 0
},
"env": {
"mocha": true
}
}
}
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const isPluginRequired = (supportedEnvironments, plugin) => {
if (targetEnvironments.length === 0) { return true; }

const isRequiredForEnvironments = targetEnvironments
.filter(environment => {
.filter((environment) => {
// Feature is not implemented in that environment
if (!plugin[environment]) { return true; }

Expand All @@ -43,7 +43,7 @@ export const isPluginRequired = (supportedEnvironments, plugin) => {
return isRequiredForEnvironments.length > 0 ? true : false;
};

const isBrowsersQueryValid = browsers => {
const isBrowsersQueryValid = (browsers) => {
return typeof browsers === "string" || Array.isArray(browsers);
};

Expand Down Expand Up @@ -121,7 +121,7 @@ export default function buildPreset(context, opts = {}) {
const debug = opts.debug;

let transformations = Object.keys(pluginList)
.filter(pluginName => isPluginRequired(targets, pluginList[pluginName]));
.filter((pluginName) => isPluginRequired(targets, pluginList[pluginName]));

if (debug) {
console.log("");
Expand All @@ -130,7 +130,7 @@ export default function buildPreset(context, opts = {}) {
console.log("Using plugins:");
console.log("");
console.log(`module: ${moduleType}`);
transformations.forEach(transform => {
transformations.forEach((transform) => {
let envList = pluginList[transform];
let filteredList = Object.keys(targets)
.reduce((a, b) => {
Expand All @@ -141,7 +141,7 @@ export default function buildPreset(context, opts = {}) {
});
}

transformations = [...transformations, ...whitelist].map(pluginName => {
transformations = [...transformations, ...whitelist].map((pluginName) => {
return [require(`babel-plugin-${pluginName}`), { loose }];
});

Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/preset-options/empty-options/actual.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
const a = `1`;
const a = "1";
2 changes: 1 addition & 1 deletion test/fixtures/preset-options/empty-options/expected.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use strict";

var a = "1";
var a = "1";
2 changes: 1 addition & 1 deletion test/fixtures/preset-options/modules-false/actual.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import a from 'a';
import a from "a";
2 changes: 1 addition & 1 deletion test/fixtures/preset-options/modules-false/expected.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import a from 'a';
import a from "a";
2 changes: 1 addition & 1 deletion test/fixtures/preset-options/no-options/actual.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
const a = `1`;
const a = "1";
2 changes: 1 addition & 1 deletion test/fixtures/preset-options/no-options/expected.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use strict";

var a = "1";
var a = "1";
2 changes: 1 addition & 1 deletion test/fixtures/preset-options/whitelist/actual.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import a from 'a';
import a from "a";
6 changes: 3 additions & 3 deletions test/fixtures/preset-options/whitelist/expected.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
"use strict";

var _a = require('a');
var _a = require("a");

var _a2 = _interopRequireDefault(_a);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

0 comments on commit 153d5ad

Please sign in to comment.