From 1242ab494a7b69d0a74b0e32927c272f3405c496 Mon Sep 17 00:00:00 2001 From: Neil Kistner Date: Fri, 24 Feb 2017 02:31:07 -0600 Subject: [PATCH] fix: ensure colon is not null in typeColonSpacing reporter (#197) --- package.json | 2 +- src/rules/typeColonSpacing/reporter.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2490d072..2b5558f1 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "chai": "^3.5.0", "conventional-changelog-lint": "^1.0.1", "create-index": "^0.1.3", - "eslint": "^3.4.0", + "eslint": "^3.16.0", "eslint-config-canonical": "1.8.1", "gitdown": "^2.5.0", "husky": "^0.11.7", diff --git a/src/rules/typeColonSpacing/reporter.js b/src/rules/typeColonSpacing/reporter.js index bfa80bb6..19e78df0 100644 --- a/src/rules/typeColonSpacing/reporter.js +++ b/src/rules/typeColonSpacing/reporter.js @@ -17,7 +17,7 @@ export default (direction, context, {always, allowLineBreak}) => { // Support optional names // type X = { [string]: a } // type X = string => string - if (colon.value !== ':') { + if (!colon || colon.value !== ':') { return; }