From 6fe03207cce0980e654262456ee653ff3e6b8d76 Mon Sep 17 00:00:00 2001 From: 43081j <43081j@users.noreply.github.com> Date: Tue, 28 Aug 2018 18:35:01 +0100 Subject: [PATCH] cli: update changelog --- packages/cli/CHANGELOG.md | 5 +++-- packages/cli/src/commands/lint.ts | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index f06254007..8bd58ed45 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,7 +1,8 @@ # Changelog - - +## Unreleased +* Fix an issue where we were passing lint rule help text through chalk + with unescaped chalk-specific syntax, causing chalk parsing errors. ## v1.8.0 [08-15-2018] * Fix a case where the CustomElementsEs5Adapter script was not added to the diff --git a/packages/cli/src/commands/lint.ts b/packages/cli/src/commands/lint.ts index 720817f65..efeb39a78 100644 --- a/packages/cli/src/commands/lint.ts +++ b/packages/cli/src/commands/lint.ts @@ -130,6 +130,10 @@ export class LintCommand implements Command { }, { header: 'Lint Rules', + // Here we replace special characters with chalk's escape + // syntax (`\$&`) to avoid chalk trying to re-process our input. + // This is needed because chalk supports a form of `{var}` + // interpolation. content: rulesDocs.join('\n\n').replace(/[{}\\]/g, '\\$&'), raw: true }