diff --git a/.eslintrc.js b/.eslintrc.js index dbf99241..a62d5f81 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -138,7 +138,6 @@ module.exports = { "react/jsx-no-bind": "error", "react/jsx-no-comment-textnodes": "error", "react/jsx-no-duplicate-props": "error", - "react/jsx-no-literals": ["warn"], "react/jsx-no-target-blank": "error", "react/jsx-sort-props": ["error", { "callbacksLast": true, diff --git a/package.json b/package.json index dcdab956..ed87f392 100755 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "build:all": "npm run build && npm run build:clips", "build": "npm run build:prod", "build:clips": "cross-env NODE_ENV=production webpack --config webpack.clips.prod.js", + "build:clips:dev": "npm run clean && webpack --config webpack.clips.dev.js", "build:stats": "cross-env NODE_ENV=production webpack --config webpack.web.prod.js --json > stats.json", "build:prod": "cross-env NODE_ENV=production webpack --config webpack.web.prod.js", "build:dev": "npm run clean && webpack --config webpack.web.dev.js" @@ -70,7 +71,7 @@ "raven-js": "^3.24.2", "react": "^16.4.1", "safe-regex": "^2.0.2", - "sortablejs": "^1.10.0-rc2", + "sortablejs": "^1.10.0-rc1", "vue": "^2.6.10", "vue-clickaway": "^2.2.2", "vue-color": "^2.4.6", diff --git a/src/addons.js b/src/addons.js index d3ed869e..ede7fa11 100644 --- a/src/addons.js +++ b/src/addons.js @@ -10,9 +10,7 @@ import { createElement } from 'utilities/dom'; import { timeout, has } from 'utilities/object'; import { getBuster } from 'utilities/time'; -const fetchJSON = (url, options) => { - return fetch(url, options).then(r => r.ok ? r.json() : null).catch(() => null); -} +const fetchJSON = (url, options) => fetch(url, options).then(r => r.ok ? r.json() : null).catch(() => null); // ============================================================================ // AddonManager diff --git a/src/i18n.js b/src/i18n.js index 888bcfb2..8ed3b543 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -14,20 +14,18 @@ import NewTransCore from 'utilities/translation-core'; const FACES = ['(・`ω´・)', ';;w;;', 'owo', 'ono', 'oAo', 'oxo', 'ovo;', 'UwU', '>w<', '^w^', '> w >', 'v.v'], - transformText = (ast, fn) => { - return ast.map(node => { - if ( typeof node === 'string' ) - return fn(node); + transformText = (ast, fn) => ast.map(node => { + if ( typeof node === 'string' ) + return fn(node); - else if ( typeof node === 'object' && node.o ) { - const out = Object.assign(node, {o: {}}); - for(const key of Object.keys(node.o)) - out.o[key] = transformText(node.o[key], fn) - } + else if ( typeof node === 'object' && node.o ) { + const out = Object.assign(node, {o: {}}); + for(const key of Object.keys(node.o)) + out.o[key] = transformText(node.o[key], fn) + } - return node; - }) - }, + return node; + }), owo = text => text .replace(/(?:r|l)/g, 'w') diff --git a/src/main.js b/src/main.js index 5c5045f2..23be8f02 100644 --- a/src/main.js +++ b/src/main.js @@ -115,11 +115,9 @@ class FrankerFaceZ extends Module { out.unshift(['initialization', logs.join('\n')]); } - return out.map(x => { - return `${x[0]} + return out.map(x => `${x[0]} ------------------------------------------------------------------------------- -${typeof x[1] === 'string' ? x[1] : JSON.stringify(x[1], null, 4)}` - }).join('\n\n'); +${typeof x[1] === 'string' ? x[1] : JSON.stringify(x[1], null, 4)}`).join('\n\n'); } diff --git a/src/modules/chat/actions/index.jsx b/src/modules/chat/actions/index.jsx index bef558bb..f47a6d02 100644 --- a/src/modules/chat/actions/index.jsx +++ b/src/modules/chat/actions/index.jsx @@ -255,8 +255,8 @@ export default class Actions extends Module { reason_elements.push(
  • {text} @@ -272,8 +272,8 @@ export default class Actions extends Module { reason_elements.push(
  • {rule} diff --git a/src/modules/chat/index.js b/src/modules/chat/index.js index e799658c..4077832b 100644 --- a/src/modules/chat/index.js +++ b/src/modules/chat/index.js @@ -1188,6 +1188,8 @@ export default class Chat extends Module { idx += split_chars(ret).length; out.push(ret); } + + first = false; } if ( ! emotes_only ) diff --git a/src/modules/chat/tokenizers.jsx b/src/modules/chat/tokenizers.jsx index 7be519ac..e04fd975 100644 --- a/src/modules/chat/tokenizers.jsx +++ b/src/modules/chat/tokenizers.jsx @@ -1006,8 +1006,9 @@ export const AddonEmotes = { modifiers = ds.modifierInfo; let name, preview, source, owner, mods, fav_source, emote_id, - plain_name = false, - hide_source = ds.noSource === 'true'; + plain_name = false; + + const hide_source = ds.noSource === 'true'; if ( modifiers && modifiers !== 'null' ) { mods = JSON.parse(modifiers).map(([set_id, emote_id]) => { diff --git a/src/modules/logviewer/index.js b/src/modules/logviewer/index.js index 057a777c..27afef41 100644 --- a/src/modules/logviewer/index.js +++ b/src/modules/logviewer/index.js @@ -27,6 +27,8 @@ export default class Logviewer extends Module { const token = this._token; if ( token && token.token && token.expires > ((Date.now() / 1000) + 300) ) return token.token; + + return null; } diff --git a/src/modules/main_menu/components/action-editor.vue b/src/modules/main_menu/components/action-editor.vue index d9e21a4b..187a27b3 100644 --- a/src/modules/main_menu/components/action-editor.vue +++ b/src/modules/main_menu/components/action-editor.vue @@ -7,7 +7,9 @@
    @@ -406,7 +421,7 @@ export default { const def = this.display && this.data.actions[this.display.action]; if ( ! def || ! def.description ) - return; + return null; const data = this.getData(), out = maybe_call(def.description, this, data, def), @@ -414,6 +429,8 @@ export default { if ( out ) return this.t(i18n, out, data); + + return null; }, visibility() { diff --git a/src/modules/main_menu/components/action-preview.vue b/src/modules/main_menu/components/action-preview.vue index 5752e61a..17e945dc 100644 --- a/src/modules/main_menu/components/action-preview.vue +++ b/src/modules/main_menu/components/action-preview.vue @@ -8,8 +8,8 @@ class="ffz-mod-icon mod-icon tw-c-text-alt-2 tw-font-size-4" > diff --git a/src/modules/main_menu/components/addon-list.vue b/src/modules/main_menu/components/addon-list.vue index 5d4472d9..c722ba3a 100644 --- a/src/modules/main_menu/components/addon-list.vue +++ b/src/modules/main_menu/components/addon-list.vue @@ -23,10 +23,9 @@
    this.shouldShow(addon)); + }, + sorted_addons() { const addons = this.item.getAddons(); diff --git a/src/modules/main_menu/components/badge-highlighting.vue b/src/modules/main_menu/components/badge-highlighting.vue index 557cb070..ae7d687e 100644 --- a/src/modules/main_menu/components/badge-highlighting.vue +++ b/src/modules/main_menu/components/badge-highlighting.vue @@ -13,8 +13,7 @@