From b9976b2d70969ced8f4fc1caf818c75b9f604f6e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 18 Nov 2020 06:47:47 +0000 Subject: [PATCH 1/4] Bump eslint-config-standard from 14.1.1 to 16.0.2 Bumps [eslint-config-standard](https://github.com/standard/eslint-config-standard) from 14.1.1 to 16.0.2. - [Release notes](https://github.com/standard/eslint-config-standard/releases) - [Changelog](https://github.com/standard/eslint-config-standard/blob/master/CHANGELOG.md) - [Commits](https://github.com/standard/eslint-config-standard/compare/v14.1.1...v16.0.2) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index a4d882f2..b1829bb0 100644 --- a/package.json +++ b/package.json @@ -248,7 +248,7 @@ "electron-packager": "^15.0.0", "eslint": "^7.12.1", "eslint-config-prettier": "^6.15.0", - "eslint-config-standard": "^14.1.1", + "eslint-config-standard": "^16.0.2", "eslint-friendly-formatter": "^4.0.1", "eslint-loader": "^4.0.2", "eslint-plugin-html": "^6.0.3", diff --git a/yarn.lock b/yarn.lock index a3f16eb8..941951a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4923,10 +4923,10 @@ eslint-config-prettier@^6.15.0: dependencies: get-stdin "^6.0.0" -eslint-config-standard@^14.1.1: - version "14.1.1" - resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-14.1.1.tgz#830a8e44e7aef7de67464979ad06b406026c56ea" - integrity sha512-Z9B+VR+JIXRxz21udPTL9HpFMyoMUEeX1G251EQ6e05WD9aPVtVBn09XUmZ259wCMlCDmYDSZG62Hhm+ZTJcUg== +eslint-config-standard@^16.0.2: + version "16.0.2" + resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-16.0.2.tgz#71e91727ac7a203782d0a5ca4d1c462d14e234f6" + integrity sha512-fx3f1rJDsl9bY7qzyX8SAtP8GBSk6MfXFaTfaGgk12aAYW4gJSyRm7dM790L6cbXv63fvjY4XeSzXnb4WM+SKw== eslint-friendly-formatter@^4.0.1: version "4.0.1" From 3516263140ce82469f28b7db5c4dca6a769f5649 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Mon, 30 Nov 2020 22:50:31 +0900 Subject: [PATCH 2/4] Fix path style --- src/main/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/index.ts b/src/main/index.ts index 1d7b4ad4..ca712ec9 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -82,7 +82,7 @@ if (process.env.NODE_ENV !== 'development') { let mainWindow: BrowserWindow | null let tray: Tray | null -const winURL = process.env.NODE_ENV === 'development' ? `http://localhost:9080` : `file://${__dirname}/index.html` +const winURL = process.env.NODE_ENV === 'development' ? `http://localhost:9080` : path.join('file://', __dirname, '/index.html') // MAS build is not allowed requestSingleInstanceLock. // ref: https://github.com/h3poteto/whalebird-desktop/issues/1030 @@ -113,7 +113,7 @@ const appId = pkg.build.appId const splashURL = process.env.NODE_ENV === 'development' ? path.resolve(__dirname, '../../static/splash-screen.html') - : `${__dirname}/static/splash-screen.html` + : path.join(__dirname, '/static/splash-screen.html') // https://github.com/louischatriot/nedb/issues/459 const userData = app.getPath('userData') From e221706123e815aeb120dc6d38d16472c6bcc2b0 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Mon, 30 Nov 2020 22:52:31 +0900 Subject: [PATCH 3/4] Fix regexp constructor --- src/renderer/utils/validator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/utils/validator.js b/src/renderer/utils/validator.js index 3b250f24..1d4e954a 100644 --- a/src/renderer/utils/validator.js +++ b/src/renderer/utils/validator.js @@ -1 +1 @@ -export const domainFormat = new RegExp(/^[a-zA-Z0-9][a-zA-Z0-9-.]{0,61}[a-zA-Z0-9]\.[a-zA-Z]{2,}$/) +export const domainFormat = /^[a-zA-Z0-9][a-zA-Z0-9-.]{0,61}[a-zA-Z0-9]\.[a-zA-Z]{2,}$/ From c4c63ec9fe821d970aa84e7755ad69275f0633a1 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Mon, 30 Nov 2020 22:57:41 +0900 Subject: [PATCH 4/4] Rewrite map to forEach when it is unnecessary --- spec/config/i18n.spec.ts | 2 +- src/main/index.ts | 4 ++-- src/renderer/store/TimelineSpace/Modals/NewToot.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/config/i18n.spec.ts b/spec/config/i18n.spec.ts index 908724cf..f926f6f9 100644 --- a/spec/config/i18n.spec.ts +++ b/spec/config/i18n.spec.ts @@ -6,7 +6,7 @@ const locales = ['de', 'fr', 'it', 'ja', 'ko', 'pl', 'zh_cn'] describe('i18n', () => { describe('should not define duplicate keys', () => { - locales.map(locale => { + locales.forEach(locale => { it(`${locale} translation`, () => { const targetJson = JSON.parse( fs.readFileSync(path.resolve(__dirname, `../../src/config/locales/${locale}/translation.json`), 'utf8') diff --git a/src/main/index.ts b/src/main/index.ts index ca712ec9..811dbf6e 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -663,7 +663,7 @@ ipcMain.on('start-all-user-streamings', (event: IpcMainEvent, accounts: Array { - Object.keys(userStreamings).map((key: string) => { + Object.keys(userStreamings).forEach((key: string) => { if (userStreamings[key]) { userStreamings[key]!.stop() userStreamings[key] = null @@ -676,7 +676,7 @@ ipcMain.on('stop-all-user-streamings', () => { * @param id specified user id in nedb. */ const stopUserStreaming = (id: string) => { - Object.keys(userStreamings).map((key: string) => { + Object.keys(userStreamings).forEach((key: string) => { if (key === id && userStreamings[id]) { userStreamings[id]!.stop() userStreamings[id] = null diff --git a/src/renderer/store/TimelineSpace/Modals/NewToot.ts b/src/renderer/store/TimelineSpace/Modals/NewToot.ts index cc2b5ec3..a7356a09 100644 --- a/src/renderer/store/TimelineSpace/Modals/NewToot.ts +++ b/src/renderer/store/TimelineSpace/Modals/NewToot.ts @@ -234,7 +234,7 @@ const actions: ActionTree = { } if (params.polls.length > 1) { - params.polls.map(poll => { + params.polls.forEach(poll => { if (poll.length < 1) { throw new NewTootPollInvalid() } @@ -297,7 +297,7 @@ const actions: ActionTree = { commit(MUTATION_TYPES.UPDATE_INITIAL_SPOILER, message.spoiler_text) commit(MUTATION_TYPES.CHANGE_MODAL, true) let value: number = Visibility.Public.value - Object.keys(Visibility).map(key => { + Object.keys(Visibility).forEach(key => { const target = Visibility[key] if (target.key === message.visibility) { value = target.value