From 5d8003931964bf027156439cd3d2751595027717 Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 25 Jul 2021 13:23:25 +0200 Subject: [PATCH] Client - update prettier config --- fittrackee_client/.prettierrc | 13 +++++ fittrackee_client/babel.config.js | 4 +- fittrackee_client/src/App.vue | 48 +++++++++---------- .../src/components/HelloWorld.vue | 42 ++++++++-------- fittrackee_client/src/components/NavBar.vue | 8 ++-- fittrackee_client/src/main.ts | 12 ++--- .../src/registerServiceWorker.ts | 26 +++++----- fittrackee_client/src/router/index.ts | 20 ++++---- fittrackee_client/src/store/index.ts | 4 +- fittrackee_client/src/views/Home.vue | 16 +++---- fittrackee_client/tests/unit/example.spec.ts | 20 ++++---- 11 files changed, 113 insertions(+), 100 deletions(-) create mode 100644 fittrackee_client/.prettierrc diff --git a/fittrackee_client/.prettierrc b/fittrackee_client/.prettierrc new file mode 100644 index 00000000..6705ebc5 --- /dev/null +++ b/fittrackee_client/.prettierrc @@ -0,0 +1,13 @@ +{ + "tabWidth": 2, + "semi": false, + "singleQuote": true, + "quoteProps": "as-needed", + "trailingComma": "es5", + "bracketSpacing": true, + "jsxBracketSameLine": false, + "arrowParens": "always", + "printWidth": 80, + "endOfLine": "auto", + "vueIndentScriptAndStyle": true +} diff --git a/fittrackee_client/babel.config.js b/fittrackee_client/babel.config.js index 162a3ea9..c1b783ea 100644 --- a/fittrackee_client/babel.config.js +++ b/fittrackee_client/babel.config.js @@ -1,3 +1,3 @@ module.exports = { - presets: ["@vue/cli-plugin-babel/preset"], -}; + presets: ['@vue/cli-plugin-babel/preset'], +} diff --git a/fittrackee_client/src/App.vue b/fittrackee_client/src/App.vue index ca385d78..518bc97b 100644 --- a/fittrackee_client/src/App.vue +++ b/fittrackee_client/src/App.vue @@ -4,36 +4,36 @@ diff --git a/fittrackee_client/src/components/HelloWorld.vue b/fittrackee_client/src/components/HelloWorld.vue index 4b3d7396..0b599630 100644 --- a/fittrackee_client/src/components/HelloWorld.vue +++ b/fittrackee_client/src/components/HelloWorld.vue @@ -127,30 +127,30 @@ diff --git a/fittrackee_client/src/components/NavBar.vue b/fittrackee_client/src/components/NavBar.vue index 9870edc1..fdfa25f6 100644 --- a/fittrackee_client/src/components/NavBar.vue +++ b/fittrackee_client/src/components/NavBar.vue @@ -6,11 +6,11 @@ diff --git a/fittrackee_client/src/main.ts b/fittrackee_client/src/main.ts index 72845702..041fa11d 100644 --- a/fittrackee_client/src/main.ts +++ b/fittrackee_client/src/main.ts @@ -1,7 +1,7 @@ -import { createApp } from "vue"; -import App from "./App.vue"; -import "./registerServiceWorker"; -import router from "./router"; -import store from "./store"; +import { createApp } from 'vue' +import App from './App.vue' +import './registerServiceWorker' +import router from './router' +import store from './store' -createApp(App).use(store).use(router).mount("#app"); +createApp(App).use(store).use(router).mount('#app') diff --git a/fittrackee_client/src/registerServiceWorker.ts b/fittrackee_client/src/registerServiceWorker.ts index 1473a0af..bb130a77 100644 --- a/fittrackee_client/src/registerServiceWorker.ts +++ b/fittrackee_client/src/registerServiceWorker.ts @@ -1,34 +1,34 @@ /* eslint-disable no-console */ -import { register } from "register-service-worker"; +import { register } from 'register-service-worker' -if (process.env.NODE_ENV === "production") { +if (process.env.NODE_ENV === 'production') { register(`${process.env.BASE_URL}service-worker.js`, { ready() { console.log( - "App is being served from cache by a service worker.\n" + - "For more details, visit https://goo.gl/AFskqB" - ); + 'App is being served from cache by a service worker.\n' + + 'For more details, visit https://goo.gl/AFskqB' + ) }, registered() { - console.log("Service worker has been registered."); + console.log('Service worker has been registered.') }, cached() { - console.log("Content has been cached for offline use."); + console.log('Content has been cached for offline use.') }, updatefound() { - console.log("New content is downloading."); + console.log('New content is downloading.') }, updated() { - console.log("New content is available; please refresh."); + console.log('New content is available; please refresh.') }, offline() { console.log( - "No internet connection found. App is running in offline mode." - ); + 'No internet connection found. App is running in offline mode.' + ) }, error(error) { - console.error("Error during service worker registration:", error); + console.error('Error during service worker registration:', error) }, - }); + }) } diff --git a/fittrackee_client/src/router/index.ts b/fittrackee_client/src/router/index.ts index f752b630..7e234ad4 100644 --- a/fittrackee_client/src/router/index.ts +++ b/fittrackee_client/src/router/index.ts @@ -1,26 +1,26 @@ -import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router"; -import Home from "../views/Home.vue"; +import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router' +import Home from '../views/Home.vue' const routes: Array = [ { - path: "/", - name: "Home", + path: '/', + name: 'Home', component: Home, }, { - path: "/about", - name: "About", + path: '/about', + name: 'About', // route level code-splitting // this generates a separate chunk (about.[hash].js) for this route // which is lazy-loaded when the route is visited. component: () => - import(/* webpackChunkName: "about" */ "../views/About.vue"), + import(/* webpackChunkName: "about" */ '../views/About.vue'), }, -]; +] const router = createRouter({ history: createWebHistory(process.env.BASE_URL), routes, -}); +}) -export default router; +export default router diff --git a/fittrackee_client/src/store/index.ts b/fittrackee_client/src/store/index.ts index 9e1c7d3f..7d3d8eaf 100644 --- a/fittrackee_client/src/store/index.ts +++ b/fittrackee_client/src/store/index.ts @@ -1,8 +1,8 @@ -import { createStore } from "vuex"; +import { createStore } from 'vuex' export default createStore({ state: {}, mutations: {}, actions: {}, modules: {}, -}); +}) diff --git a/fittrackee_client/src/views/Home.vue b/fittrackee_client/src/views/Home.vue index 60d05c01..898a7002 100644 --- a/fittrackee_client/src/views/Home.vue +++ b/fittrackee_client/src/views/Home.vue @@ -6,13 +6,13 @@ diff --git a/fittrackee_client/tests/unit/example.spec.ts b/fittrackee_client/tests/unit/example.spec.ts index e459ed2a..55bbbab4 100644 --- a/fittrackee_client/tests/unit/example.spec.ts +++ b/fittrackee_client/tests/unit/example.spec.ts @@ -1,13 +1,13 @@ -import { expect } from "chai"; -import { shallowMount } from "@vue/test-utils"; -import HelloWorld from "@/components/HelloWorld.vue"; +import { expect } from 'chai' +import { shallowMount } from '@vue/test-utils' +import HelloWorld from '@/components/HelloWorld.vue' -describe("HelloWorld.vue", () => { - it("renders props.msg when passed", () => { - const msg = "new message"; +describe('HelloWorld.vue', () => { + it('renders props.msg when passed', () => { + const msg = 'new message' const wrapper = shallowMount(HelloWorld, { props: { msg }, - }); - expect(wrapper.text()).to.include(msg); - }); -}); + }) + expect(wrapper.text()).to.include(msg) + }) +})