Skip to content

Commit

Permalink
Update eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
pbeshai committed Feb 28, 2020
1 parent 510747c commit 1b6b4d4
Showing 4 changed files with 1,674 additions and 1,881 deletions.
29 changes: 13 additions & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
module.exports = {
extends: 'eslint-config-airbnb-base',
parser: 'babel-eslint',
env: {
browser: true,
es6: true,
node: true,
},
extends: ['eslint:recommended', 'prettier'],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: false,
},
},
globals: {},
rules: {
'no-shadow': 0,
'no-param-reassign': 0,
'no-console': 0,
'no-eval': 0,
'no-mixed-operators': 0,
'import/default': 0,
'import/no-duplicates': 0,
'import/named': 0,
'import/namespace': 0,
'import/no-unresolved': 0,
'import/no-named-as-default': 2,
// breaks on importing d3
'import/no-extraneous-dependencies': 0,
'no-unused-vars': 'warn',
'no-empty': 'warn',
},
plugins: ['import'],
};
43 changes: 29 additions & 14 deletions docs/d3-interpolate-path.js
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = global || self, factory(global.d3 = global.d3 || {}));
}(this, function (exports) { 'use strict';
}(this, (function (exports) { 'use strict';

function _defineProperty(obj, key, value) {
if (key in obj) {
@@ -37,20 +37,35 @@ function _extends() {
return _extends.apply(this, arguments);
}

function _objectSpread(target) {
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);

if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}

return keys;
}

function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);

if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}

ownKeys.forEach(function (key) {
_defineProperty(target, key, source[key]);
});
}

return target;
@@ -205,7 +220,7 @@ function splitCurve(commandStart, commandEnd, segmentCount) {
return splitCurveAsPoints(points, segmentCount).map(pointsToCommand);
}

var commandTokenRegex = /[MLCSTQAHVmlcstqahv]|[\d.-]+/g;
var commandTokenRegex = /[MLCSTQAHVmlcstqahv]|-?[\d.e+-]+/g;
/**
* List of params for each command type in a path `d` attribute
*/
@@ -515,7 +530,7 @@ function interpolatePath(a, b, excludeSegment) {
}); // create mutable interpolated command objects

var interpolatedCommands = aCommands.map(function (aCommand) {
return _objectSpread({}, aCommand);
return _objectSpread2({}, aCommand);
});
var addZ = (a == null || a[a.length - 1] === 'Z') && (b == null || b[b.length - 1] === 'Z');
return function pathInterpolator(t) {
@@ -599,4 +614,4 @@ exports.interpolatePath = interpolatePath;

Object.defineProperty(exports, '__esModule', { value: true });

}));
})));
Loading

0 comments on commit 1b6b4d4

Please sign in to comment.