devDeps: eslint-config-babel v5.0.0 (#139)
This commit is contained in:
parent
da75840794
commit
ad5698ed19
@ -55,9 +55,8 @@
|
||||
"babel-preset-es2015": "^6.14.0",
|
||||
"babel-register": "^6.14.0",
|
||||
"compat-table": "kangax/compat-table#b0cec63ea21f3a7788a8eececcb918de903b7fc5",
|
||||
"eslint": "^3.3.1",
|
||||
"eslint-config-babel": "^3.0.0",
|
||||
"eslint-plugin-babel": "^4.0.0",
|
||||
"eslint": "^3.13.1",
|
||||
"eslint-config-babel": "^5.0.0",
|
||||
"eslint-plugin-flowtype": "^2.29.1",
|
||||
"lodash": "^4.15.0",
|
||||
"mocha": "^3.0.2",
|
||||
|
||||
@ -80,7 +80,7 @@ const envMap = {
|
||||
};
|
||||
|
||||
const getLowestImplementedVersion = ({ features }, env) => {
|
||||
let tests = flatten(compatibilityTests
|
||||
const tests = flatten(compatibilityTests
|
||||
.filter((test) => {
|
||||
return features.indexOf(test.name) >= 0 ||
|
||||
// for features === ["DataView"]
|
||||
@ -104,7 +104,7 @@ const getLowestImplementedVersion = ({ features }, env) => {
|
||||
})
|
||||
);
|
||||
|
||||
let envTests = tests
|
||||
const envTests = tests
|
||||
.map(({ res: test, name, isBuiltIn }, i) => {
|
||||
// Babel itself doesn't implement the feature correctly,
|
||||
// don't count against it
|
||||
@ -133,7 +133,7 @@ const getLowestImplementedVersion = ({ features }, env) => {
|
||||
.shift();
|
||||
});
|
||||
|
||||
let envFiltered = envTests.filter((t) => t);
|
||||
const envFiltered = envTests.filter((t) => t);
|
||||
if (envTests.length > envFiltered.length || envTests.length === 0) {
|
||||
// envTests.forEach((test, i) => {
|
||||
// if (!test) {
|
||||
|
||||
@ -111,7 +111,7 @@ export const electronVersionToChromeVersion = (semverVer) => {
|
||||
throw new Error("Electron version must be a semver version");
|
||||
}
|
||||
|
||||
let result = electronToChromium[m[1]];
|
||||
const result = electronToChromium[m[1]];
|
||||
if (!result) {
|
||||
throw new Error(`Electron version ${m[1]} is either too old or too new`);
|
||||
}
|
||||
@ -122,7 +122,7 @@ export const electronVersionToChromeVersion = (semverVer) => {
|
||||
const _extends = Object.assign || function (target) {
|
||||
for (let i = 1; i < arguments.length; i++) {
|
||||
const source = arguments[i];
|
||||
for (let key in source) {
|
||||
for (const key in source) {
|
||||
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||||
target[key] = source[key];
|
||||
}
|
||||
@ -178,7 +178,7 @@ export function validatePluginsOption(opts = [], type) {
|
||||
throw new Error(`The '${type}' option must be an Array<string> of plugins/built-ins`);
|
||||
}
|
||||
|
||||
let unknownOpts = [];
|
||||
const unknownOpts = [];
|
||||
opts.forEach((opt) => {
|
||||
if (validIncludesAndExcludes.indexOf(opt) === -1) {
|
||||
unknownOpts.push(opt);
|
||||
@ -201,7 +201,7 @@ const validateIncludeOption = (opts) => validatePluginsOption(opts, "include");
|
||||
const validateExcludeOption = (opts) => validatePluginsOption(opts, "exclude");
|
||||
|
||||
export function checkDuplicateIncludeExcludes(include, exclude) {
|
||||
let duplicates = [];
|
||||
const duplicates = [];
|
||||
include.forEach((opt) => {
|
||||
if (exclude.indexOf(opt) >= 0) {
|
||||
duplicates.push(opt);
|
||||
@ -254,7 +254,7 @@ export default function buildPreset(context, opts = {}) {
|
||||
const useBuiltIns = opts.useBuiltIns;
|
||||
|
||||
const filterPlugins = filterItem.bind(null, targets, exclude.plugins, pluginList);
|
||||
let transformations = Object.keys(pluginList)
|
||||
const transformations = Object.keys(pluginList)
|
||||
.filter(filterPlugins)
|
||||
.concat(include.plugins);
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ function isPolyfillSource(value) {
|
||||
|
||||
export default function ({ types: t }) {
|
||||
function createImportDeclaration(polyfill) {
|
||||
let declar = t.importDeclaration([], t.stringLiteral(polyfill));
|
||||
const declar = t.importDeclaration([], t.stringLiteral(polyfill));
|
||||
declar._blockHoist = 3;
|
||||
return declar;
|
||||
}
|
||||
@ -43,7 +43,7 @@ export default function ({ types: t }) {
|
||||
}
|
||||
|
||||
function createImports(polyfills, requireType, regenerator) {
|
||||
let imports = polyfills
|
||||
const imports = polyfills
|
||||
.filter((el, i, arr) => arr.indexOf(el) === i)
|
||||
.map((polyfill) => createImport(polyfill, requireType, true));
|
||||
|
||||
|
||||
@ -145,12 +145,11 @@ describe("babel-preset-env", () => {
|
||||
});
|
||||
|
||||
it("doesn't throw when specifiying a decimal for node", () => {
|
||||
let targets;
|
||||
const plugin = {
|
||||
node: 6
|
||||
};
|
||||
|
||||
targets = {
|
||||
const targets = {
|
||||
"node": 6.5
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user