Skip to content

Commit

Permalink
use linting node >= 6
Browse files Browse the repository at this point in the history
  • Loading branch information
vikr01 committed Oct 3, 2018
1 parent 750087c commit 7c713f0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
4 changes: 1 addition & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
{
"root": true,

"extends": "airbnb-base/legacy",
"extends": "airbnb-base",

"rules": {
"global-require": 0,
"no-var": 0,
"strict": ["error", "global"]
},
"parserOptions": {
"ecmaVersion": 5,
"sourceType": "script"
},
}
32 changes: 16 additions & 16 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
'use strict';

var assign = require('object.assign');
var declare = require('@babel/helper-plugin-utils').declare;
const assign = require('object.assign');
const { declare } = require('@babel/helper-plugin-utils');

var defaultTargets = {
const defaultTargets = {
android: 30,
chrome: 35,
edge: 14,
explorer: 9,
firefox: 52,
safari: 8,
ucandroid: 1
ucandroid: 1,
};

function buildTargets(options) {
return assign({}, defaultTargets, options.additionalTargets);
}

module.exports = declare(function buildAirbnbPreset(api, options) {
var transpileTargets = (options && options.targets) || buildTargets(options || {});
module.exports = declare((api, options) => {
const transpileTargets = (options && options.targets) || buildTargets(options || {});

var debug = (options && typeof options.debug === 'boolean') ? !!options.debug : false;
const debug = (options && typeof options.debug === 'boolean') ? !!options.debug : false;

api.assertVersion(7);

return {
presets: [
[require('@babel/preset-env'), {
debug: debug,
debug,
exclude: [
'transform-async-to-generator',
'transform-template-literals',
'transform-regenerator'
'transform-regenerator',
],
modules: options.modules,
targets: transpileTargets
targets: transpileTargets,
}],
[require('@babel/preset-react'), { development: api.env('development') }]
[require('@babel/preset-react'), { development: api.env('development') }],
],
plugins: [
options && !!options.removePropTypes ? ['babel-plugin-transform-react-remove-prop-types', assign({
mode: 'wrap',
additionalLibraries: ['airbnb-prop-types'],
ignoreFilenames: ['node_modules']
ignoreFilenames: ['node_modules'],
}, options.removePropTypes)] : null,

[require('@babel/plugin-transform-template-literals'), {
spec: true
spec: true,
}],
require('@babel/plugin-transform-property-mutators'),
require('@babel/plugin-transform-member-expression-literals'),
require('@babel/plugin-transform-property-literals'),
require('@babel/plugin-transform-jscript'),
[require('@babel/plugin-proposal-object-rest-spread'), {
useBuiltIns: true
}]
].filter(Boolean)
useBuiltIns: true,
}],
].filter(Boolean),
};
});

0 comments on commit 7c713f0

Please sign in to comment.