diff options
author | Markus Hatvan <markus_hatvan@aon.at> | 2021-07-30 10:54:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-30 14:24:54 +0530 |
commit | f4b4416ea52d564bc2dbe543a82084ed98843ccc (patch) | |
tree | 7ca6b23571c86458a6b799746c91a7191de02715 /src/webview | |
parent | 5.6.1-nightly.8 [skip ci] (diff) | |
download | ferdium-app-f4b4416ea52d564bc2dbe543a82084ed98843ccc.tar.gz ferdium-app-f4b4416ea52d564bc2dbe543a82084ed98843ccc.tar.zst ferdium-app-f4b4416ea52d564bc2dbe543a82084ed98843ccc.zip |
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 <avijayr@protonmail.com>
Diffstat (limited to 'src/webview')
-rw-r--r-- | src/webview/contextMenuBuilder.js | 4 | ||||
-rw-r--r-- | src/webview/lib/RecipeWebview.js | 2 | ||||
-rw-r--r-- | src/webview/notifications.js | 2 | ||||
-rw-r--r-- | src/webview/spellchecker.js | 2 |
4 files changed, 5 insertions, 5 deletions
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 { | |||
61 | * @param {function} processMenu If passed, this method will be passed the menu to change | 61 | * @param {function} processMenu If passed, this method will be passed the menu to change |
62 | * it prior to display. Signature: (menu, info) => menu | 62 | * it prior to display. Signature: (menu, info) => menu |
63 | */ | 63 | */ |
64 | constructor(webContents, debugMode = false, processMenu = m => m) { | 64 | constructor(webContents, debugMode = false, processMenu = (m) => m) { |
65 | this.debugMode = debugMode; | 65 | this.debugMode = debugMode; |
66 | this.processMenu = processMenu; | 66 | this.processMenu = processMenu; |
67 | this.menu = null; | 67 | this.menu = null; |
@@ -320,7 +320,7 @@ module.exports = class ContextMenuBuilder { | |||
320 | label: this.stringTable.copyImage(), | 320 | label: this.stringTable.copyImage(), |
321 | click: () => { | 321 | click: () => { |
322 | const result = this.convertImageToBase64(menuInfo.srcURL, | 322 | const result = this.convertImageToBase64(menuInfo.srcURL, |
323 | dataURL => clipboard.writeImage(nativeImage.createFromDataURL(dataURL))); | 323 | (dataURL) => clipboard.writeImage(nativeImage.createFromDataURL(dataURL))); |
324 | 324 | ||
325 | this._sendNotificationOnClipboardEvent(menuInfo.clipboardNotifications, () => `Image copied from URL: ${menuInfo.srcURL}`); | 325 | this._sendNotificationOnClipboardEvent(menuInfo.clipboardNotifications, () => `Image copied from URL: ${menuInfo.srcURL}`); |
326 | return result; | 326 | 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 { | |||
75 | debug('Script not found', file); | 75 | debug('Script not found', file); |
76 | return null; | 76 | return null; |
77 | })).then(async (scripts) => { | 77 | })).then(async (scripts) => { |
78 | const scriptsFound = scripts.filter(script => script !== null); | 78 | const scriptsFound = scripts.filter((script) => script !== null); |
79 | if (scriptsFound.length > 0) { | 79 | if (scriptsFound.length > 0) { |
80 | debug('Inject scripts to main world', scriptsFound); | 80 | debug('Inject scripts to main world', scriptsFound); |
81 | ipcRenderer.sendToHost('inject-js-unsafe', ...scriptsFound); | 81 | 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'; | |||
4 | const debug = require('debug')('Ferdi:Notifications'); | 4 | const debug = require('debug')('Ferdi:Notifications'); |
5 | 5 | ||
6 | export class NotificationsHandler { | 6 | export class NotificationsHandler { |
7 | onNotify = data => data; | 7 | onNotify = (data) => data; |
8 | 8 | ||
9 | displayNotification(title, options) { | 9 | displayNotification(title, options) { |
10 | return new Promise((resolve) => { | 10 | 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(); | |||
9 | debug('Spellchecker default locale is', defaultLocale); | 9 | debug('Spellchecker default locale is', defaultLocale); |
10 | 10 | ||
11 | export function getSpellcheckerLocaleByFuzzyIdentifier(identifier) { | 11 | export function getSpellcheckerLocaleByFuzzyIdentifier(identifier) { |
12 | const locales = Object.keys(SPELLCHECKER_LOCALES).filter(key => key.toLocaleLowerCase() === identifier.toLowerCase() || key.split('-')[0] === identifier.toLowerCase()); | 12 | const locales = Object.keys(SPELLCHECKER_LOCALES).filter((key) => key.toLocaleLowerCase() === identifier.toLowerCase() || key.split('-')[0] === identifier.toLowerCase()); |
13 | 13 | ||
14 | if (locales.length >= 1) { | 14 | if (locales.length >= 1) { |
15 | return locales[0]; | 15 | return locales[0]; |