From 842d0a96f2b2db788d5e12c3e4014382ed8475ea Mon Sep 17 00:00:00 2001 From: OS-pedrogustavobilro Date: Wed, 8 Jan 2025 13:12:00 +0000 Subject: [PATCH] fix: lint issues --- packages/capacitor-plugin/src/definitions.ts | 14 +++----------- packages/capacitor-plugin/src/index.ts | 1 - packages/capacitor-plugin/src/web.ts | 19 +++++++++++++------ 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/packages/capacitor-plugin/src/definitions.ts b/packages/capacitor-plugin/src/definitions.ts index 4ff5342..57568d6 100644 --- a/packages/capacitor-plugin/src/definitions.ts +++ b/packages/capacitor-plugin/src/definitions.ts @@ -51,10 +51,7 @@ export interface IGeolocationPlugin { * * @since 1.0.0 */ - watchPosition( - options: PositionOptions, - callback: WatchPositionCallback, - ): Promise; + watchPosition(options: PositionOptions, callback: WatchPositionCallback): Promise; /** * Clear a given watch @@ -75,9 +72,7 @@ export interface IGeolocationPlugin { * * @since 1.0.0 */ - requestPermissions( - permissions?: GeolocationPluginPermissions, - ): Promise; + requestPermissions(permissions?: GeolocationPluginPermissions): Promise; } export interface ClearWatchOptions { @@ -195,7 +190,4 @@ export interface PositionOptions { minimumUpdateInterval?: number; } -export type WatchPositionCallback = ( - position: Position | null, - err?: any, -) => void; \ No newline at end of file +export type WatchPositionCallback = (position: Position | null, err?: any) => void; diff --git a/packages/capacitor-plugin/src/index.ts b/packages/capacitor-plugin/src/index.ts index 2aa85d7..0d0c775 100644 --- a/packages/capacitor-plugin/src/index.ts +++ b/packages/capacitor-plugin/src/index.ts @@ -3,7 +3,6 @@ import { exposeSynapse } from '@capacitor/synapse'; import type { IGeolocationPlugin } from './definitions'; - const GeolocationPlugin = registerPlugin('GeolocationPlugin', { web: () => import('./web').then((m) => new m.GeolocationPluginWeb()), }); diff --git a/packages/capacitor-plugin/src/web.ts b/packages/capacitor-plugin/src/web.ts index a6cd814..f78df99 100644 --- a/packages/capacitor-plugin/src/web.ts +++ b/packages/capacitor-plugin/src/web.ts @@ -1,15 +1,22 @@ import { WebPlugin } from '@capacitor/core'; -import type { CallbackID, IGeolocationPlugin, PermissionStatus, Position, PositionOptions, WatchPositionCallback } from './definitions'; +import type { + CallbackID, + IGeolocationPlugin, + PermissionStatus, + Position, + PositionOptions, + WatchPositionCallback, +} from './definitions'; export class GeolocationPluginWeb extends WebPlugin implements IGeolocationPlugin { async getCurrentPosition(options?: PositionOptions): Promise { return new Promise((resolve, reject) => { navigator.geolocation.getCurrentPosition( - pos => { + (pos) => { resolve(pos); }, - err => { + (err) => { reject(err); }, { @@ -24,10 +31,10 @@ export class GeolocationPluginWeb extends WebPlugin implements IGeolocationPlugi async watchPosition(options: PositionOptions, callback: WatchPositionCallback): Promise { const id = navigator.geolocation.watchPosition( - pos => { + (pos) => { callback(pos); }, - err => { + (err) => { callback(null, err); }, @@ -64,4 +71,4 @@ export class GeolocationPluginWeb extends WebPlugin implements IGeolocationPlugi const Geolocation = new GeolocationPluginWeb(); -export { Geolocation }; \ No newline at end of file +export { Geolocation };