diff --git a/.eslintrc b/.eslintrc index 19745e120..fd436e3b9 100644 --- a/.eslintrc +++ b/.eslintrc @@ -8,7 +8,7 @@ env: parserOptions: parser: babel-eslint sourceType: module - ecmaVersion: 6 + ecmaVersion: 2017 ecmaFeatures: experimentalObjectRestSpread: true @@ -44,10 +44,3 @@ rules: require-path-exists/notEmpty: 2 semi: [2, always] space-before-function-paren: [2, always] - - no-restricted-syntax: - - error - - default-params - - generators - - rest-params - - spread diff --git a/src/.eslintrc b/src/.eslintrc index c91f75d1f..b05e87b27 100644 --- a/src/.eslintrc +++ b/src/.eslintrc @@ -4,10 +4,15 @@ env: browser: true node: false -parserOptions: - ecmaFeatures: - experimentalObjectRestSpread: false - rules: no-console: 2 strict: [2, never] + + no-restricted-syntax: + - error + - selector: :matches(ArrowFunctionExpression,FunctionExpression,FunctionDeclaration) > AssignmentPattern + message: Using default parameters is not allowed. + - Generator + - RestElement + - ExperimentalRestProperty + - ExperimentalSpreadProperty diff --git a/src/Interaction.js b/src/Interaction.js index 99da9a37e..d12851135 100644 --- a/src/Interaction.js +++ b/src/Interaction.js @@ -304,7 +304,7 @@ class Interaction { return this.pointers[this.getPointerIndex(pointer)]; } - updatePointer (pointer, event, eventTarget, down = event && /(down|start)$/i.test(event.type)) { + updatePointer (pointer, event, eventTarget, down) { const id = utils.pointer.getPointerId(pointer); let pointerIndex = this.getPointerIndex(pointer); let pointerInfo = this.pointers[pointerIndex]; diff --git a/tests/pointerEvents/base.js b/tests/pointerEvents/base.js index e5b01ebe0..891cef669 100644 --- a/tests/pointerEvents/base.js +++ b/tests/pointerEvents/base.js @@ -125,12 +125,12 @@ test('pointerEvents Interaction update-pointer-down signal', t => { const interaction = scope.interactions.new({}); const initialTimer = { duration: Infinity, timeout: null }; - const event = { type: 'down' }; + const event = {}; - interaction.updatePointer(helpers.newPointer(0), event); + interaction.updatePointer(helpers.newPointer(0), event, null, true); t.deepEqual(interaction.holdTimers, [initialTimer]); - interaction.updatePointer(helpers.newPointer(5), event); + interaction.updatePointer(helpers.newPointer(5), event, null, true); t.deepEqual(interaction.holdTimers, [initialTimer, initialTimer]); t.end();