Skip to content

Commit

Permalink
fix: remaining lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tyrauber committed Jul 15, 2024
1 parent eb3bb91 commit 58ef974
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 18 deletions.
5 changes: 0 additions & 5 deletions javascript/Maplibre.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,5 @@ export type {
LightLayerStyleProps as LightLayerStyle,
} from './utils/MaplibreStyles';

// types:
export enum StyleURL {
Default = 'https://demotiles.maplibre.org/style.json',
}

/** @deprecated UserTrackingModes is deprecated use UserTrackingMode */
export const UserTrackingModes = UserTrackingMode;
4 changes: 4 additions & 0 deletions javascript/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ export type MaplibreGLEvent<
P = GeoJSON.Feature,
V = Element,
> = SyntheticEvent<V, {type: T; payload: P}>;

export enum StyleURL {
Default = 'https://demotiles.maplibre.org/style.json',
}
4 changes: 2 additions & 2 deletions javascript/utils/animated/Animated.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {Animated as RNAnimated} from 'react-native';
import {Animated as RNAnimated} from 'react-native';

import AnimatedShape from './AnimatedShape';
import AnimatedCoordinatesArray from './AnimatedCoordinatesArray';
import AnimatedExtractCoordinateFromArray from './AnimatedExtractCoordinateFromArray';
import AnimatedRouteCoordinatesArray from './AnimatedRouteCoordinatesArray';
import AnimatedShape from './AnimatedShape';
import BackgroundLayer from '../../components/BackgroundLayer';
import CircleLayer from '../../components/CircleLayer';
import FillExtrusionLayer from '../../components/FillExtrusionLayer';
Expand Down
4 changes: 0 additions & 4 deletions javascript/utils/animated/AnimatedCoordinatesArray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ interface CoordinatesState {
}

class AnimatedCoordinatesArray extends AbstractAnimatedCoordinates<CoordinatesState> {
constructor(coords: AnimatedCoordinates[]) {
super(coords);
}

/**
* Subclasses can override to calculate initial state
*
Expand Down
4 changes: 0 additions & 4 deletions javascript/utils/animated/AnimatedRouteCoordinatesArray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ interface AnimatedRouteState {
}

export default class AnimatedRouteCoordinatesArray extends AbstractAnimatedCoordinates<AnimatedRouteState> {
constructor(coords: AnimatedCoordinates[]) {
super(coords);
}

/**
* Calculate initial state
*
Expand Down
9 changes: 6 additions & 3 deletions javascript/utils/deprecation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@ export function copyPropertiesAsDeprecated<
onDeprecatedCalled: (key: string) => void,
accessors: Record<string, (value: any) => unknown> = {},
): WithDeprecatedType {
const result = newObject;
const result = {...newObject};

for (const [key, value] of Object.entries(origObject)) {
if (!newObject[key]) {
// eslint-disable-next-line fp/no-mutating-methods
if (!(key in newObject)) {
Object.defineProperty(result, key, {
get() {
onDeprecatedCalled(key);
return accessors[key] ? accessors[key](value) : value;
},
enumerable: true, // Ensure the property is enumerable
configurable: true, // Ensure the property can be reconfigured
});
}
}

return result;
}

0 comments on commit 58ef974

Please sign in to comment.