From f4b4416ea52d564bc2dbe543a82084ed98843ccc Mon Sep 17 00:00:00 2001 From: Markus Hatvan Date: Fri, 30 Jul 2021 10:54:54 +0200 Subject: chore: migrate from tslint to @typescript-eslint (#1706) - update .eslintrc to work for .js and .ts - update devDependencies - lint properly both root /src and nested /packages - update webhint recommended setting for tsconfig.json to shrink output - Manage all eslint rules from the repo root - escape single quotes in scripts to please windows build Co-authored-by: Vijay A --- src/webview/contextMenuBuilder.js | 4 ++-- src/webview/lib/RecipeWebview.js | 2 +- src/webview/notifications.js | 2 +- src/webview/spellchecker.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/webview') diff --git a/src/webview/contextMenuBuilder.js b/src/webview/contextMenuBuilder.js index 63eed2ebe..2598dbf03 100644 --- a/src/webview/contextMenuBuilder.js +++ b/src/webview/contextMenuBuilder.js @@ -61,7 +61,7 @@ module.exports = class ContextMenuBuilder { * @param {function} processMenu If passed, this method will be passed the menu to change * it prior to display. Signature: (menu, info) => menu */ - constructor(webContents, debugMode = false, processMenu = m => m) { + constructor(webContents, debugMode = false, processMenu = (m) => m) { this.debugMode = debugMode; this.processMenu = processMenu; this.menu = null; @@ -320,7 +320,7 @@ module.exports = class ContextMenuBuilder { label: this.stringTable.copyImage(), click: () => { const result = this.convertImageToBase64(menuInfo.srcURL, - dataURL => clipboard.writeImage(nativeImage.createFromDataURL(dataURL))); + (dataURL) => clipboard.writeImage(nativeImage.createFromDataURL(dataURL))); this._sendNotificationOnClipboardEvent(menuInfo.clipboardNotifications, () => `Image copied from URL: ${menuInfo.srcURL}`); return result; diff --git a/src/webview/lib/RecipeWebview.js b/src/webview/lib/RecipeWebview.js index 3bb9352f6..305e79882 100644 --- a/src/webview/lib/RecipeWebview.js +++ b/src/webview/lib/RecipeWebview.js @@ -75,7 +75,7 @@ class RecipeWebview { debug('Script not found', file); return null; })).then(async (scripts) => { - const scriptsFound = scripts.filter(script => script !== null); + const scriptsFound = scripts.filter((script) => script !== null); if (scriptsFound.length > 0) { debug('Inject scripts to main world', scriptsFound); ipcRenderer.sendToHost('inject-js-unsafe', ...scriptsFound); diff --git a/src/webview/notifications.js b/src/webview/notifications.js index 39a515143..205a3220c 100644 --- a/src/webview/notifications.js +++ b/src/webview/notifications.js @@ -4,7 +4,7 @@ import uuidV1 from 'uuid/v1'; const debug = require('debug')('Ferdi:Notifications'); export class NotificationsHandler { - onNotify = data => data; + onNotify = (data) => data; displayNotification(title, options) { return new Promise((resolve) => { diff --git a/src/webview/spellchecker.js b/src/webview/spellchecker.js index 58a04b728..b59319495 100644 --- a/src/webview/spellchecker.js +++ b/src/webview/spellchecker.js @@ -9,7 +9,7 @@ const [defaultLocale] = webContents.session.getSpellCheckerLanguages(); debug('Spellchecker default locale is', defaultLocale); export function getSpellcheckerLocaleByFuzzyIdentifier(identifier) { - const locales = Object.keys(SPELLCHECKER_LOCALES).filter(key => key.toLocaleLowerCase() === identifier.toLowerCase() || key.split('-')[0] === identifier.toLowerCase()); + const locales = Object.keys(SPELLCHECKER_LOCALES).filter((key) => key.toLocaleLowerCase() === identifier.toLowerCase() || key.split('-')[0] === identifier.toLowerCase()); if (locales.length >= 1) { return locales[0]; -- cgit v1.2.3-70-g09d2