Skip to content

Commit

Permalink
style: lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
bolinocroustibat committed Dec 2, 2024
1 parent 40c1b7e commit 839e1f0
Show file tree
Hide file tree
Showing 13 changed files with 79 additions and 71 deletions.
Binary file modified frontend/bun.lockb
Binary file not shown.
2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
"@types/node": "^22.10.1",
"@vitejs/plugin-vue": "^5.2.1",
"@vue/tsconfig": "^0.7.0",
"autoprefixer": "^10.4.20",
"biome": "^0.3.3",
"npm-run-all2": "^7.0.1",
"tailwindcss": "^3.4.15",
"typescript": "~5.6.3",
"vite": "^6.0.2",
"vite-plugin-vue-devtools": "^7.6.7",
Expand Down
24 changes: 12 additions & 12 deletions frontend/src/components/HeaderComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@
</template>

<script lang="ts">
import { defineComponent, computed } from 'vue'
import { useRoute } from 'vue-router'
import { computed, defineComponent } from "vue";
import { useRoute } from "vue-router";
export default defineComponent({
setup() {
const route = useRoute()
const isMapRoute = computed(() => {
return route.path === '/' || route.path === '/map'
})
setup() {
const route = useRoute();
const isMapRoute = computed(() => {
return route.path === "/" || route.path === "/map";
});
return {
isMapRoute
}
}
})
return {
isMapRoute,
};
},
});
</script>

<style>
Expand Down
7 changes: 3 additions & 4 deletions frontend/src/components/MapComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@
</template>

<script lang="ts">
import type { Map } from "maplibre-gl";
import maplibregl from "maplibre-gl";
import maplibregl, { type Map as MapLibreMap } from "maplibre-gl";
import { type Ref, defineComponent, onMounted, ref } from "vue";
export default defineComponent({
name: "MapComponent",
setup() {
const map: Ref<Map | null> = ref(null);
const map: Ref<MapLibreMap | null> = ref(null);
onMounted(() => {
const mapInstance = new maplibregl.Map({
const mapInstance: MapLibreMap = new maplibregl.Map({
container: "map",
style: "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",
center: [2.213749, 46.227638], // Center of France
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/QuestionsComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { defineComponent } from "vue";
export default defineComponent({
name: "QuestionsComponent",
name: "QuestionsComponent",
});
</script>

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/TableauComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { defineComponent } from "vue";
export default defineComponent({
name: "TableauComponent",
name: "TableauComponent",
});
</script>

Expand Down
56 changes: 28 additions & 28 deletions frontend/src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import { createRouter, createWebHistory } from 'vue-router'
import MapView from '../views/MapView.vue'
import TableauView from '../views/TableauView.vue'
import QuestionsView from '../views/QuestionsView.vue'
import { createRouter, createWebHistory } from "vue-router";
import MapView from "../views/MapView.vue";
import QuestionsView from "../views/QuestionsView.vue";
import TableauView from "../views/TableauView.vue";

const router = createRouter({
history: createWebHistory('/terrains-connus/'),
routes: [
{
path: '/',
redirect: '/carte'
},
{
path: '/carte',
name: 'carte',
component: MapView
},
{
path: '/tableau',
name: 'tableau',
component: TableauView
},
{
path: '/questions',
name: 'questions',
component: QuestionsView
}
]
})
history: createWebHistory("/terrains-connus/"),
routes: [
{
path: "/",
redirect: "/carte",
},
{
path: "/carte",
name: "carte",
component: MapView,
},
{
path: "/tableau",
name: "tableau",
component: TableauView,
},
{
path: "/questions",
name: "questions",
component: QuestionsView,
},
],
});

export default router
export default router;
2 changes: 1 addition & 1 deletion frontend/src/services/api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AggregatedLandMutation } from "../types/models";
import { fromCsv } from "../types";
import type { AggregatedLandMutation } from "../types/models";

export const api = {
async getAggregatedLandMutations(): Promise<AggregatedLandMutation[]> {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/types/interfaces/LandMutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { DepartementCode } from "../enums/FrenchDepartement";
import type { NatureCulture } from "../enums/NatureCulture";

export interface AggregatedLandMutation {
departementCode: DepartementCode;
departementCode: DepartementCode;
month: Date;
natureCulture: NatureCulture;
nbMutations: number;
Expand Down
18 changes: 9 additions & 9 deletions frontend/src/views/MapView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import MapComponent from '../components/MapComponent.vue'
import SidebarComponent from '../components/SidebarComponent.vue'
import { defineComponent } from "vue";
import MapComponent from "../components/MapComponent.vue";
import SidebarComponent from "../components/SidebarComponent.vue";
export default defineComponent({
name: 'MapView',
components: {
MapComponent,
SidebarComponent
}
})
name: "MapView",
components: {
MapComponent,
SidebarComponent,
},
});
</script>
14 changes: 7 additions & 7 deletions frontend/src/views/QuestionsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import QuestionsComponent from '../components/QuestionsComponent.vue'
import { defineComponent } from "vue";
import QuestionsComponent from "../components/QuestionsComponent.vue";
export default defineComponent({
name: 'QuestionsView',
components: {
QuestionsComponent
}
})
name: "QuestionsView",
components: {
QuestionsComponent,
},
});
</script>
14 changes: 7 additions & 7 deletions frontend/src/views/TableauView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import TableauComponent from '../components/TableauComponent.vue'
import { defineComponent } from "vue";
import TableauComponent from "../components/TableauComponent.vue";
export default defineComponent({
name: 'TableauView',
components: {
TableauComponent
}
})
name: "TableauView",
components: {
TableauComponent,
},
});
</script>
7 changes: 7 additions & 0 deletions frontend/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import { URL, fileURLToPath } from "node:url";

import vue from "@vitejs/plugin-vue";
import autoprefixer from 'autoprefixer'
import tailwind from 'tailwindcss'
import { defineConfig } from "vite";
import vueDevTools from "vite-plugin-vue-devtools";

// https://vite.dev/config/
export default defineConfig({
css: {
postcss: {
plugins: [tailwind(), autoprefixer()],
},
},
plugins: [vue(), vueDevTools()],
resolve: {
alias: {
Expand Down

0 comments on commit 839e1f0

Please sign in to comment.