From 52823001a59ea2270c186cb41c36b0e3e0a6da37 Mon Sep 17 00:00:00 2001 From: Josh Junon Date: Wed, 14 Feb 2018 18:28:22 -0800 Subject: [PATCH] Revert "Fix linting" This reverts commit 12d1276b36cc026ecea1bdfe1771198b242f7b1d. --- templates.js | 1 - test/template-literal.js | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/templates.js b/templates.js index b2a33a4..dbdf9b2 100644 --- a/templates.js +++ b/templates.js @@ -1,4 +1,3 @@ -/* eslint-disable unicorn/no-unsafe-regex */ 'use strict'; const TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; diff --git a/test/template-literal.js b/test/template-literal.js index 117b596..bfa346c 100644 --- a/test/template-literal.js +++ b/test/template-literal.js @@ -126,14 +126,14 @@ test('correctly parse escape in parameters (bug #177 comment 318622809)', t => { test('correctly parses unicode/hex escapes', t => { const ctx = m.constructor({level: 0}); - t.is(ctx`\u0078ylophones are fo\u0078y! {magenta.inverse \u0078ylophones are fo\u0078y!}`, + t.is(ctx`\u0078ylophones are fo\x78y! {magenta.inverse \u0078ylophones are fo\x78y!}`, 'xylophones are foxy! xylophones are foxy!'); }); test('correctly parses string arguments', t => { const ctx = m.constructor({level: 3}); t.is(ctx`{keyword('black').bold can haz cheezburger}`, '\u001B[38;2;0;0;0m\u001B[1mcan haz cheezburger\u001B[22m\u001B[39m'); - t.is(ctx`{keyword('blac\u006B').bold can haz cheezburger}`, '\u001B[38;2;0;0;0m\u001B[1mcan haz cheezburger\u001B[22m\u001B[39m'); + t.is(ctx`{keyword('blac\x6B').bold can haz cheezburger}`, '\u001B[38;2;0;0;0m\u001B[1mcan haz cheezburger\u001B[22m\u001B[39m'); t.is(ctx`{keyword('blac\u006B').bold can haz cheezburger}`, '\u001B[38;2;0;0;0m\u001B[1mcan haz cheezburger\u001B[22m\u001B[39m'); }); @@ -159,7 +159,7 @@ test('throws if an extra unescaped } is found', t => { test('should not parse upper-case escapes', t => { const ctx = m.constructor({level: 0}); - t.is(ctx`\N\n\T\t\X07\u0007\U000A\u000A\U000a\u000a`, 'N\nT\tX07\u0007U000A\u000AU000a\u000A'); + t.is(ctx`\N\n\T\t\X07\x07\U000A\u000A\U000a\u000a`, 'N\nT\tX07\x07U000A\u000AU000a\u000A'); }); test('should properly handle undefined template interpolated values', t => {