chore: lint

This commit is contained in:
Adhiraj Singh
2023-02-21 11:49:59 +05:30
parent 971ce91ffd
commit 34f8f60d31
11 changed files with 23 additions and 22 deletions

View File

@@ -5,3 +5,4 @@ coverage
.eslintrc.json .eslintrc.json
src/WABinary/index.ts src/WABinary/index.ts
WAProto WAProto
WASignalGroup

View File

@@ -1,11 +1,11 @@
module.exports = { module.exports = {
"roots": [ 'roots': [
"<rootDir>/src" '<rootDir>/src'
], ],
"testMatch": [ 'testMatch': [
"**/Tests/test.*.+(ts|tsx|js)", '**/Tests/test.*.+(ts|tsx|js)',
], ],
"transform": { 'transform': {
"^.+\\.(ts|tsx)$": "ts-jest" '^.+\\.(ts|tsx)$': 'ts-jest'
}, },
} }

View File

@@ -24,8 +24,8 @@
"build:tsc": "tsc", "build:tsc": "tsc",
"example": "node --inspect -r ts-node/register Example/example.ts", "example": "node --inspect -r ts-node/register Example/example.ts",
"gen:protobuf": "sh WAProto/GenerateStatics.sh", "gen:protobuf": "sh WAProto/GenerateStatics.sh",
"lint": "eslint ./src --ext .js,.ts,.jsx,.tsx", "lint": "eslint . --ext .js,.ts,.jsx,.tsx",
"lint:fix": "eslint ./src --fix --ext .js,.ts,.jsx,.tsx" "lint:fix": "eslint . --fix --ext .js,.ts,.jsx,.tsx"
}, },
"author": "Adhiraj Singh", "author": "Adhiraj Singh",
"license": "MIT", "license": "MIT",

View File

@@ -74,7 +74,7 @@ export type ChatModification =
} }
| { | {
star: { star: {
messages: { id: string, fromMe?: boolean }[], messages: { id: string, fromMe?: boolean }[]
star: boolean star: boolean
} }
} }

View File

@@ -73,7 +73,7 @@ export type BufferedEventData = {
messageUpdates: { [key: string]: WAMessageUpdate } messageUpdates: { [key: string]: WAMessageUpdate }
messageDeletes: { [key: string]: WAMessageKey } messageDeletes: { [key: string]: WAMessageKey }
messageReactions: { [key: string]: { key: WAMessageKey, reactions: proto.IReaction[] } } messageReactions: { [key: string]: { key: WAMessageKey, reactions: proto.IReaction[] } }
messageReceipts: { [key: string]: { key: WAMessageKey, userReceipt: proto.IUserReceipt[] } }, messageReceipts: { [key: string]: { key: WAMessageKey, userReceipt: proto.IUserReceipt[] } }
groupUpdates: { [jid: string]: Partial<GroupMetadata> } groupUpdates: { [jid: string]: Partial<GroupMetadata> }
} }

View File

@@ -1,6 +1,6 @@
import { Contact } from './Contact' import { Contact } from './Contact'
export type GroupParticipant = (Contact & { isAdmin?: boolean; isSuperAdmin?: boolean, admin?: 'admin' | 'superadmin' | null }) export type GroupParticipant = (Contact & { isAdmin?: boolean, isSuperAdmin?: boolean, admin?: 'admin' | 'superadmin' | null })
export type ParticipantAction = 'add' | 'remove' | 'promote' | 'demote' export type ParticipantAction = 'add' | 'remove' | 'promote' | 'demote'

View File

@@ -146,7 +146,7 @@ export type AnyRegularMessageContent = (
listReply: Omit<proto.Message.IListResponseMessage, 'contextInfo'> listReply: Omit<proto.Message.IListResponseMessage, 'contextInfo'>
} }
| { | {
product: WASendableProduct, product: WASendableProduct
businessOwnerJid?: string businessOwnerJid?: string
body?: string body?: string
footer?: string footer?: string

View File

@@ -2,7 +2,7 @@ import { WAMediaUpload } from './Message'
export type CatalogResult = { export type CatalogResult = {
data: { data: {
paging: { cursors: { before: string, after: string } }, paging: { cursors: { before: string, after: string } }
data: any[] data: any[]
} }
} }

View File

@@ -52,4 +52,4 @@ export type WABusinessProfile = {
address?: string address?: string
} }
export type CurveKeyPair = { private: Uint8Array; public: Uint8Array } export type CurveKeyPair = { private: Uint8Array, public: Uint8Array }