Skip to content

Commit

Permalink
chore: eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Avivbens committed Jan 14, 2024
1 parent 3120397 commit 9706124
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/consistent-type-imports': 'error',
'no-unused-vars': 'off',
'prettier/prettier': [
'error',
{
Expand Down
7 changes: 4 additions & 3 deletions src/contacts.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import alfy, { ScriptFilterItem } from 'alfy'
import { IContact } from './models/contact.model'
import type { ScriptFilterItem } from 'alfy'
import alfy from 'alfy'
import type { IContact } from './models/contact.model'
import { searchContacts } from './services/search-contacts.service'
import { Variables } from './common/variables'
import { ContactPayload } from './models/contact-payload.model'
import type { ContactPayload } from './models/contact-payload.model'
import type { CountryCode } from 'libphonenumber-js'
import { MAX_RESULTS_COUNT } from './common/constants'
;(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/open-whatsapp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import alfy from 'alfy'
import type { PhoneNumber } from 'libphonenumber-js'
import { parsePhoneNumber } from 'libphonenumber-js'
import open from 'open'
import { ContactPayload } from './models/contact-payload.model'
import type { ContactPayload } from './models/contact-payload.model'
;(async () => {
const rawInput: string = alfy.input
const input: ContactPayload = JSON.parse(rawInput)
Expand All @@ -11,7 +11,7 @@ import { ContactPayload } from './models/contact-payload.model'

const { number }: PhoneNumber = parsePhoneNumber(inputPhoneNumber, inputCountryCode)

const urlNew: string = `whatsapp://send?phone=${number}`
const urlNew = `whatsapp://send?phone=${number}`
open(urlNew)

// const url: string = `https://api.whatsapp.com/send?phone=${number}`
Expand Down
2 changes: 1 addition & 1 deletion src/services/search-contacts.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { IContact } from '../models/contact.model'
import type { IContact } from '../models/contact.model'

export const SEARCH_FIELDS_CONFIG: (keyof IContact)[] = ['firstName', 'lastName', 'phoneNumbers']
3 changes: 2 additions & 1 deletion src/services/search-contacts.service.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
import contacts from 'node-mac-contacts'
import alfy from 'alfy'
import { CACHE_CONTACTS_KEY, CACHE_TTL } from '../common/constants'
import { AuthStatus } from '../models/auth-status.enum'
import { IContact } from '../models/contact.model'
import type { IContact } from '../models/contact.model'
import { SEARCH_FIELDS_CONFIG } from './search-contacts.config'

export function isAuth(): boolean {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
"useUnknownInCatchVariables": false
},
"exclude": ["node_modules", "dist"],
"include": ["src/**/*"]
"include": ["src/**/*", ".eslintrc.cjs"]
}

0 comments on commit 9706124

Please sign in to comment.