From cf910de0f665e2c3454426c678e92e607115e409 Mon Sep 17 00:00:00 2001 From: pyoor Date: Mon, 21 May 2018 11:34:53 -0400 Subject: [PATCH] Minor linter fixes --- lib/logging/index.js | 2 +- lib/make/text.js | 6 +++--- lib/make/webgl.js | 14 +++++++++----- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/logging/index.js b/lib/logging/index.js index cda8e0e..41a6897 100644 --- a/lib/logging/index.js +++ b/lib/logging/index.js @@ -25,7 +25,7 @@ class logger { } if (typeof window === 'undefined') { try { - print(msg) // eslint-disable-line no-undef + print(msg) // eslint-disable-line no-undef } catch (e) { console.log(msg) } diff --git a/lib/make/text.js b/lib/make/text.js index e1ee21b..2d4bbcc 100644 --- a/lib/make/text.js +++ b/lib/make/text.js @@ -51,8 +51,8 @@ class text extends make { static layoutCharCodes () { return random.pick([ - 0, // null - 160, // non-breaking space + 0, // null + 160, // non-breaking space 0x005C, // backslash, but in some countries, represents local currency symbol (e.g. yen) 0x00AD, // soft hyphen 0x0BCC, // a Tamil character that is displayed as three glyphs @@ -114,7 +114,7 @@ class text extends make { 0x205F, // mathematical space 0x2061, // mathematical function application 0x2064, // mathematical invisible separator - 0x2044 // fraction slash character + 0x2044 // fraction slash character ]) } diff --git a/lib/make/webgl.js b/lib/make/webgl.js index 3a54814..79b11ea 100644 --- a/lib/make/webgl.js +++ b/lib/make/webgl.js @@ -59,16 +59,20 @@ class webgl extends make { static match (shader, regex, group = 1) { let matches = [] - let match - while (match = regex.exec(shader)) { + while (true) { + let match = regex.exec(shader) + if (match) { matches.push(match[group]) + } else { + break + } } return matches } static parseUniforms (shader, group = 1) { /* Todo: Parse their individual data types into categories. */ - return webgl.match(shader, /uniform .+? (\w+)(?=[\[;])/gm, group) + return webgl.match(shader, /uniform .+? (\w+)(?=[\[;])/gm, group) /* eslint-disable-line no-useless-escape */ } static parseAttributes (shader, group = 1) { @@ -86,13 +90,13 @@ class webgl extends make { static parseFragDatav3 (shader, group = 1) { // #version 300 - return webgl.match(shader, /out .+? (\w+)(?=[\[;])/gm, group) + return webgl.match(shader, /out .+? (\w+)(?=[\[;])/gm, group) /* eslint-disable-line no-useless-escape */ } static parseFrag (shader, group = 1) { let matches = webgl.parseFragDatav2(shader) if (matches.length) { - return matches + return matches } return webgl.parseFragDatav3(shader) }