Skip to content

Commit

Permalink
style: run yarn lint (rnmapbox#1486)
Browse files Browse the repository at this point in the history
* style: run yarn lint

* chore: update Changelog
  • Loading branch information
lisabaut authored Aug 9, 2021
1 parent f38ff0b commit db7c5ec
Show file tree
Hide file tree
Showing 40 changed files with 99 additions and 102 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Support tintColor on Android ([#1465](https://github.com/react-native-mapbox-gl/
Feat(android): dynamically update tintColor & add example ([#1469](https://github.com/react-native-mapbox-gl/maps/pull/1469)
Docs: make background in example pngs transparent ([#1483](https://github.com/react-native-mapbox-gl/maps/pull/1483)
Examples: align install steps with yarn, ignore created env files ([#1484](https://github.com/react-native-mapbox-gl/maps/pull/1484)
Style: run yarn lint ([#1486](https://github.com/react-native-mapbox-gl/maps/pull/1486)

---

Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Animations/AnimatedLine.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class AnimatedLine extends React.Component {
return (
<Page {...this.props}>
<MapView
ref={(c) => (this._map = c)}
ref={c => (this._map = c)}
onPress={this.onPress}
onDidFinishLoadingMap={this.onDidFinishLoadingMap}
style={sheet.matchParent}>
Expand Down
4 changes: 2 additions & 2 deletions example/src/examples/Animations/DriveTheLine.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class DriveTheLine extends React.Component {

onStart() {
const routeSimulator = new RouteSimulator(this.state.route);
routeSimulator.addListener((currentPoint) => this.setState({currentPoint}));
routeSimulator.addListener(currentPoint => this.setState({currentPoint}));
routeSimulator.start();
this.setState({routeSimulator});
}
Expand Down Expand Up @@ -192,7 +192,7 @@ class DriveTheLine extends React.Component {
return (
<Page {...this.props}>
<MapboxGL.MapView
ref={(c) => (this._map = c)}
ref={c => (this._map = c)}
style={sheet.matchParent}
styleURL={MapboxGL.StyleURL.Dark}>
<MapboxGL.Camera
Expand Down
14 changes: 7 additions & 7 deletions example/src/examples/Annotations/CustomCallout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ type CustomCalloutProps = {
onDismissExample: () => any;
};

const CustomCallout: FC<CustomCalloutProps> = (props) => {
const CustomCallout: FC<CustomCalloutProps> = props => {
const [selectedFeature, setSelectedFeature] =
useState<Feature<{type: string; coordinates: number[]}, any>>();

const onPinPress = (e: any): void => {
if(selectedFeature) {
setSelectedFeature(undefined);
return;
}
if (selectedFeature) {
setSelectedFeature(undefined);
return;
}

const feature = e?.features[0];
setSelectedFeature(feature);
const feature = e?.features[0];
setSelectedFeature(feature);
};

return (
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Annotations/MarkerView.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ShowMarkerView extends React.Component {
return (
<Page {...this.props}>
<MapboxGL.MapView
ref={(c) => (this._map = c)}
ref={c => (this._map = c)}
onPress={this.onPress}
onDidFinishLoadingMap={this.onDidFinishLoadingMap}
style={sheet.matchParent}>
Expand Down
10 changes: 5 additions & 5 deletions example/src/examples/Annotations/ShowPointAnnotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ class AnnotationWithRemoteImage extends React.Component {
coordinate={coordinate}
title={title}
draggable
onDrag={(e) =>
onDrag={e =>
console.log('onDrag:', e.properties.id, e.geometry.coordinates)
}
onDragStart={(e) =>
onDragStart={e =>
console.log('onDragStart:', e.properties.id, e.geometry.coordinates)
}
onDragEnd={(e) =>
onDragEnd={e =>
console.log('onDragEnd:', e.properties.id, e.geometry.coordinates)
}
ref={(ref) => (this.annotationRef = ref)}>
ref={ref => (this.annotationRef = ref)}>
<View style={styles.annotationContainer}>
<Image
source={{uri: 'https://reactnative.dev/img/tiny_logo.png'}}
Expand Down Expand Up @@ -159,7 +159,7 @@ class ShowPointAnnotation extends React.Component {
return (
<Page {...this.props}>
<MapboxGL.MapView
ref={(c) => (this._map = c)}
ref={c => (this._map = c)}
onPress={this.onPress}
onDidFinishLoadingMap={this.onDidFinishLoadingMap}
style={sheet.matchParent}>
Expand Down
4 changes: 2 additions & 2 deletions example/src/examples/CacheManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ class CacheManagement extends React.Component {
Alert.alert(`Max cache size successfully set to ${newMaxSize} bytes`);
};

validateCacheInputValue = (value) => !isNaN(parseInt(value, 10));
validateCacheInputValue = value => !isNaN(parseInt(value, 10));

onChangeCacheSize = (cacheSize) => this.setState({cacheSize});
onChangeCacheSize = cacheSize => this.setState({cacheSize});

render() {
const validSizeValue = this.validateCacheInputValue(this.state.cacheSize);
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Camera/GetCenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class GetCenter extends React.Component {
<Page {...this.props}>
<MapboxGL.MapView
onRegionDidChange={this.onRegionDidChange}
ref={(c) => (this._map = c)}
ref={c => (this._map = c)}
onPress={this.onPress}
style={styles.mapView}>
<MapboxGL.Camera
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Camera/GetZoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class GetZoom extends React.Component {
<Page {...this.props}>
<MapboxGL.MapView
onRegionDidChange={this.onRegionDidChange}
ref={(c) => (this._map = c)}
ref={c => (this._map = c)}
onPress={this.onPress}
style={styles.mapView}>
<MapboxGL.Camera
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Camera/RestrictMapBounds.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const bounds = {
const {ne, sw} = bounds;
const polygon = bboxPolygon([sw[0], sw[1], ne[0], ne[1]]);

const RestrictMapBounds = (props) => (
const RestrictMapBounds = props => (
<Page {...props}>
<MapboxGL.MapView
style={sheet.matchParent}
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Camera/SetHeading.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SetHeading extends React.Component {
options={this._bearingOptions}
onOptionPress={this.onHeadingChange}>
<MapboxGL.MapView
ref={(ref) => (this.map = ref)}
ref={ref => (this.map = ref)}
style={sheet.matchParent}>
<MapboxGL.Camera {...this.state} />
<MapboxGL.UserLocation />
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Camera/SetUserTrackingModes.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SetUserTrackingModes extends React.Component {
super(props);

this._trackingOptions = Object.keys(MapboxGL.UserTrackingModes)
.map((key) => {
.map(key => {
return {
label: key,
data: MapboxGL.UserTrackingModes[key],
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Camera/TakeSnapshotWithMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class TakeSnapshotWithMap extends React.Component {
return (
<Page {...this.props}>
<View style={styles.mapContainer}>
<MapboxGL.MapView ref={(ref) => (this.map = ref)} style={styles.map}>
<MapboxGL.MapView ref={ref => (this.map = ref)} style={styles.map}>
<MapboxGL.Camera
zoomLevel={16}
pitch={45}
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Camera/YoYo.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class YoYo extends React.Component {
return (
<Page {...this.props}>
<MapboxGL.MapView
ref={(ref) => (this.map = ref)}
ref={ref => (this.map = ref)}
style={sheet.matchParent}
styleURL={MapboxGL.StyleURL.Dark}>
<MapboxGL.Camera
Expand Down
4 changes: 2 additions & 2 deletions example/src/examples/FillRasterLayer/CustomVectorSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ class CustomVectorSource extends React.PureComponent {
<MapboxGL.VectorSource
id="customSourceExample"
url={VECTOR_SOURCE_URL}
ref={(source) => {
ref={source => {
this._vectorSource = source;
}}
onPress={(e) => {
onPress={e => {
console.log(`VectorSource onPress: ${e.features}`, e.features);
}}>
<MapboxGL.FillLayer
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/FillRasterLayer/GeoJSONSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class GeoJSONSource extends React.Component {
return (
<Page {...this.props}>
<MapboxGL.MapView
ref={(ref) => (this.map = ref)}
ref={ref => (this.map = ref)}
style={sheet.matchParent}
styleURL={MapboxGL.StyleURL.Dark}>
<MapboxGL.Camera
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/FillRasterLayer/ImageOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class ImageOverlay extends React.Component {
return (
<Page {...this.props}>
<MapboxGL.MapView
ref={(ref) => (this.map = ref)}
ref={ref => (this.map = ref)}
style={sheet.matchParent}
styleURL={MapboxGL.StyleURL.Satellite}>
<MapboxGL.Camera zoomLevel={4} centerCoordinate={[-79, 40]} />
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/FillRasterLayer/IndoorBuilding.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class IndoorBuilding extends React.Component {
return (
<Page {...this.props}>
<MapboxGL.MapView
ref={(ref) => (this.map = ref)}
ref={ref => (this.map = ref)}
style={sheet.matchParent}>
<MapboxGL.Camera
zoomLevel={16}
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/FillRasterLayer/QueryAtPoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class QueryAtPoint extends React.Component {
return (
<Page {...this.props}>
<MapboxGL.MapView
ref={(c) => (this._map = c)}
ref={c => (this._map = c)}
onPress={this.onPress}
style={sheet.matchParent}
styleURL={MapboxGL.StyleURL.Light}>
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/FillRasterLayer/QueryWithRect.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class QueryWithRect extends React.Component {
return (
<Page {...this.props}>
<MapboxGL.MapView
ref={(c) => (this._map = c)}
ref={c => (this._map = c)}
onPress={this.onPress}
style={sheet.matchParent}
styleURL={MapboxGL.StyleURL.Light}>
Expand Down
58 changes: 33 additions & 25 deletions example/src/examples/LineLayer/GradientLine.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ class GradientLine extends React.Component {
return (
<Page {...this.props}>
<MapboxGL.MapView style={sheet.matchParent}>
<MapboxGL.Camera centerCoordinate={[-77.035, 38.875]} zoomLevel={12} />
<MapboxGL.ShapeSource id="source1" lineMetrics={true}
<MapboxGL.Camera
centerCoordinate={[-77.035, 38.875]}
zoomLevel={12}
/>
<MapboxGL.ShapeSource
id="source1"
lineMetrics={true}
shape={{
type: 'Feature',
geometry: {
Expand All @@ -42,29 +47,32 @@ class GradientLine extends React.Component {
],
},
}}>
<MapboxGL.LineLayer id="layer1" style={{
lineColor: 'red',
lineCap: "round",
lineJoin: "round",
lineWidth: 14,
lineGradient: [
'interpolate',
['linear'],
['line-progress'],
0,
'blue',
0.1,
'royalblue',
0.3,
'cyan',
0.5,
'lime',
0.7,
'yellow',
1,
'red'
]
}} />
<MapboxGL.LineLayer
id="layer1"
style={{
lineColor: 'red',
lineCap: 'round',
lineJoin: 'round',
lineWidth: 14,
lineGradient: [
'interpolate',
['linear'],
['line-progress'],
0,
'blue',
0.1,
'royalblue',
0.3,
'cyan',
0.5,
'lime',
0.7,
'yellow',
1,
'red',
],
}}
/>
</MapboxGL.ShapeSource>
</MapboxGL.MapView>
</Page>
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Map/ChangeLayerColor.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ChangeLayerColor extends React.Component {
return (
<Page {...this.props}>
<MapboxGL.MapView
ref={(c) => (this._map = c)}
ref={c => (this._map = c)}
onPress={this.onPress}
style={styles.mapView}>
<MapboxGL.Camera defaultSettings={defaultCamera} />
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Map/CreateOfflineRegion.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class CreateOfflineRegion extends React.Component {
return (
<Page {...this.props}>
<MapboxGL.MapView
ref={(c) => (this._map = c)}
ref={c => (this._map = c)}
onPress={this.onPress}
onDidFinishLoadingMap={this.onDidFinishLoadingStyle}
style={sheet.matchParent}>
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Map/PointInMapView.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class PointInMapView extends React.Component {
return (
<Page {...this.props}>
<MapboxGL.MapView
ref={(c) => (this._map = c)}
ref={c => (this._map = c)}
onPress={this.onPress}
style={styles.mapView}>
<MapboxGL.Camera
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Map/ShowAndHideLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ShowAndHideLayer extends React.Component {
return (
<Page {...this.props}>
<MapboxGL.MapView
ref={(c) => (this._map = c)}
ref={c => (this._map = c)}
onPress={this.onPress}
style={styles.mapView}>
<MapboxGL.Camera defaultSettings={defaultCamera} />
Expand Down
4 changes: 2 additions & 2 deletions example/src/examples/Map/ShowMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import sheet from '../../styles/sheet';
import {onSortOptions} from '../../utils';
import TabBarPage from '../common/TabBarPage';

const ShowMap: FC<any> = (props) => {
const ShowMap: FC<any> = props => {
const _mapOptions = Object.keys(MapboxGL.StyleURL)
.map((key) => {
.map(key => {
return {
label: key,
data: (MapboxGL.StyleURL as any)[key], // bad any, because enums
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Map/ShowMapLocalStyle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Page from '../common/Page';

const style = JSON.stringify(require('../../assets/map-styleURL-style.json'));

const ShowMap: FC<any> = (props) => {
const ShowMap: FC<any> = props => {
useEffect(() => {
MapboxGL.locationManager.start();

Expand Down
8 changes: 4 additions & 4 deletions example/src/examples/Map/ShowRegionDidChange.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const styles = {
bubble: {marginBottom: 100},
};

const isValidCoordinate = (geometry) => {
const isValidCoordinate = geometry => {
if (!geometry) {
return false;
}
Expand Down Expand Up @@ -106,10 +106,10 @@ class ShowRegionDidChange extends React.Component {
const {geometry, properties} = this.state.regionFeature;

const neCoord = properties.visibleBounds[0]
.map((n) => n.toPrecision(6))
.map(n => n.toPrecision(6))
.join(', ');
const swCoord = properties.visibleBounds[1]
.map((n) => n.toPrecision(6))
.map(n => n.toPrecision(6))
.join(', ');

return (
Expand Down Expand Up @@ -137,7 +137,7 @@ class ShowRegionDidChange extends React.Component {
options={this._tabOptions}
onOptionPress={this.onOptionPress}>
<MapboxGL.MapView
ref={(c) => (this.map = c)}
ref={c => (this.map = c)}
style={sheet.matchParent}
onRegionWillChange={this.onRegionWillChange}
onRegionIsChanging={this.onRegionIsChanging}
Expand Down
Loading

0 comments on commit db7c5ec

Please sign in to comment.