diff --git a/package.json b/package.json index 4277f335..f1de885f 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/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 f5981767..b1cdf5a9 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') @@ -586,7 +586,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 @@ -599,7 +599,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 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,}$/ diff --git a/yarn.lock b/yarn.lock index a14c6624..bd11b246 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4676,10 +4676,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"