Skip to content

Commit

Permalink
Fix eslint, remove prettier-config-standard
Browse files Browse the repository at this point in the history
  • Loading branch information
EmiM committed Jun 16, 2023
1 parent 3111762 commit ff0d219
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 25 deletions.
8 changes: 4 additions & 4 deletions packages/e2e-tests/src/selectors.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { By, Key, ThenableWebDriver, until } from 'selenium-webdriver'
import { BuildSetup, BuildSetupInit } from './utils'
import { By, Key, type ThenableWebDriver, until } from 'selenium-webdriver'
import { BuildSetup, type BuildSetupInit } from './utils'

export class App {
thenableWebDriver?: ThenableWebDriver
Expand Down Expand Up @@ -128,7 +128,7 @@ export class ChannelContextMenu {
until.elementLocated(By.xpath('//button[@data-testid="deleteChannelButton"]'))
)
await button.click()
await new Promise<void>(resolve => setTimeout(() => resolve(), 5000))
await new Promise<void>(resolve => setTimeout(() => { resolve(); }, 5000))
}
}
export class RegisterUsernameModal {
Expand Down Expand Up @@ -248,7 +248,7 @@ export class Channel {
const communityNameInput = await this.messageInput
await communityNameInput.sendKeys(message)
await communityNameInput.sendKeys(Key.ENTER)
await new Promise<void>(resolve => setTimeout(() => resolve(), 5000))
await new Promise<void>(resolve => setTimeout(() => { resolve(); }, 5000))
}

async getUserMessages(username: string) {
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/src/tests/invitationLink.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '../selectors'
import { capitalizeFirstLetter, invitationDeepUrl } from '@quiet/common'
import { execSync } from 'child_process'
import { SupportedPlatformDesktop } from '@quiet/types'
import { type SupportedPlatformDesktop } from '@quiet/types'

jest.setTimeout(900000)
it.todo('New user joins using invitation link while having app closed')
Expand Down
12 changes: 6 additions & 6 deletions packages/e2e-tests/src/tests/twoClients.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ describe('Two Clients', () => {
const isMessageInput2 = await generalChannel2.messageInput.isDisplayed()
expect(isMessageInput2).toBeTruthy()
console.log('FETCHING CHANNEL MESSAGES!')
await new Promise<void>(resolve => setTimeout(() => resolve(), 5000))
await new Promise<void>(resolve => setTimeout(() => { resolve(); }, 5000))
await generalChannel2.sendMessage(joiningUserMessages[0])
})
it('Sent message is visible in a channel', async () => {
Expand All @@ -192,7 +192,7 @@ describe('Two Clients', () => {
sidebar2 = new Sidebar(guestApp.driver)
await sidebar2.switchChannel(newChannelName)
secondChannel2 = new Channel(guestApp.driver, newChannelName)
await new Promise<void>(resolve => setTimeout(() => resolve(), 2000))
await new Promise<void>(resolve => setTimeout(() => { resolve(); }, 2000))
const messages = await secondChannel2.getUserMessages(ownerUsername)
const text = await messages[1].getText()
expect(text).toEqual(ownerMessages[1])
Expand All @@ -215,7 +215,7 @@ describe('Two Clients', () => {
await sidebar2.switchChannel(newChannelName)
const messages = await secondChannel2.getUserMessages(joiningUserUsername)
expect(messages.length).toEqual(1)
await new Promise<void>(resolve => setTimeout(() => resolve(), 2000))
await new Promise<void>(resolve => setTimeout(() => { resolve(); }, 2000))
const channels = await sidebar.getChannelList()
expect(channels.length).toEqual(2)
})
Expand All @@ -235,7 +235,7 @@ describe('Two Clients', () => {
}
// Delete general channel while guest is absent
it('Channel deletion - Owner recreate general channel', async () => {
await new Promise<void>(resolve => setTimeout(() => resolve(), 2000))
await new Promise<void>(resolve => setTimeout(() => { resolve(); }, 2000))
const isGeneralChannel = await generalChannel.messageInput.isDisplayed()
expect(isGeneralChannel).toBeTruthy()
await channelContextMenu.openMenu()
Expand Down Expand Up @@ -264,7 +264,7 @@ describe('Two Clients', () => {
it('Channel deletion - User see information about recreation general channel and see correct amount of messages', async () => {
generalChannel2 = new Channel(guestApp.driver, 'general')
await generalChannel2.element.isDisplayed()
await new Promise<void>(resolve => setTimeout(() => resolve(), 10000))
await new Promise<void>(resolve => setTimeout(() => { resolve(); }, 10000))
const messages = await generalChannel2.getUserMessages(ownerUsername)
const text1 = await messages[0].getText()
const text2 = await messages[1].getText()
Expand All @@ -278,7 +278,7 @@ describe('Two Clients', () => {
await generalChannel2.element.isDisplayed()
const isMessageInput2 = await generalChannel2.messageInput.isDisplayed()
expect(isMessageInput2).toBeTruthy()
await new Promise<void>(resolve => setTimeout(() => resolve(), 5000))
await new Promise<void>(resolve => setTimeout(() => { resolve(); }, 5000))
await generalChannel2.sendMessage(joiningUserMessages[1])
})
it('Leave community - Sent message is visible in a channel', async () => {
Expand Down
18 changes: 9 additions & 9 deletions packages/e2e-tests/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Browser, Builder, ThenableWebDriver } from 'selenium-webdriver'
import { spawn, exec, ChildProcessWithoutNullStreams, execSync } from 'child_process'
import { SupportedPlatformDesktop } from '@quiet/types'
import { Browser, Builder, type ThenableWebDriver } from 'selenium-webdriver'
import { spawn, exec, type ChildProcessWithoutNullStreams, execSync } from 'child_process'
import { type SupportedPlatformDesktop } from '@quiet/types'
import getPort from 'get-port'
import path from 'path'

Expand Down Expand Up @@ -39,7 +39,7 @@ export class BuildSetup {
private getBinaryLocation() {
switch (process.platform) {
case 'linux':
return `${__dirname}/../Quiet/${process.env.FILE_NAME}`
return path.join(__dirname, '..', 'Quiet', `${process.env.FILE_NAME}`)
case 'win32':
return `${process.env.LOCALAPPDATA}\\Programs\\quiet\\Quiet.exe`
case 'darwin':
Expand Down Expand Up @@ -69,7 +69,7 @@ export class BuildSetup {
})
}
// Extra time for chromedriver to setup
await new Promise<void>(resolve => setTimeout(() => resolve(), 2000))
await new Promise<void>(resolve => setTimeout(() => { resolve(); }, 2000))

const killNine = () => {
exec(`kill -9 $(lsof -t -i:${this.port})`)
Expand All @@ -91,8 +91,8 @@ export class BuildSetup {
killNine()
})

this.child.on('message', data => console.log('message', data))
this.child.on('error', data => console.log('error', data))
this.child.on('message', data => { console.log('message', data); })
this.child.on('error', data => { console.log('error', data); })

this.child.stdout.on('data', data => {
console.log(`stdout:\n${data}`)
Expand Down Expand Up @@ -131,7 +131,7 @@ export class BuildSetup {
.usingServer(`http://localhost:${this.port}`)
.withCapabilities({
'goog:chromeOptions': {
binary: binary,
binary,
args: [`--remote-debugging-port=${this.debugPort}`, '--enable-logging']
}
})
Expand All @@ -155,7 +155,7 @@ export class BuildSetup {
public async killChromeDriver() {
console.log(`Killing driver (DATA_DIR=${this.dataDir})`)
this.child?.kill()
await new Promise<void>(resolve => setTimeout(() => resolve(), 2000))
await new Promise<void>(resolve => setTimeout(() => { resolve(); }, 2000))
}

public async closeDriver() {
Expand Down
19 changes: 17 additions & 2 deletions packages/eslint-config-custom/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
const prettierConfigStandard = require('prettier-config-standard')
// const prettierConfigStandard = require('prettier-config-standard')

// {
// "arrowParens": "always",
// "bracketSpacing": true,
// "jsxBracketSameLine": false,
// "jsxSingleQuote": false,
// "quoteProps": "as-needed",
// "singleQuote": true,
// "semi": false,
// "printWidth": 140,
// "useTabs": false,
// "tabWidth": 2,
// "trailingComma": "es5"
// }

const modifiedConfig = {
...prettierConfigStandard,
// ...prettierConfigStandard,
singleQuote: true,
jsxSingleQuote: true,
spaceBeforeFunctionParen: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-custom/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
env: {
"jest/globals": true
},
extends: ['standard-with-typescript', "prettier"],
extends: ['standard-with-typescript', 'plugin:prettier/recommended',],
parserOptions: {
project: './tsconfig.json'
},
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-custom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier-config-standard": "^5.0.0"
"prettier": "^2.8.8"
}
}

1 change: 0 additions & 1 deletion packages/state-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"jest": "^27.0.6",
"libp2p-websockets": "*",
"pkijs": "^3.0.8",
"prettier": "^2.3.2",
"pvutils": "*",
"redux-saga-test-plan": "^4.0.3",
"tmp": "^0.2.1",
Expand Down

0 comments on commit ff0d219

Please sign in to comment.