diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..f534d74 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,218 @@ +{ + "env": { + "browser": true, + "commonjs": true + }, + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": 5 + }, + "rules": { + "accessor-pairs": "error", + "array-bracket-spacing": [ "error", "always" ], + "array-callback-return": "error", + "array-element-newline": "off", + "arrow-body-style": [ "error", "always" ], + "arrow-parens": [ "error", "always" ], + "arrow-spacing": "error", + "block-scoped-var": "error", + "block-spacing": "error", + "brace-style": [ "error", "1tbs" ], + "camelcase": "error", + "class-methods-use-this": "error", + "comma-dangle": [ "error", "always-multiline" ], + "comma-spacing": "error", + "comma-style": [ "error", "last" ], + "complexity": [ "error", 12 ], + "consistent-this": [ "error", "_this" ], + "curly": "error", + "default-case": "error", + "dot-location": [ "error", "property" ], + "dot-notation": "error", + "eol-last": "error", + "eqeqeq": "off", + "func-call-spacing": "error", + "func-name-matching": "error", + "func-style": [ "error", "declaration" ], + "function-paren-newline": [ "error", "consistent" ], + "generator-star-spacing": "error", + "id-blacklist": [ "error", "data", "callback" ], + "id-length": [ "error", { + "min": 3, + "max": 30, + "exceptions": [ "x", "y", "z", "i", "a", "b" ] + }], + "id-match": "error", + "implicit-arrow-linebreak": "error", + "indent": [ "error", 2, { + "VariableDeclarator": 4, + "CallExpression": { "arguments": 2 }, + "FunctionExpression": { "body": 1, "parameters": 2 }, + "ignoredNodes": [ "CallExpression > FunctionExpression > BlockStatement.body" ] + }], + "key-spacing": "error", + "keyword-spacing": [ "error", { + "before": true, + "after": true + }], + "linebreak-style": [ "error", "unix" ], + "lines-around-comment": "error", + "lines-between-class-members": "error", + "max-classes-per-file": "error", + "max-depth": "error", + "max-len": [ "error", { + "code": 80 + }], + "max-lines": [ "error", { + "max": 300 + }], + "max-nested-callbacks": "error", + "max-statements-per-line": "error", + "new-cap": "error", + "new-parens": "error", + "newline-per-chained-call": "error", + "no-alert": "error", + "no-array-constructor": "error", + "no-async-promise-executor": "error", + "no-await-in-loop": "error", + "no-bitwise": "error", + "no-buffer-constructor": "error", + "no-caller": "error", + "no-catch-shadow": "error", + "no-confusing-arrow": "error", + "no-continue": "error", + "no-div-regex": "error", + "no-duplicate-imports": "error", + "no-eq-null": "error", + "no-eval": "error", + "no-extend-native": "error", + "no-extra-bind": "error", + "no-extra-label": "error", + "no-extra-parens": [ "error", "all", { + "nestedBinaryExpressions": false + }], + "no-floating-decimal": "error", + "no-implicit-globals": "error", + "no-implied-eval": "error", + "no-inner-declarations": [ "error", "functions" ], + "no-invalid-this": "error", + "no-iterator": "error", + "no-label-var": "error", + "no-labels": "error", + "no-lone-blocks": "error", + "no-lonely-if": "error", + "no-loop-func": "error", + "no-magic-numbers": "off", + "no-misleading-character-class": "error", + "no-mixed-requires": "error", + "no-multi-assign": "off", + "no-multi-spaces": [ "error", { + "exceptions": { "Property": true } + }], + "no-multi-str": "error", + "no-multiple-empty-lines": "error", + "no-native-reassign": "error", + "no-negated-condition": "off", + "no-negated-in-lhs": "error", + "no-nested-ternary": "error", + "no-new-func": "error", + "no-new-object": "error", + "no-new-require": "error", + "no-new-wrappers": "error", + "no-octal-escape": "error", + "no-param-reassign": "off", + "no-path-concat": "error", + "no-process-env": "error", + "no-process-exit": "error", + "no-proto": "error", + "no-prototype-builtins": "error", + "no-restricted-globals": "error", + "no-restricted-imports": "error", + "no-restricted-modules": "error", + "no-restricted-properties": "error", + "no-restricted-syntax": "error", + "no-return-assign": "error", + "no-return-await": "error", + "no-script-url": "error", + "no-self-compare": "error", + "no-sequences": "error", + "no-shadow": "error", + "no-shadow-restricted-names": "error", + "no-spaced-func": "error", + "no-tabs": "error", + "no-template-curly-in-string": "error", + "no-ternary": "off", + "no-throw-literal": "error", + "no-trailing-spaces": "error", + "no-undef-init": "error", + "no-undefined": "off", + "no-underscore-dangle": "off", + "no-unmodified-loop-condition": "error", + "no-unneeded-ternary": "error", + "no-unused-expressions": "error", + "no-use-before-define": [ "error", { + "functions": false + }], + "no-useless-call": "error", + "no-useless-catch": "error", + "no-useless-computed-key": "error", + "no-useless-concat": "error", + "no-useless-constructor": "error", + "no-useless-rename": "error", + "no-useless-return": "error", + "no-var": "off", + "no-void": "error", + "no-warning-comments": "off", + "no-whitespace-before-property": "error", + "no-with": "error", + "nonblock-statement-body-position": "error", + "object-curly-newline": "error", + "one-var": [ "error", { + "initialized": "never", + "uninitialized": "always" + }], + "one-var-declaration-per-line": [ "error", "initializations" ], + "operator-assignment": "error", + "operator-linebreak": [ "error", "after" ], + "padded-blocks": "off", + "padding-line-between-statements": "error", + "prefer-arrow-callback": "off", + "prefer-numeric-literals": "error", + "prefer-object-spread": "error", + "prefer-promise-reject-errors": "error", + "prefer-spread": "error", + "quote-props": [ "error", "as-needed" ], + "quotes": [ "error", "single", { + "avoidEscape": true + }], + "radix": "error", + "require-atomic-updates": "error", + "require-await": "error", + "rest-spread-spacing": "error", + "semi": "error", + "semi-spacing": [ "error", { + "after": true, + "before": false + }], + "semi-style": [ "error", "last" ], + "sort-imports": "error", + "space-before-blocks": "error", + "space-before-function-paren": [ "error", "never" ], + "space-in-parens": "off", + "space-infix-ops": "off", + "space-unary-ops": "error", + "spaced-comment": "off", + "strict": [ "error", "never" ], + "switch-colon-spacing": "error", + "symbol-description": "error", + "template-curly-spacing": "error", + "template-tag-spacing": "error", + "unicode-bom": [ "error", "never" ], + "valid-jsdoc": "error", + "vars-on-top": "off", + "wrap-iife": [ "error", "any" ], + "wrap-regex": "error", + "yield-star-spacing": "error", + "yoda": [ "error", "never" ] + } +} diff --git a/Makefile b/Makefile index 101943b..dc4c944 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ uglify: npx uglifyjs dist/zdog.dist.js -o dist/zdog.dist.min.js --mangle --comments /^!/ lint: - npx jshint js/*.js demos/**/*.js tasks/*.js + npx eslint js/ demos/ tasks/ dist: bundle uglify diff --git a/demos/.eslintrc.json b/demos/.eslintrc.json new file mode 100644 index 0000000..fbfa821 --- /dev/null +++ b/demos/.eslintrc.json @@ -0,0 +1,14 @@ +{ + "extends": "../.eslintrc.json", + "globals": { + "Zdog": "readonly" + }, + "rules": { + "key-spacing": "off", + "max-lines": "off", + "one-var": [ "error", { + "initialized": "never", + "uninitialized": "consecutive" + }] + } +} diff --git a/demos/.jshintrc b/demos/.jshintrc deleted file mode 100644 index 1856602..0000000 --- a/demos/.jshintrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": true, - "unused": true, - "undef": true, - "globals": { - "Zdog": false - } -} diff --git a/demos/box-cross/box-cross.js b/demos/box-cross/box-cross.js index f20f854..b4275ae 100644 --- a/demos/box-cross/box-cross.js +++ b/demos/box-cross/box-cross.js @@ -123,7 +123,7 @@ function spin() { var progress = ticker / cycleCount; var turn = Math.floor( progress % 4 ); var theta = Zdog.easeInOut( progress % 1, 3 ) * TAU; - if ( turn == 0 || turn == 2 ) { + if ( turn == 0 || turn == 2 ) { model.rotate.y = theta; } else if ( turn == 1 ) { model.rotate.x = theta; diff --git a/demos/hemisphere-cone-ball/hemisphere-cone-ball.js b/demos/hemisphere-cone-ball/hemisphere-cone-ball.js index 5ee19ee..ba3216d 100644 --- a/demos/hemisphere-cone-ball/hemisphere-cone-ball.js +++ b/demos/hemisphere-cone-ball/hemisphere-cone-ball.js @@ -45,7 +45,7 @@ var cone = new Zdog.Cone({ stroke: false, }); -var colorWheel = [ eggplant, garnet, orange, gold, yellow, ]; +var colorWheel = [ eggplant, garnet, orange, gold, yellow ]; [ true, false ].forEach( function( isHemi ) { var shape = isHemi ? hemi : cone; @@ -71,9 +71,9 @@ var colorWheel = [ eggplant, garnet, orange, gold, yellow, ]; // ----- animate ----- // var keyframes = [ - { x: TAU * 0, y: TAU * 0 }, - { x: TAU * 1/2, y: TAU * 1/2 }, - { x: TAU * 1, y: TAU * 1 }, + { x: TAU*0, y: TAU*0 }, + { x: TAU/2, y: TAU/2 }, + { x: TAU*1, y: TAU*1 }, ]; var ticker = 0; @@ -97,7 +97,7 @@ function spin() { var keyB = keyframes[ turn + 1 ]; var thetaX = Zdog.lerp( keyA.x, keyB.x, tween ); illo.rotate.x = Math.cos( thetaX ) * TAU/12; - illo.rotate.y = Zdog.lerp( keyA.y, keyB.y, tween ) ; + illo.rotate.y = Zdog.lerp( keyA.y, keyB.y, tween ); ticker++; } diff --git a/demos/houses/houses.js b/demos/houses/houses.js index 76f0364..4243569 100644 --- a/demos/houses/houses.js +++ b/demos/houses/houses.js @@ -84,7 +84,7 @@ new Zdog.Shape({ { x: 2, y: -3 }, { x: 2, y: -1 }, ]}, - { x: 2, y: 3 } + { x: 2, y: 3 }, ], translate: { x: 2, y: 4 }, color: eggplant, diff --git a/demos/kid-kit/kid-kit.js b/demos/kid-kit/kid-kit.js index 3c574eb..3abd61e 100644 --- a/demos/kid-kit/kid-kit.js +++ b/demos/kid-kit/kid-kit.js @@ -127,7 +127,7 @@ new Zdog.Shape({ var innerEarXShift = 4; new Zdog.Shape({ path: [ - { x: earA.x - innerEarXShift , y: earA.y-3 }, + { x: earA.x - innerEarXShift, y: earA.y-3 }, { x: earD.x, y: earD.y+5 }, { x: earE.x + innerEarXShift, y: earE.y+2 }, ], @@ -242,7 +242,7 @@ var cloakSide = new Zdog.Anchor({ }); // top straps -var topCloakStrap = new Zdog.Shape({ +var topCloakStrap = new Zdog.Shape({ path: [ { x: cloakX0, y: cloakY0, z: cloakZ0 }, { x: cloakX0, y: cloakY1, z: cloakZ1 }, diff --git a/demos/kirby-parasol/kirby-parasol.js b/demos/kirby-parasol/kirby-parasol.js index d3f50de..2e82383 100644 --- a/demos/kirby-parasol/kirby-parasol.js +++ b/demos/kirby-parasol/kirby-parasol.js @@ -165,7 +165,7 @@ var rightFoot = new Zdog.Shape({ rightFoot.copy({ translate: { x: 9.5, y: 6, z: -6 }, - rotate: { z: -1.1, y: 0.8 } + rotate: { z: -1.1, y: 0.8 }, }); // ----- umbrella ----- // diff --git a/demos/shade-and-shades/shade-and-shades.js b/demos/shade-and-shades/shade-and-shades.js index c7faa6e..47830a8 100644 --- a/demos/shade-and-shades/shade-and-shades.js +++ b/demos/shade-and-shades/shade-and-shades.js @@ -102,12 +102,12 @@ var brimBridge = new Zdog.Shape({ { bezier: [ { x: -16, y: 4, z: 30 }, brimEdge, - brimTip + brimTip, ]}, ], }); brimBridge.copy({ - scale: { x: - 1}, + scale: { x: -1}, }); // glasses front top @@ -115,7 +115,7 @@ var glassFront = new Zdog.Shape({ addTo: illo, path: [ { x: -16 }, - { x: 16 } + { x: 16 }, ], translate: { y: 8, z: 12 }, color: eggplant, diff --git a/demos/shapes/shapes.js b/demos/shapes/shapes.js index ad68d5c..cfe5a59 100644 --- a/demos/shapes/shapes.js +++ b/demos/shapes/shapes.js @@ -67,7 +67,7 @@ new Zdog.Shape({ { move: { y: -1 } }, { y: 1 }, { move: { z: -1 } }, - { z: 1 } + { z: 1 }, ], scale: 1.25, stroke: 1, diff --git a/demos/solids/solids.js b/demos/solids/solids.js index 5cf2338..b23efc7 100644 --- a/demos/solids/solids.js +++ b/demos/solids/solids.js @@ -156,7 +156,7 @@ new Zdog.Cone({ var rotor2 = new Zdog.Anchor({ addTo: rotor1, translate: { z: inradius, y: height/2 }, - rotate: { x: Math.acos(1/3) * -1 + TAU/4 }, + rotate: { x: Math.acos(1/3) * -1 + TAU/4 }, }); triangle.copy({ addTo: rotor2, @@ -284,7 +284,7 @@ solids.push( cube ); for ( var i=0; i < 5; i++ ) { var rotor1 = new Zdog.Anchor({ addTo: dodecahedron, - rotate: { y: TAU/5 * (i) }, + rotate: { y: TAU/5 * i }, }); var rotor2 = new Zdog.Anchor({ addTo: rotor1, @@ -377,7 +377,7 @@ solids.push( cube ); addTo: sideAnchor, translate: { y: -faceRadius/2 }, rotate: { y: TAU/2 }, - color: sideColors[i] + color: sideColors[i], }); } diff --git a/demos/strutter/strutter.js b/demos/strutter/strutter.js index 95a04d3..0eb58cb 100644 --- a/demos/strutter/strutter.js +++ b/demos/strutter/strutter.js @@ -86,7 +86,7 @@ var armSize = 6; path: [ { x: 0 }, { x: armSize } ], scale: { x: xSide }, translate: { x: 4.5 * xSide, y: -8, z: -4 }, - rotate: isRight ? { y: TAU/8, z: -TAU/16 } : { y: TAU/8 }, + rotate: isRight ? { y: TAU/8, z: -TAU/16 } : { y: TAU/8 }, color: eggplant, stroke: 4, }); @@ -95,7 +95,8 @@ var armSize = 6; addTo: upperArm, path: [ { x: 0 }, { x: armSize-2 } ], translate: { x: armSize }, - rotate: isRight ? { z: TAU/16 * 3, y: TAU/4 } : { z: -TAU/4, x: -TAU/32 * 2, y: TAU/8 }, + rotate: isRight ? { z: TAU/16 * 3, y: TAU/4 } : + { z: -TAU/4, x: -TAU/32 * 2, y: TAU/8 }, color: orange, stroke: 4, }); diff --git a/demos/zdog-logo/zdog-logo.js b/demos/zdog-logo/zdog-logo.js index 639a10f..a84ca41 100644 --- a/demos/zdog-logo/zdog-logo.js +++ b/demos/zdog-logo/zdog-logo.js @@ -63,7 +63,7 @@ var endCap = new Zdog.Rect({ backface: false, }); endCap.copy({ - translate: { x: 20, y: 16 }, + translate: { x: 20, y: 16 }, rotate: { y: -TAU/4 }, }); @@ -129,13 +129,13 @@ new Zdog.Ellipse({ var tongueAnchor = new Zdog.Anchor({ addTo: backGroup, translate: { x: -6, y: -7 }, - rotate: { y: TAU/4 }, + rotate: { y: TAU/4 }, }); var tongueH = 12; var tongueS = 5; -var tongueTip = tongueH + tongueS; +var tongueTip = tongueH + tongueS; new Zdog.Shape({ addTo: tongueAnchor, @@ -145,11 +145,11 @@ new Zdog.Shape({ { x: tongueS, y: tongueH }, { arc: [ { x: tongueS, y: tongueTip }, - { x: 0, y: tongueTip } + { x: 0, y: tongueTip }, ]}, { arc: [ { x: -tongueS, y: tongueTip }, - { x: -tongueS, y: tongueH } + { x: -tongueS, y: tongueH }, ]}, ], rotate: { x: TAU/4 - Math.atan(16/22) }, diff --git a/js/.jshintrc b/js/.jshintrc deleted file mode 100644 index fee5bd1..0000000 --- a/js/.jshintrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": true, - "unused": true, - "undef": true -} diff --git a/js/anchor.js b/js/anchor.js index 2194d5e..937c693 100644 --- a/js/anchor.js +++ b/js/anchor.js @@ -5,9 +5,9 @@ ( function( root, factory ) { // module definition if ( typeof module == 'object' && module.exports ) { - /* globals module, require */ // CommonJS + // CommonJS module.exports = factory( require('./boilerplate'), require('./vector'), - require('./canvas-renderer'), require('./svg-renderer') ); + require('./canvas-renderer'), require('./svg-renderer') ); } else { // browser global var Zdog = root.Zdog; diff --git a/js/boilerplate.js b/js/boilerplate.js index 875f450..0e894ec 100644 --- a/js/boilerplate.js +++ b/js/boilerplate.js @@ -13,7 +13,7 @@ ( function( root, factory ) { // module definition if ( typeof module == 'object' && module.exports ) { - /* globals module */ // CommonJS + // CommonJS module.exports = factory(); } else { // browser global @@ -32,8 +32,8 @@ Zdog.extend = function( a, b ) { return a; }; -Zdog.lerp = function( a, b, t ) { - return ( b - a ) * t + a; +Zdog.lerp = function( a, b, alpha ) { + return ( b - a ) * alpha + a; }; Zdog.modulo = function( num, div ) { @@ -52,7 +52,7 @@ var powerMultipliers = { }, 5: function( a ) { return a * a * a * a * a; - } + }, }; Zdog.easeInOut = function( alpha, power ) { @@ -62,11 +62,11 @@ Zdog.easeInOut = function( alpha, power ) { alpha = Math.max( 0, Math.min( 1, alpha ) ); var isFirstHalf = alpha < 0.5; var slope = isFirstHalf ? alpha : 1 - alpha; - slope = slope / 0.5; + slope /= 0.5; // make easing steeper with more multiples var powerMultiplier = powerMultipliers[ power ] || powerMultipliers[2]; var curve = powerMultiplier( slope ); - curve = curve / 2; + curve /= 2; return isFirstHalf ? curve : 1 - curve; }; diff --git a/js/box.js b/js/box.js index 5947ff1..4f8735f 100644 --- a/js/box.js +++ b/js/box.js @@ -5,7 +5,7 @@ ( function( root, factory ) { // module definition if ( typeof module == 'object' && module.exports ) { - /* globals module, require */ // CommonJS + // CommonJS module.exports = factory( require('./boilerplate'), require('./anchor'), require('./shape'), require('./rect') ); } else { diff --git a/js/canvas-renderer.js b/js/canvas-renderer.js index 588362a..d7183cb 100644 --- a/js/canvas-renderer.js +++ b/js/canvas-renderer.js @@ -5,7 +5,7 @@ ( function( root, factory ) { // module definition if ( typeof module == 'object' && module.exports ) { - /* globals module */ // CommonJS + // CommonJS module.exports = factory(); } else { // browser global diff --git a/js/cone.js b/js/cone.js index 1c93bca..4535e5a 100644 --- a/js/cone.js +++ b/js/cone.js @@ -5,7 +5,7 @@ ( function( root, factory ) { // module definition if ( typeof module == 'object' && module.exports ) { - /* globals module, require */ // CommonJS + // CommonJS module.exports = factory( require('./boilerplate'), require('./vector'), require('./path-command'), require('./anchor'), require('./ellipse') ); } else { @@ -69,7 +69,8 @@ Cone.prototype.renderConeSurface = function( ctx, renderer ) { return; } // update tangents - var apexAngle = Math.atan2( this.renderNormal.y, this.renderNormal.x ) + TAU/2; + var apexAngle = Math.atan2( this.renderNormal.y, this.renderNormal.x ) + + TAU/2; var projectLength = apexDistance / eccen; var projectAngle = Math.acos( radius / projectLength ); // set tangent points diff --git a/js/cylinder.js b/js/cylinder.js index 58b7a5c..cc2a4f0 100644 --- a/js/cylinder.js +++ b/js/cylinder.js @@ -5,7 +5,7 @@ ( function( root, factory ) { // module definition if ( typeof module == 'object' && module.exports ) { - /* globals module, require */ // CommonJS + // CommonJS module.exports = factory( require('./boilerplate'), require('./path-command'), require('./shape'), require('./group'), require('./ellipse') ); @@ -20,7 +20,7 @@ function noop() {} // ----- CylinderGroup ----- // - + var CylinderGroup = Group.subclass({ color: '#333', updateSort: true, diff --git a/js/dragger.js b/js/dragger.js index b645d28..9b21035 100644 --- a/js/dragger.js +++ b/js/dragger.js @@ -5,7 +5,7 @@ ( function( root, factory ) { // module definition if ( typeof module == 'object' && module.exports ) { - /* globals module */ // CommonJS + // CommonJS module.exports = factory( root ); } else { // browser global @@ -49,7 +49,7 @@ Dragger.prototype.create = function( options ) { Dragger.prototype.bindDrag = function( element ) { element = this.getQueryElement( element ); if ( element ) { - element.addEventListener( downEvent , this ); + element.addEventListener( downEvent, this ); } }; diff --git a/js/ellipse.js b/js/ellipse.js index bd567d5..fafbe98 100644 --- a/js/ellipse.js +++ b/js/ellipse.js @@ -5,7 +5,7 @@ ( function( root, factory ) { // module definition if ( typeof module == 'object' && module.exports ) { - /* globals module, require */ // CommonJS + // CommonJS module.exports = factory( require('./shape') ); } else { // browser global @@ -33,7 +33,7 @@ Ellipse.prototype.setPath = function() { { arc: [ // top right { x: x, y: -y }, { x: x, y: 0 }, - ]} + ]}, ]; // bottom right if ( this.quarters > 1 ) { diff --git a/js/group.js b/js/group.js index b3121de..ffafb84 100644 --- a/js/group.js +++ b/js/group.js @@ -5,7 +5,7 @@ ( function( root, factory ) { // module definition if ( typeof module == 'object' && module.exports ) { - /* globals module, require */ // CommonJS + // CommonJS module.exports = factory( require('./anchor') ); } else { // browser global @@ -52,7 +52,7 @@ Group.prototype.render = function( ctx, renderer ) { Group.prototype.updateFlatGraph = function() { // do not include self var flatGraph = []; - this.flatGraph = this.addChildFlatGraph( flatGraph ); + this.flatGraph = this.addChildFlatGraph( flatGraph ); }; // do not include children, group handles rendering & sorting internally diff --git a/js/hemisphere.js b/js/hemisphere.js index ed28839..fa92c4e 100644 --- a/js/hemisphere.js +++ b/js/hemisphere.js @@ -5,7 +5,7 @@ ( function( root, factory ) { // module definition if ( typeof module == 'object' && module.exports ) { - /* globals module, require */ // CommonJS + // CommonJS module.exports = factory( require('./boilerplate'), require('./ellipse') ); } else { // browser global @@ -45,10 +45,10 @@ Hemisphere.prototype.renderDome = function( ctx, renderer ) { } else if ( renderer.isSvg ) { // svg contourAngle = (contourAngle - TAU/4) / TAU * 360; - this.domeSvgElement.setAttribute( 'd', 'M ' + (-domeRadius) + ',0 A ' + - domeRadius + ',' + domeRadius + ' 0 0 1 ' + domeRadius + ',0' ); + this.domeSvgElement.setAttribute( 'd', 'M ' + -domeRadius + ',0 A ' + + domeRadius + ',' + domeRadius + ' 0 0 1 ' + domeRadius + ',0' ); this.domeSvgElement.setAttribute( 'transform', - 'translate(' + x + ',' + y + ' ) rotate(' + contourAngle + ')' ); + 'translate(' + x + ',' + y + ' ) rotate(' + contourAngle + ')' ); } renderer.stroke( ctx, elem, this.stroke, this.color, this.getLineWidth() ); diff --git a/js/illustration.js b/js/illustration.js index f0b099d..79d842f 100644 --- a/js/illustration.js +++ b/js/illustration.js @@ -5,7 +5,7 @@ ( function( root, factory ) { // module definition if ( typeof module == 'object' && module.exports ) { - /* globals module, require */ // CommonJS + // CommonJS module.exports = factory( require('./boilerplate'), require('./anchor'), require('./dragger') ); } else { @@ -48,7 +48,7 @@ Illustration.prototype.setElement = function( element ) { } var nodeName = element.nodeName.toLowerCase(); - if ( nodeName == 'canvas' ) { + if ( nodeName == 'canvas' ) { this.setCanvas( element ); } else if ( nodeName == 'svg' ) { this.setSvg( element ); @@ -163,7 +163,7 @@ Illustration.prototype.prerenderCanvas = function() { this.onPrerender( ctx ); }; -Illustration.prototype.postrenderCanvas = function () { +Illustration.prototype.postrenderCanvas = function() { this.ctx.restore(); }; @@ -217,6 +217,7 @@ Illustration.prototype.setDragRotate = function( item ) { if ( !item ) { return; } else if ( item === true ) { + /* eslint consistent-this: "off" */ item = this; } this.dragRotate = item; diff --git a/js/index.js b/js/index.js index 6801475..e55d250 100644 --- a/js/index.js +++ b/js/index.js @@ -5,26 +5,26 @@ ( function( root, factory ) { // module definition if ( typeof module == 'object' && module.exports ) { - /* globals module, require */ // CommonJS + // CommonJS module.exports = factory( - require('./boilerplate'), - require('./canvas-renderer'), - require('./svg-renderer'), - require('./vector'), - require('./anchor'), - require('./dragger'), - require('./illustration'), - require('./path-command'), - require('./shape'), - require('./group'), - require('./rect'), - require('./rounded-rect'), - require('./ellipse'), - require('./polygon'), - require('./hemisphere'), - require('./cylinder'), - require('./cone'), - require('./box') + require('./boilerplate'), + require('./canvas-renderer'), + require('./svg-renderer'), + require('./vector'), + require('./anchor'), + require('./dragger'), + require('./illustration'), + require('./path-command'), + require('./shape'), + require('./group'), + require('./rect'), + require('./rounded-rect'), + require('./ellipse'), + require('./polygon'), + require('./hemisphere'), + require('./cylinder'), + require('./cone'), + require('./box') ); } else if ( typeof define == 'function' && define.amd ) { /* globals define */ // AMD @@ -53,5 +53,4 @@ Zdog.Box = Box; return Zdog; - } -); +}); diff --git a/js/path-command.js b/js/path-command.js index 5867b1e..3a56d34 100644 --- a/js/path-command.js +++ b/js/path-command.js @@ -5,7 +5,7 @@ ( function( root, factory ) { // module definition if ( typeof module == 'object' && module.exports ) { - /* globals module, require */ // CommonJS + // CommonJS module.exports = factory( require('./vector') ); } else { // browser global @@ -73,14 +73,16 @@ PathCommand.prototype.bezier = function( ctx, elem, renderer ) { return renderer.bezier( ctx, elem, cp0, cp1, end ); }; +var arcHandleLength = 9/16; + PathCommand.prototype.arc = function( ctx, elem, renderer ) { var prev = this.previousPoint; var corner = this.renderPoints[0]; var end = this.renderPoints[1]; var cp0 = this.controlPoints[0]; var cp1 = this.controlPoints[1]; - cp0.set( prev ).lerp( corner, 9/16 ); - cp1.set( end ).lerp( corner, 9/16 ); + cp0.set( prev ).lerp( corner, arcHandleLength ); + cp1.set( end ).lerp( corner, arcHandleLength ); return renderer.bezier( ctx, elem, cp0, cp1, end ); }; diff --git a/js/polygon.js b/js/polygon.js index 2f5813f..a3ea770 100644 --- a/js/polygon.js +++ b/js/polygon.js @@ -5,7 +5,7 @@ ( function( root, factory ) { // module definition if ( typeof module == 'object' && module.exports ) { - /* globals module, require */ // CommonJS + // CommonJS module.exports = factory( require('./boilerplate'), require('./shape') ); } else { // browser global diff --git a/js/rect.js b/js/rect.js index 239a43d..9e69542 100644 --- a/js/rect.js +++ b/js/rect.js @@ -5,7 +5,7 @@ ( function( root, factory ) { // module definition if ( typeof module == 'object' && module.exports ) { - /* globals module, require */// CommonJS + // CommonJS module.exports = factory( require('./shape') ); } else { // browser global @@ -22,6 +22,7 @@ var Rect = Shape.subclass({ Rect.prototype.setPath = function() { var x = this.width / 2; var y = this.height / 2; + /* eslint key-spacing: "off" */ this.path = [ { x: -x, y: -y }, { x: x, y: -y }, diff --git a/js/rounded-rect.js b/js/rounded-rect.js index 3f4f6fa..30c8a3f 100644 --- a/js/rounded-rect.js +++ b/js/rounded-rect.js @@ -5,7 +5,7 @@ ( function( root, factory ) { // module definition if ( typeof module == 'object' && module.exports ) { - /* globals module, require */ // CommonJS + // CommonJS module.exports = factory( require('./shape') ); } else { // browser global @@ -22,6 +22,9 @@ var RoundedRect = Shape.subclass({ }); RoundedRect.prototype.setPath = function() { + /* eslint + id-length: [ "error", { "min": 2, "exceptions": [ "x", "y" ] }], + key-spacing: "off" */ var xA = this.width / 2; var yA = this.height / 2; var shortSide = Math.min( xA, yA ); diff --git a/js/shape.js b/js/shape.js index 96af10b..40c927c 100644 --- a/js/shape.js +++ b/js/shape.js @@ -5,8 +5,8 @@ ( function( root, factory ) { // module definition if ( typeof module == 'object' && module.exports ) { - /* globals module, require */ // CommonJS - module.exports = factory( require('./boilerplate'), require('./vector'), + // CommonJS + module.exports = factory( require('./boilerplate'), require('./vector'), require('./path-command'), require('./anchor') ); } else { // browser global diff --git a/js/svg-renderer.js b/js/svg-renderer.js index d2ef7ee..df876a8 100644 --- a/js/svg-renderer.js +++ b/js/svg-renderer.js @@ -5,7 +5,7 @@ ( function( root, factory ) { // module definition if ( typeof module == 'object' && module.exports ) { - /* globals module */ // CommonJS + // CommonJS module.exports = factory(); } else { // browser global diff --git a/js/vector.js b/js/vector.js index f06f796..b896526 100644 --- a/js/vector.js +++ b/js/vector.js @@ -5,7 +5,7 @@ ( function( root, factory ) { // module definition if ( typeof module == 'object' && module.exports ) { - /* globals module, require */ // CommonJS + // CommonJS module.exports = factory( require('./boilerplate') ); } else { // browser global @@ -120,10 +120,10 @@ Vector.prototype.transform = function( translation, rotation, scale ) { return this; }; -Vector.prototype.lerp = function( pos, t ) { - this.x = utils.lerp( this.x, pos.x || 0, t ); - this.y = utils.lerp( this.y, pos.y || 0, t ); - this.z = utils.lerp( this.z, pos.z || 0, t ); +Vector.prototype.lerp = function( pos, alpha ) { + this.x = utils.lerp( this.x, pos.x || 0, alpha ); + this.y = utils.lerp( this.y, pos.y || 0, alpha ); + this.z = utils.lerp( this.z, pos.z || 0, alpha ); return this; }; diff --git a/package-lock.json b/package-lock.json index b0c0800..9459dde 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,86 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/highlight": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", + "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "acorn": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", + "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", + "dev": true + }, + "acorn-jsx": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", + "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", + "dev": true + }, + "ajv": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", + "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -20,16 +100,59 @@ "concat-map": "0.0.1" } }, - "cli": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz", - "integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=", + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { - "exit": "0.1.2", - "glob": "^7.1.1" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" } }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, "commander": { "version": "2.19.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", @@ -42,80 +165,238 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "console-browserify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", - "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "requires": { - "date-now": "^0.1.4" + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" } }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, - "date-now": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", - "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, - "dom-serializer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", - "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==", + "eslint": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", + "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", "dev": true, "requires": { - "domelementtype": "^1.3.0", - "entities": "^1.1.1" + "@babel/code-frame": "^7.0.0", + "ajv": "^6.9.1", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^4.0.3", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^5.0.1", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^6.2.2", + "js-yaml": "^3.13.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.11", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0" }, "dependencies": { - "entities": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", - "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true } } }, - "domelementtype": { + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", - "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", + "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", "dev": true }, - "domhandler": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", - "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espree": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", + "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", "dev": true, "requires": { - "domelementtype": "1" + "acorn": "^6.0.7", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" } }, - "domutils": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", - "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", "dev": true, "requires": { - "dom-serializer": "0", - "domelementtype": "1" + "estraverse": "^4.0.0" } }, - "entities": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", - "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "external-editor": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", + "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, - "exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + } + }, + "flatted": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.0.tgz", + "integrity": "sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg==", "dev": true }, "fs.realpath": { @@ -124,6 +405,12 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, "glob": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", @@ -138,19 +425,49 @@ "path-is-absolute": "^1.0.0" } }, - "htmlparser2": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", - "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "requires": { - "domelementtype": "1", - "domhandler": "2.3", - "domutils": "1.5", - "entities": "1.0", - "readable-stream": "1.1" + "safer-buffer": ">= 2.1.2 < 3" } }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.0.0.tgz", + "integrity": "sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -167,26 +484,98 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "inquirer": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.3.1.tgz", + "integrity": "sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA==", + "dev": true, + "requires": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.11", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, - "jshint": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.10.2.tgz", - "integrity": "sha512-e7KZgCSXMJxznE/4WULzybCMNXNAd/bf5TSrvVEq78Q/K8ZwFpmBqQeDtNiHc3l49nV4E/+YeHU/JZjSUIrLAA==", + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "requires": { - "cli": "~1.0.0", - "console-browserify": "1.1.x", - "exit": "0.1.x", - "htmlparser2": "3.8.x", - "lodash": "~4.17.11", - "minimatch": "~3.0.2", - "shelljs": "0.3.x", - "strip-json-comments": "1.0.x" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" } }, "lodash": { @@ -195,6 +584,12 @@ "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", "dev": true }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -204,6 +599,45 @@ "brace-expansion": "^1.1.7" } }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -213,48 +647,289 @@ "wrappy": "1" } }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", "dev": true, "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" } }, - "shelljs": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", - "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=", + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "rxjs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz", + "integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "strip-json-comments": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", - "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=", + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "table": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.0.tgz", + "integrity": "sha512-nHFDrxmbrkU7JAFKqKbDJXfzrX2UBsWmrieXFTGxiI5e4ncg3VqsZeI4EzNmX0ncp4XNGVeoxIWJXfCIXwrsvw==", + "dev": true, + "requires": { + "ajv": "^6.9.1", + "lodash": "^4.17.11", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, "uglify-js": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.3.tgz", @@ -265,11 +940,44 @@ "source-map": "~0.6.1" } }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true + }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } } } } diff --git a/package.json b/package.json index ec026b6..4add996 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ ], "dependencies": {}, "devDependencies": { - "jshint": "^2.10.2", + "eslint": "^5.16.0", "uglify-js": "^3.5.3" }, "scripts": { diff --git a/tasks/.eslintrc.json b/tasks/.eslintrc.json new file mode 100644 index 0000000..180e433 --- /dev/null +++ b/tasks/.eslintrc.json @@ -0,0 +1,26 @@ +{ + "extends": "../.eslintrc.json", + "env": { + "browser": false + }, + "parserOptions": { + "ecmaVersion": 2018 + }, + "globals": { + "console": "readonly" + }, + "rules": { + "callback-return": "error", + "global-require": "error", + "handle-callback-err": "error", + "id-length": [ "error", { + "min": 2, + "max": 30 + }], + "max-params": [ "error", { + "max": 4 + }], + "no-console": "off", + "no-var": "error" + } +} diff --git a/tasks/.jshintrc b/tasks/.jshintrc deleted file mode 100644 index 55b1ce2..0000000 --- a/tasks/.jshintrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "esversion": 6, - "node": true, - "unused": true, - "undef": true -} diff --git a/tasks/bundle.js b/tasks/bundle.js index 70d846c..75f697a 100644 --- a/tasks/bundle.js +++ b/tasks/bundle.js @@ -4,12 +4,12 @@ const execSync = require('child_process').execSync; // get file paths from index.js const indexPath = 'js/index.js'; let indexSrc = fs.readFileSync( `./${indexPath}`, 'utf8' ); -let cjsBlockRegex = /module\.exports = factory\([\w ,'\.\-\(\)\/\n]+;/i; +let cjsBlockRegex = /module\.exports = factory\([\w ,'.\-()/\n]+;/i; let cjsBlockMatch = indexSrc.match( cjsBlockRegex ); -let paths = cjsBlockMatch[0].match( /require\('([\.\-\/\w]+)'\)/gi ); +let paths = cjsBlockMatch[0].match( /require\('([.\-/\w]+)'\)/gi ); paths = paths.map( function( path ) { - return path.replace( `require('.`, 'js' ).replace( `')`, '.js' ); + return path.replace( "require('.", 'js' ).replace( "')", '.js' ); }); paths.push( indexPath );