Skip to content

Commit

Permalink
fix(gmap-vue): fix linter errors on test and examples folder
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoazh committed Nov 23, 2021
1 parent 644d9b6 commit 4479404
Show file tree
Hide file tree
Showing 66 changed files with 1,961 additions and 1,577 deletions.
3 changes: 2 additions & 1 deletion packages/gmap-vue/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
examples/vue-google-maps.js
examples/dist/**
examples/gmap-vue.js
examples/examples-index.js
46 changes: 27 additions & 19 deletions packages/gmap-vue/.eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,38 @@ env:
es6: true
node: true
extends:
- 'plugin:vue/essential'
- 'airbnb-base'
- 'prettier'
- 'prettier/vue'
- 'plugin:eslint-comments/recommended'
- plugin:vue/essential
- airbnb-base
- prettier
- prettier/vue
- plugin:eslint-comments/recommended
parserOptions:
parser: 'babel-eslint'
parser: babel-eslint
ecmaVersion: 6
sourceType: module
ecmaFeatures: {
ecmaFeatures:
modules: true
}
plugins:
- vue
globals: {
globals:
google: true
}
root: true
rules: {
'eslint-comments/disable-enable-pair': 'error',
'eslint-comments/no-aggregating-enable': 'error',
'eslint-comments/no-duplicate-disable': 'error',
'eslint-comments/no-unlimited-disable': 'error',
'eslint-comments/no-unused-disable': 'error',
'eslint-comments/no-unused-enable': 'error',
'eslint-comments/require-description': ['error', { ignore: ['eslint-enable'] }],
}
rules:
eslint-comments/disable-enable-pair: error
eslint-comments/no-aggregating-enable: error
eslint-comments/no-duplicate-disable: error
eslint-comments/no-unlimited-disable: error
eslint-comments/no-unused-disable: error
eslint-comments/no-unused-enable: error
eslint-comments/require-description:
- error
- ignore:
- eslint-enable
import/no-extraneous-dependencies:
- error
- devDependencies: true
optionalDependencies: false
peerDependencies: false
no-param-reassign:
- error
- props: false
3 changes: 3 additions & 0 deletions packages/gmap-vue/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
examples/dist/**
examples/gmap-vue.js
examples/examples-index.js
16 changes: 8 additions & 8 deletions packages/gmap-vue/examples/.babelrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"presets": [
["@babel/env", {
"targets": {
"browsers": [
"last 2 versions",
"safari >= 7"
]
[
"@babel/env",
{
"targets": {
"browsers": ["last 2 versions", "safari >= 7"]
}
}
}]
]
],
"plugins": [
"transform-inline-environment-variables",
"minify-dead-code-elimination"
]
}
}
33 changes: 0 additions & 33 deletions packages/gmap-vue/examples/.eslintrc.yml

This file was deleted.

2 changes: 0 additions & 2 deletions packages/gmap-vue/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ open `all-components.html` in your browser.

If you need to write your own plugin for other Google Map components (e.g. overlays, heat maps)
refer to `overlay.html` for reference.


2 changes: 1 addition & 1 deletion packages/gmap-vue/examples/all-components.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta charset="utf-8" />
<title>Vue Webpack Example</title>
</head>
<body>
Expand Down
6 changes: 4 additions & 2 deletions packages/gmap-vue/examples/autoapi.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
</head>
<body>
<div id="app"></div>
<script>GENERATE_DOC=true</script>
<script>
GENERATE_DOC = true;
</script>
<script src="dist/autoapi.js"></script>
</body>
</html>
</html>
40 changes: 26 additions & 14 deletions packages/gmap-vue/examples/autocomplete.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,44 @@
<h1>Autocomplete Example (#164)</h1>
<label>
AutoComplete
<gmap-autocomplete placeholder="This is a placeholder text" @place_changed="setPlace">
<gmap-autocomplete
placeholder="This is a placeholder text"
@place_changed="setPlace"
>
</gmap-autocomplete>
<button @click="usePlace">Add</button>
</label>
<br />

<Gmap-Map style="width: 600px; height: 300px;" :zoom="1" :center="{lat: 0, lng: 0}">
<Gmap-Marker v-for="(marker, index) in markers" :key="index" :position="marker.position"></Gmap-Marker>
<Gmap-Marker v-if="this.place" label="&#x2605;" :position="{
<Gmap-Map
style="width: 600px; height: 300px;"
:zoom="1"
:center="{lat: 0, lng: 0}"
>
<Gmap-Marker
v-for="(marker, index) in markers"
:key="index"
:position="marker.position"
></Gmap-Marker>
<Gmap-Marker
v-if="this.place"
label="&#x2605;"
:position="{
lat: this.place.geometry.location.lat(),
lng: this.place.geometry.location.lng(),
}"></Gmap-Marker>
}"
></Gmap-Marker>
</Gmap-Map>
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.11/vue.js"></script>
<script src="gmap-vue.js"></script>

<script>

Vue.use(GmapVue, {
load: {
key: 'AIzaSyDf43lPdwlF98RCBsJOFNKOkoEjkwxb5Sc',
libraries: 'places'
libraries: 'places',
},
});

Expand All @@ -42,23 +56,21 @@ <h1>Autocomplete Example (#164)</h1>
this.description = description;
},
setPlace(place) {
this.place = place
this.place = place;
},
usePlace(place) {
if (this.place) {
this.markers.push({
position: {
lat: this.place.geometry.location.lat(),
lng: this.place.geometry.location.lng(),
}
})
},
});
this.place = null;
}
}
}
},
},
});
});

</script>

</body>
32 changes: 18 additions & 14 deletions packages/gmap-vue/examples/basic-autocomplete.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,30 @@ <h1>Changing Default Place updates text box</h1>
<button @click="setDescription('Seoul')">Set to Seoul</button><br />
<label>
Place:
<gmap-autocomplete :value="description" placeholder="This is a placeholder text" @place_changed="setPlace"
:select-first-on-enter="true">
<gmap-autocomplete
:value="description"
placeholder="This is a placeholder text"
@place_changed="setPlace"
:select-first-on-enter="true"
>
</gmap-autocomplete>
</label>
<br />
{{latLng.lat}},
{{latLng.lng}}
{{latLng.lat}}, {{latLng.lng}}

<div>
<h2>Options work</h2>
You cannot find the state of Texas in this
<label>
Only locations in Singapore:
<gmap-autocomplete :value="description" @place_changed="setPlace" :options="{
<gmap-autocomplete
:value="description"
@place_changed="setPlace"
:options="{
bounds: {north: 1.4, south: 1.2, east: 104, west: 102},
strictBounds: true
}">
}"
>
</gmap-autocomplete>
</label>
</div>
Expand All @@ -33,11 +40,10 @@ <h2>Options work</h2>
<script src="gmap-vue.js"></script>

<script>

Vue.use(GmapVue, {
load: {
key: 'AIzaSyDf43lPdwlF98RCBsJOFNKOkoEjkwxb5Sc',
libraries: 'places'
libraries: 'places',
},
});

Expand All @@ -46,24 +52,22 @@ <h2>Options work</h2>
el: '#root',
data: {
description: 'Singapore',
latLng: {}
latLng: {},
},
methods: {
setDescription(description) {
this.description = description;
},
setPlace(place) {
if (!place) return
if (!place) return;

this.latLng = {
lat: place.geometry.location.lat(),
lng: place.geometry.location.lng(),
};
}
}
},
},
});
});

</script>

</body>
22 changes: 14 additions & 8 deletions packages/gmap-vue/examples/basic-kml-layer.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<body>
<div id="root">
<google-map :center="center" :zoom="7" style="width: 100%; height: 500px">
<google-kml-layer v-for="l in kmlLayers" :url="l.url" :clickable="true"></google-kml-layer>
<google-map :center="center" :zoom="7" style="width: 100%; height: 500px;">
<google-kml-layer
v-for="l in kmlLayers"
:url="l.url"
:clickable="true"
></google-kml-layer>
</google-map>
</div>

Expand All @@ -11,7 +15,7 @@
<script>
Vue.use(GmapVue, {
load: {
key: 'AIzaSyDf43lPdwlF98RCBsJOFNKOkoEjkwxb5Sc'
key: 'AIzaSyDf43lPdwlF98RCBsJOFNKOkoEjkwxb5Sc',
},
// Demonstrating how we can customize the name of the components
installComponents: false,
Expand All @@ -26,14 +30,16 @@
data: {
center: {
lat: -19.257753,
lng: 146.823688
lng: 146.823688,
},
kmlLayers: [{
url: 'https://developers.google.com/maps/documentation/javascript/examples/kml/westcampus.kml'
}]
kmlLayers: [
{
url:
'https://developers.google.com/maps/documentation/javascript/examples/kml/westcampus.kml',
},
],
},
});
});
</script>

</body>

0 comments on commit 4479404

Please sign in to comment.