From b03014fc2c83b8acd982d407137617e3df36c92c Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Tue, 27 Feb 2018 10:08:31 +0100 Subject: [PATCH] chore(project): update to new lint style --- lib/draw/BpmnRenderer.js | 2 +- lib/draw/PathMap.js | 8 +- .../context-pad/ContextPadProvider.js | 4 +- lib/features/modeling/BpmnUpdater.js | 6 +- .../modeling/behavior/LabelBehavior.js | 8 +- .../behavior/ReplaceElementBehaviour.js | 2 +- .../modeling/behavior/util/GeometricUtil.js | 6 +- .../modeling/behavior/util/LabelLayoutUtil.js | 2 +- lib/features/palette/PaletteProvider.js | 2 +- .../popup-menu/ReplaceMenuProvider.js | 2 +- lib/features/snapping/BpmnSnappingUtil.js | 4 +- lib/import/BpmnTreeWalker.js | 2 +- lib/util/LabelUtil.js | 4 +- package-lock.json | 188 +++++++++++++++++- package.json | 2 +- test/config/translation-reporter.js | 6 +- test/integration/ReimportSpec.js | 2 +- .../custom-elements/CustomRenderer.js | 2 +- test/spec/features/modeling/DropSpec.js | 4 +- .../features/modeling/UpdatePropertiesSpec.js | 8 +- .../modeling/append/TextAnnotationSpec.js | 6 +- .../ToggleElementCollapseBehaviourSpec.js | 2 +- .../behavior/UnsetDefaultFlowBehaviorSpec.js | 2 +- .../behavior/util/GeometricUtilSpec.js | 6 +- .../popup-menu/ReplaceMenuProviderSpec.js | 4 +- test/spec/features/replace/BpmnReplaceSpec.js | 50 ++--- .../spec/features/replace/ReplaceRulesSpec.js | 6 +- test/spec/import/ImporterSpec.js | 6 +- 28 files changed, 264 insertions(+), 82 deletions(-) diff --git a/lib/draw/BpmnRenderer.js b/lib/draw/BpmnRenderer.js index 0ad85f3a..a1c288a0 100644 --- a/lib/draw/BpmnRenderer.js +++ b/lib/draw/BpmnRenderer.js @@ -123,7 +123,7 @@ function BpmnRenderer(eventBus, styles, pathMap, canvas, priority) { createMarker(type, fill, stroke); } - return 'url(#' + id + ')'; + return 'url(#' + id + ')'; } function createMarker(type, fill, stroke) { diff --git a/lib/draw/PathMap.js b/lib/draw/PathMap.js index 8fa1bb30..6681e8ca 100644 --- a/lib/draw/PathMap.js +++ b/lib/draw/PathMap.js @@ -416,7 +416,7 @@ function PathMap() { my = param.containerHeight * param.position.my; } - var coordinates = {}; //map for the scaled coordinates + var coordinates = {}; // map for the scaled coordinates if (param.position) { // path @@ -424,18 +424,18 @@ function PathMap() { var widthRatio = (param.containerWidth / rawPath.width) * param.xScaleFactor; - //Apply height ratio + // Apply height ratio for (var heightIndex = 0; heightIndex < rawPath.heightElements.length; heightIndex++) { coordinates['y' + heightIndex] = rawPath.heightElements[heightIndex] * heightRatio; } - //Apply width ratio + // Apply width ratio for (var widthIndex = 0; widthIndex < rawPath.widthElements.length; widthIndex++) { coordinates['x' + widthIndex] = rawPath.widthElements[widthIndex] * widthRatio; } } - //Apply value to raw path + // Apply value to raw path var path = format( rawPath.d, { mx: mx, diff --git a/lib/features/context-pad/ContextPadProvider.js b/lib/features/context-pad/ContextPadProvider.js index cba0bf3a..0055ac27 100644 --- a/lib/features/context-pad/ContextPadProvider.js +++ b/lib/features/context-pad/ContextPadProvider.js @@ -31,7 +31,7 @@ function ContextPadProvider( this._connect = connect; this._create = create; this._popupMenu = popupMenu; - this._canvas = canvas; + this._canvas = canvas; this._rules = rules; this._translate = translate; @@ -338,7 +338,7 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) { 'bpmn:InteractionNode', 'bpmn:DataObjectReference', 'bpmn:DataStoreReference' - ]) ) { + ])) { assign(actions, { 'append.text-annotation': appendAction('bpmn:TextAnnotation', 'bpmn-icon-text-annotation'), diff --git a/lib/features/modeling/BpmnUpdater.js b/lib/features/modeling/BpmnUpdater.js index b6cdb213..b1ff1a25 100644 --- a/lib/features/modeling/BpmnUpdater.js +++ b/lib/features/modeling/BpmnUpdater.js @@ -227,7 +227,7 @@ function BpmnUpdater(eventBus, bpmnFactory, connectionDocking, translate) { !(is(newTarget, 'bpmn:Activity') || is(newTarget, 'bpmn:EndEvent') || is(newTarget, 'bpmn:Gateway') || - is(newTarget, 'bpmn:IntermediateThrowEvent')) ) { + is(newTarget, 'bpmn:IntermediateThrowEvent'))) { context.default = businessObject.sourceRef.default; businessObject.sourceRef.default = undefined; } @@ -235,7 +235,7 @@ function BpmnUpdater(eventBus, bpmnFactory, connectionDocking, translate) { // on reconnectStart -> conditional flow if (oldSource && (businessObject.conditionExpression) && !(is(newSource, 'bpmn:Activity') || - is(newSource, 'bpmn:Gateway')) ) { + is(newSource, 'bpmn:Gateway'))) { context.conditionExpression = businessObject.conditionExpression; businessObject.conditionExpression = undefined; } @@ -245,7 +245,7 @@ function BpmnUpdater(eventBus, bpmnFactory, connectionDocking, translate) { !(is(newTarget, 'bpmn:Activity') || is(newTarget, 'bpmn:EndEvent') || is(newTarget, 'bpmn:Gateway') || - is(newTarget, 'bpmn:IntermediateThrowEvent')) ) { + is(newTarget, 'bpmn:IntermediateThrowEvent'))) { context.conditionExpression = businessObject.conditionExpression; businessObject.conditionExpression = undefined; } diff --git a/lib/features/modeling/behavior/LabelBehavior.js b/lib/features/modeling/behavior/LabelBehavior.js index fbd1d9ba..42c57c21 100644 --- a/lib/features/modeling/behavior/LabelBehavior.js +++ b/lib/features/modeling/behavior/LabelBehavior.js @@ -39,7 +39,7 @@ function LabelSupport(eventBus, modeling, bpmnFactory) { var textUtil = new TextUtil(); - ///// create external labels on shape creation + // create external labels on shape creation this.postExecute([ 'shape.create', 'connection.create' ], function(e) { var context = e.context; @@ -70,7 +70,7 @@ function LabelSupport(eventBus, modeling, bpmnFactory) { }); - ///// update di information on label creation + // update di information on label creation this.executed([ 'label.create' ], function(event) { @@ -107,7 +107,7 @@ function LabelSupport(eventBus, modeling, bpmnFactory) { }); - ///// update label position on connection change + // update label position on connection change function getHiddenLabelAdjustment(event) { @@ -169,7 +169,7 @@ function LabelSupport(eventBus, modeling, bpmnFactory) { }); - ////// keep label position on shape replace + // keep label position on shape replace this.postExecute([ 'shape.replace' ], function(event) { var context = event.context, diff --git a/lib/features/modeling/behavior/ReplaceElementBehaviour.js b/lib/features/modeling/behavior/ReplaceElementBehaviour.js index e134d4af..98b9c50c 100644 --- a/lib/features/modeling/behavior/ReplaceElementBehaviour.js +++ b/lib/features/modeling/behavior/ReplaceElementBehaviour.js @@ -65,7 +65,7 @@ function ReplaceElementBehaviour(eventBus, bpmnReplace, bpmnRules, elementRegist }, this); - this.postExecuted( [ 'shape.replace' ], 1500, function(e) { + this.postExecuted([ 'shape.replace' ], 1500, function(e) { var context = e.context, oldShape = context.oldShape, newShape = context.newShape; diff --git a/lib/features/modeling/behavior/util/GeometricUtil.js b/lib/features/modeling/behavior/util/GeometricUtil.js index 1c61e171..f281c1e9 100644 --- a/lib/features/modeling/behavior/util/GeometricUtil.js +++ b/lib/features/modeling/behavior/util/GeometricUtil.js @@ -7,7 +7,7 @@ * @return {Float} */ function vectorLength(v) { - return Math.sqrt( Math.pow(v.x, 2) + Math.pow(v.y, 2) ); + return Math.sqrt(Math.pow(v.x, 2) + Math.pow(v.y, 2)); } module.exports.vectorLength = vectorLength; @@ -21,7 +21,7 @@ module.exports.vectorLength = vectorLength; function getAngle(line) { // return value is between 0, 180 and -180, -0 // @janstuemmel: maybe replace return a/b with b/a - return Math.atan( (line[1].y - line[0].y) / (line[1].x - line[0].x) ); + return Math.atan((line[1].y - line[0].y) / (line[1].x - line[0].x)); } module.exports.getAngle = getAngle; @@ -81,7 +81,7 @@ function perpendicularFoot(point, line) { var bd = { x: b.x - a.x, y: b.y - a.y }; // solve equation system to the parametrized vectors param real value - var r = solveLambaSystem( [ a.x, a.y ], [ bd.x, bd.y ], [ point.x, point.y ] ); + var r = solveLambaSystem([ a.x, a.y ], [ bd.x, bd.y ], [ point.x, point.y ]); return { x: a.x + r*bd.x, y: a.y + r*bd.y }; diff --git a/lib/features/modeling/behavior/util/LabelLayoutUtil.js b/lib/features/modeling/behavior/util/LabelLayoutUtil.js index fee3f117..98a61a22 100644 --- a/lib/features/modeling/behavior/util/LabelLayoutUtil.js +++ b/lib/features/modeling/behavior/util/LabelLayoutUtil.js @@ -191,7 +191,7 @@ function relativePositionMidWaypoint(waypoints, idx) { var distanceSegment1 = getDistancePointPoint(waypoints[idx-1], waypoints[idx]), distanceSegment2 = getDistancePointPoint(waypoints[idx], waypoints[idx+1]); - var relativePosition = distanceSegment1 / ( distanceSegment1 + distanceSegment2 ); + var relativePosition = distanceSegment1 / (distanceSegment1 + distanceSegment2); return relativePosition; } diff --git a/lib/features/palette/PaletteProvider.js b/lib/features/palette/PaletteProvider.js index 3a1bb257..fe2e86b3 100644 --- a/lib/features/palette/PaletteProvider.js +++ b/lib/features/palette/PaletteProvider.js @@ -38,7 +38,7 @@ PaletteProvider.$inject = [ PaletteProvider.prototype.getPaletteEntries = function(element) { - var actions = {}, + var actions = {}, create = this._create, elementFactory = this._elementFactory, spaceTool = this._spaceTool, diff --git a/lib/features/popup-menu/ReplaceMenuProvider.js b/lib/features/popup-menu/ReplaceMenuProvider.js index 601c9404..8b3ed599 100644 --- a/lib/features/popup-menu/ReplaceMenuProvider.js +++ b/lib/features/popup-menu/ReplaceMenuProvider.js @@ -197,7 +197,7 @@ ReplaceMenuProvider.prototype.getEntries = function(element) { var isTargetExpanded = target.isExpanded === true; - return isDifferentType(element, target) && ( !isTargetSubProcess || isTargetExpanded ); + return isDifferentType(element, target) && (!isTargetSubProcess || isTargetExpanded); }); return this._createEntries(element, entries); diff --git a/lib/features/snapping/BpmnSnappingUtil.js b/lib/features/snapping/BpmnSnappingUtil.js index ec3a94b2..25357fd2 100644 --- a/lib/features/snapping/BpmnSnappingUtil.js +++ b/lib/features/snapping/BpmnSnappingUtil.js @@ -66,7 +66,7 @@ function getParticipantSizeConstraints(laneShape, resizeDirection, balanced) { var isFirst = true, isLast = true; - ///// max top/bottom size for lanes + // max top/bottom size for lanes var allLanes = collectLanes(lanesRoot, [ lanesRoot ]); @@ -122,7 +122,7 @@ function getParticipantSizeConstraints(laneShape, resizeDirection, balanced) { }); - ///// max top/bottom/left/right size based on flow nodes + // max top/bottom/left/right size based on flow nodes var flowElements = lanesRoot.children.filter(function(s) { return !s.hidden && !s.waypoints && (is(s, 'bpmn:FlowElement') || is(s, 'bpmn:Artifact')); diff --git a/lib/import/BpmnTreeWalker.js b/lib/import/BpmnTreeWalker.js index 154796bf..25e21bcd 100644 --- a/lib/import/BpmnTreeWalker.js +++ b/lib/import/BpmnTreeWalker.js @@ -109,7 +109,7 @@ function BpmnTreeWalker(handler, translate) { translate('multiple DI elements defined for {element}', { element: elementToString(bpmnElement) }), - { element: bpmnElement } + { element: bpmnElement } ); } else { diRefs.bind(bpmnElement, 'di'); diff --git a/lib/util/LabelUtil.js b/lib/util/LabelUtil.js index a7a1ade3..bbe55d5c 100644 --- a/lib/util/LabelUtil.js +++ b/lib/util/LabelUtil.js @@ -45,12 +45,12 @@ function getFlowLabelPosition(waypoints) { var position = getWaypointsMid(waypoints); // calculate angle - var angle = Math.atan( (second.y - first.y) / (second.x - first.x) ); + var angle = Math.atan((second.y - first.y) / (second.x - first.x)); var x = position.x, y = position.y; - if ( Math.abs(angle) < Math.PI / 2 ) { + if (Math.abs(angle) < Math.PI / 2) { y -= FLOW_LABEL_INDENT; } else { x += FLOW_LABEL_INDENT; diff --git a/package-lock.json b/package-lock.json index d589503a..f65afbfa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,140 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.40.tgz", + "integrity": "sha512-eVXQSbu/RimU6OKcK2/gDJVTFcxXJI4sHbIqw2mhwMZeQ2as/8AhS9DGkEDoHMBBNJZ5B0US63lF56x+KDcxiA==", + "dev": true, + "requires": { + "@babel/highlight": "7.0.0-beta.40" + } + }, + "@babel/generator": { + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.40.tgz", + "integrity": "sha512-c91BQcXyTq/5aFV4afgOionxZS1dxWt8OghEx5Q52SKssdGRFSiMKnk9tGkev1pYULPJBqjSDZU2Pcuc58ffZw==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.40", + "jsesc": "2.5.1", + "lodash": "4.17.5", + "source-map": "0.5.7", + "trim-right": "1.0.1" + }, + "dependencies": { + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + } + } + }, + "@babel/helper-function-name": { + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.40.tgz", + "integrity": "sha512-cK9BVLtOfisSISTTHXKGvBc2OBh65tjEk4PgXhsSnnH0i8RP2v+5RCxoSlh2y/i+l2fxQqKqv++Qo5RMiwmRCA==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "7.0.0-beta.40", + "@babel/template": "7.0.0-beta.40", + "@babel/types": "7.0.0-beta.40" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.40.tgz", + "integrity": "sha512-MwquaPznI4cUoZEgHC/XGkddOXtqKqD4DvZDOyJK2LR9Qi6TbMbAhc6IaFoRX7CRTFCmtGeu8gdXW2dBotBBTA==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.40" + } + }, + "@babel/highlight": { + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.40.tgz", + "integrity": "sha512-mOhhTrzieV6VO7odgzFGFapiwRK0ei8RZRhfzHhb6cpX3QM8XXuCLXWjN8qBB7JReDdUR80V3LFfFrGUYevhNg==", + "dev": true, + "requires": { + "chalk": "2.3.0", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + } + }, + "@babel/template": { + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.40.tgz", + "integrity": "sha512-RlQiVB7eL7fxsKN6JvnCCwEwEL28CBYalXSgWWULuFlEHjtMoXBqQanSie3bNyhrANJx67sb+Sd/vuGivoMwLQ==", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-beta.40", + "@babel/types": "7.0.0-beta.40", + "babylon": "7.0.0-beta.40", + "lodash": "4.17.5" + }, + "dependencies": { + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + } + } + }, + "@babel/traverse": { + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.40.tgz", + "integrity": "sha512-h96SQorjvdSuxQ6hHFIuAa3oxnad1TA5bU1Zz88+XqzwmM5QM0/k2D+heXGGy/76gT5ajl7xYLKGiPA/KTyVhQ==", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-beta.40", + "@babel/generator": "7.0.0-beta.40", + "@babel/helper-function-name": "7.0.0-beta.40", + "@babel/types": "7.0.0-beta.40", + "babylon": "7.0.0-beta.40", + "debug": "3.1.0", + "globals": "11.2.0", + "invariant": "2.2.3", + "lodash": "4.17.5" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.40.tgz", + "integrity": "sha512-uXCGCzTgMZxcSUzutCPtZmXbVC+cvENgS2e0tRuhn+Y1hZnMb8IHP0Trq7Q2MB/eFmG5pKrAeTIUfQIe5kA4Tg==", + "dev": true, + "requires": { + "esutils": "2.0.2", + "lodash": "4.17.5", + "to-fast-properties": "2.0.0" + }, + "dependencies": { + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + } + } + }, "@browserify/acorn5-object-spread": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/@browserify/acorn5-object-spread/-/acorn5-object-spread-5.0.1.tgz", @@ -346,6 +480,20 @@ } } }, + "babel-eslint": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.2.tgz", + "integrity": "sha512-Qt2lz2egBxNYWqN9JIO2z4NOOf8i4b5JS6CFoYrOZZTDssueiV1jH/jsefyg+86SeNY3rB361/mi3kE1WK2WYQ==", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-beta.40", + "@babel/traverse": "7.0.0-beta.40", + "@babel/types": "7.0.0-beta.40", + "babylon": "7.0.0-beta.40", + "eslint-scope": "3.7.1", + "eslint-visitor-keys": "1.0.0" + } + }, "babel-runtime": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", @@ -356,6 +504,12 @@ "regenerator-runtime": "0.11.1" } }, + "babylon": { + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.40.tgz", + "integrity": "sha512-AVxF2EcxvGD5hhOuLTOLAXBb0VhwWpEX0HyHdAI2zU+AAP4qEwtQj8voz1JR3uclGai0rfcE+dCTHnNMOnimFg==", + "dev": true + }, "backo2": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", @@ -2188,11 +2342,12 @@ } }, "eslint-plugin-bpmn-io": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-bpmn-io/-/eslint-plugin-bpmn-io-0.2.0.tgz", - "integrity": "sha512-Omj1TGM/3zeGrEzXG7d0E2uElXdW8kKRMJp4bNxJpwzRREZHbd4+TtuwbLN99K8HmvTeJ23ubOWEozIQYu1dBg==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-bpmn-io/-/eslint-plugin-bpmn-io-0.5.2.tgz", + "integrity": "sha512-8OaqH6ILElKd26Q1TMjyth7NSmGynBy4tVZxeJUofPcgAKg3eluJxWakRrLFag6yRIpiOujmx87GJsL7HF3Nuw==", "dev": true, "requires": { + "babel-eslint": "8.2.2", "eslint-plugin-mocha": "4.11.0", "eslint-plugin-react": "7.6.1" } @@ -3332,6 +3487,15 @@ } } }, + "invariant": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.3.tgz", + "integrity": "sha512-7Z5PPegwDTyjbaeCnV0efcyS6vdKAU51kpEmS7QFib3P4822l8ICYyMn7qvJnc+WzLoDsuI9gPMKbJ8pCu8XtA==", + "dev": true, + "requires": { + "loose-envify": "1.3.1" + } + }, "invert-kv": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", @@ -3593,6 +3757,12 @@ "dev": true, "optional": true }, + "jsesc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.1.tgz", + "integrity": "sha1-5CGiqOINawgZ3yiQj3glJrlt0f4=", + "dev": true + }, "json-parse-better-errors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.1.tgz", @@ -6089,6 +6259,12 @@ "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", "dev": true }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, "tough-cookie": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", @@ -6122,6 +6298,12 @@ } } }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, "tty-browserify": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", diff --git a/package.json b/package.json index 6b2a6dac..dc845e29 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "del": "^3.0.0", "envify": "^4.1.0", "eslint": "^4.14.0", - "eslint-plugin-bpmn-io": "^0.2.0", + "eslint-plugin-bpmn-io": "^0.5.2", "execa": "^0.8.0", "jsondiffpatch": "^0.1.26", "karma": "^1.7.0", diff --git a/test/config/translation-reporter.js b/test/config/translation-reporter.js index afdd2039..8da17e35 100644 --- a/test/config/translation-reporter.js +++ b/test/config/translation-reporter.js @@ -16,12 +16,12 @@ function TranslationReporter() { this.onBrowserLog = function(browser, log, type) { - if ( log === undefined || typeof log !== 'string' ) { + if (log === undefined || typeof log !== 'string') { return; } - if ( log.substring( 0, 1 ) === '\'' ) { - log = log.substring( 1, log.length - 1 ); + if (log.substring(0, 1) === '\'') { + log = log.substring(1, log.length - 1); } try { diff --git a/test/integration/ReimportSpec.js b/test/integration/ReimportSpec.js index 7fee948b..cafbd831 100644 --- a/test/integration/ReimportSpec.js +++ b/test/integration/ReimportSpec.js @@ -49,7 +49,7 @@ describe.skip('scenario - successive reopening', function() { } if (event.warnings && event.warnings.length) { - console.warn('WARNINGS', event.warnings ); + console.warn('WARNINGS', event.warnings); } }); diff --git a/test/integration/custom-elements/CustomRenderer.js b/test/integration/custom-elements/CustomRenderer.js index c836a28e..c1d00d6f 100644 --- a/test/integration/custom-elements/CustomRenderer.js +++ b/test/integration/custom-elements/CustomRenderer.js @@ -26,7 +26,7 @@ function CustomRenderer(eventBus, styles) { return self.drawTriangle(parentGfx, element.width); }, 'custom:circle': function(parentGfx, element, attrs) { - return self.drawCircle(parentGfx, element.width, element.height, attrs); + return self.drawCircle(parentGfx, element.width, element.height, attrs); } }; diff --git a/test/spec/features/modeling/DropSpec.js b/test/spec/features/modeling/DropSpec.js index 4bea532d..25670b41 100644 --- a/test/spec/features/modeling/DropSpec.js +++ b/test/spec/features/modeling/DropSpec.js @@ -66,7 +66,7 @@ describe('features/move - drop', function() { // given var task_1 = elementRegistry.get('ID_Task_1'), parent = elementRegistry.get('ID_SubProcess_1'), - flow = elementRegistry.get('ID_Sequenceflow_1'); + flow = elementRegistry.get('ID_Sequenceflow_1'); // when modeling.moveElements([ task_1 ], { x: 0, y: 200 }, parent); @@ -85,7 +85,7 @@ describe('features/move - drop', function() { var task_1 = elementRegistry.get('ID_Task_1'), task_2 = elementRegistry.get('ID_Task_2'), parent = elementRegistry.get('ID_SubProcess_1'), - flow = elementRegistry.get('ID_Sequenceflow_1'); + flow = elementRegistry.get('ID_Sequenceflow_1'); // when modeling.moveElements([ task_1, task_2 ], { x: 0, y: 250 }, parent); diff --git a/test/spec/features/modeling/UpdatePropertiesSpec.js b/test/spec/features/modeling/UpdatePropertiesSpec.js index 20b1a49f..b0d8e83d 100644 --- a/test/spec/features/modeling/UpdatePropertiesSpec.js +++ b/test/spec/features/modeling/UpdatePropertiesSpec.js @@ -123,14 +123,14 @@ describe('features/modeling - update properties', function() { it('updating conditional flow on source replace', inject( function(bpmnReplace, elementRegistry) { - //given + // given var conditionalFlow = elementRegistry.get('SequenceFlow_3'), conditionalBo = conditionalFlow.businessObject, serviceTask = elementRegistry.get('ServiceTask_1'); var conditionExpression = conditionalBo.conditionExpression; - var userTaskData = { + var userTaskData = { type: 'bpmn:UserTask' }; @@ -146,14 +146,14 @@ describe('features/modeling - update properties', function() { it('updating conditional flow on target replace', inject( function(bpmnReplace, elementRegistry) { - //given + // given var conditionalFlow = elementRegistry.get('SequenceFlow_3'), conditionalBo = conditionalFlow.businessObject, endEvent = elementRegistry.get('EndEvent_1'); var conditionExpression = conditionalBo.conditionExpression; - var messageEndEventData = { + var messageEndEventData = { type: 'bpmn:EndEvent', eventDefinitionType: 'bpmn:MessageEventDefinition' }; diff --git a/test/spec/features/modeling/append/TextAnnotationSpec.js b/test/spec/features/modeling/append/TextAnnotationSpec.js index 6741fc34..d922ca11 100644 --- a/test/spec/features/modeling/append/TextAnnotationSpec.js +++ b/test/spec/features/modeling/append/TextAnnotationSpec.js @@ -87,13 +87,13 @@ describe('features/modeling - append text-annotation', function() { it('with right size', inject(function(elementRegistry, elementFactory, modeling) { - //given + // given var eventShape = elementRegistry.get('IntermediateCatchEvent_1'); - //when + // when var annotationShape = modeling.appendShape(eventShape, { type: 'bpmn:TextAnnotation' }); - //then + // then expect(annotationShape.width).to.eql(100); expect(annotationShape.height).to.eql(30); })); diff --git a/test/spec/features/modeling/behavior/ToggleElementCollapseBehaviourSpec.js b/test/spec/features/modeling/behavior/ToggleElementCollapseBehaviourSpec.js index 206d98b5..5c4edd54 100644 --- a/test/spec/features/modeling/behavior/ToggleElementCollapseBehaviourSpec.js +++ b/test/spec/features/modeling/behavior/ToggleElementCollapseBehaviourSpec.js @@ -148,7 +148,7 @@ describe('features/modeling - collapse and expand elements', function() { ); // then - var newMid = { + var newMid = { x: expandedSubProcess.x + expandedSubProcess.width / 2, y: expandedSubProcess.y + expandedSubProcess.height / 2 }; diff --git a/test/spec/features/modeling/behavior/UnsetDefaultFlowBehaviorSpec.js b/test/spec/features/modeling/behavior/UnsetDefaultFlowBehaviorSpec.js index 81fe0310..69b1511c 100644 --- a/test/spec/features/modeling/behavior/UnsetDefaultFlowBehaviorSpec.js +++ b/test/spec/features/modeling/behavior/UnsetDefaultFlowBehaviorSpec.js @@ -31,7 +31,7 @@ describe('features/modeling - delete default connection', function() { // then expect(defaultConnection.parent).to.be.null; - expect(gateway.businessObject.default).to.be.null; //.property('default'); + expect(gateway.businessObject.default).to.be.null; // .property('default'); })); diff --git a/test/spec/features/modeling/behavior/util/GeometricUtilSpec.js b/test/spec/features/modeling/behavior/util/GeometricUtilSpec.js index 2ca14f7b..aba61f7a 100644 --- a/test/spec/features/modeling/behavior/util/GeometricUtilSpec.js +++ b/test/spec/features/modeling/behavior/util/GeometricUtilSpec.js @@ -84,9 +84,9 @@ describe('modeling/behavior/util - GeometricUtil', function() { var angle = GeometricUtil.getAngle(testLines[i].line); // to degree - angle = angle * ( 180 / Math.PI ); + angle = angle * (180 / Math.PI); - //then + // then expect(angle).to.be.equal(testLines[i].angle); } }); @@ -105,7 +105,7 @@ describe('modeling/behavior/util - GeometricUtil', function() { for (var i=0; i