Skip to content

Commit 0a973f4

Browse files
authored
update prettier and apply formatting (#298)
update prettier and apply new format and lining command Co-authored-by: Peter Wolanin <107691+pwolanin@users.noreply.github.com>
1 parent 89db55b commit 0a973f4

34 files changed

Lines changed: 1050 additions & 960 deletions

.github/workflows/node.js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
node-version: ${{ matrix.node-version }}
2828
cache: 'npm'
2929
- run: npm ci
30-
# - run: npm run lint
30+
- run: npm run format:check
3131
- run: npm run build
3232
- run: npm run cy:run
3333
- name: Cypress e2e run

babel.config.js

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
module.exports = {
2-
"presets": [
3-
["@babel/preset-env", {
4-
"useBuiltIns": "entry",
5-
"targets": {
6-
"node": "current"
7-
}
8-
}]
2+
presets: [
3+
[
4+
"@babel/preset-env",
5+
{
6+
useBuiltIns: "entry",
7+
targets: {
8+
node: "current",
9+
},
10+
},
11+
],
912
],
10-
"plugins": [
11-
'@babel/plugin-transform-modules-commonjs',
12-
"transform-object-rest-spread"
13-
]
14-
}
13+
plugins: [
14+
"@babel/plugin-transform-modules-commonjs",
15+
"transform-object-rest-spread",
16+
],
17+
};

cypress.config.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
const { defineConfig } = require('cypress');
2-
const { startDevServer } = require('@cypress/vite-dev-server');
1+
const { defineConfig } = require("cypress");
2+
const { startDevServer } = require("@cypress/vite-dev-server");
33

4-
module.exports=defineConfig({
4+
module.exports = defineConfig({
55
component: {
6-
specPattern: '**/*.cy.{js,jsx,ts,tsx}',
6+
specPattern: "**/*.cy.{js,jsx,ts,tsx}",
77
devServer: {
8-
framework: 'vue',
9-
bundler: 'vite',
8+
framework: "vue",
9+
bundler: "vite",
1010
},
1111
},
1212
e2e: {
13-
baseUrl: 'http://localhost:8080', // Default Vite dev server port
14-
supportFile: 'cypress/support/e2e.js',
15-
specPattern: 'cypress/e2e/**/*.cy.js',
13+
baseUrl: "http://localhost:8080", // Default Vite dev server port
14+
supportFile: "cypress/support/e2e.js",
15+
specPattern: "cypress/e2e/**/*.cy.js",
1616
viewportWidth: 1280,
1717
viewportHeight: 720,
1818
defaultCommandTimeout: 3000,
@@ -22,11 +22,11 @@ module.exports=defineConfig({
2222
openMode: 0,
2323
},
2424
setupNodeEvents(on, config) {
25-
on('dev-server:start', (options) => {
25+
on("dev-server:start", (options) => {
2626
return startDevServer({
2727
options,
2828
viteConfig: {
29-
configFile: 'vite.config.js', // Path to your Vite config file
29+
configFile: "vite.config.js", // Path to your Vite config file
3030
},
3131
});
3232
});
@@ -35,4 +35,3 @@ module.exports=defineConfig({
3535
},
3636
},
3737
});
38-

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
"build": "vite build",
1111
"test": "jest --testPathIgnorePatterns ./e2e",
1212
"lint": "standard --plugin html 'src/**/*.{js,vue}'",
13+
"format:check": "prettier --check src ./*.js",
14+
"format": "prettier --write src ./*.js",
1315
"serve-http": "vite preview --port 8080",
1416
"cy:open": "cypress open",
1517
"cy:run": "cypress run --component",
@@ -57,7 +59,7 @@
5759
"imports-loader": "^4.0.1",
5860
"node-sass": "^9.0.0",
5961
"postcss-loader": "^7.3.3",
60-
"prettier": "3.1.0",
62+
"prettier": "^3.5.3",
6163
"sass": "^1.70.0",
6264
"sass-loader": "^13.3.2",
6365
"standard": "^17.1.0",

postcss.config.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
module.exports = {
2-
plugins: [
3-
require('autoprefixer')
4-
]
5-
}
2+
plugins: [require("autoprefixer")],
3+
};

src/App.vue

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,49 @@
33
<nav-bar></nav-bar>
44
<div class="notifications">
55
<notification
6-
v-for="item in notifications"
7-
:key="item.id"
8-
:msg="item.msg"
9-
@dismiss="removeNotification(item.id)"></notification>
6+
v-for="item in notifications"
7+
:key="item.id"
8+
:msg="item.msg"
9+
@dismiss="removeNotification(item.id)"
10+
></notification>
1011
</div>
1112
<router-view></router-view>
1213
<site-footer v-if="shouldShowFooter"></site-footer>
1314
</div>
1415
</template>
1516

1617
<script>
17-
import { mapState, mapMutations } from 'vuex'
18-
import values from 'lodash/values'
19-
20-
import NavBar from './components/nav-bar.vue'
21-
import Notification from './components/notification.vue'
22-
import SiteFooter from './components/site-footer.vue'
18+
import { mapState, mapMutations } from "vuex";
19+
import values from "lodash/values";
2320
21+
import NavBar from "./components/nav-bar.vue";
22+
import Notification from "./components/notification.vue";
23+
import SiteFooter from "./components/site-footer.vue";
2424
2525
export default {
2626
computed: {
2727
...mapState({
2828
notifications: (state) => values(state.notifications),
29-
pendingRequests: (state) => Object.keys(state.pendingRequests || [])
29+
pendingRequests: (state) => Object.keys(state.pendingRequests || []),
3030
}),
31-
isLoading () {
32-
const routeName = this.$route && this.$route.name
33-
return (this.pendingRequests.length > 0) && (routeName !== 'splash')
31+
isLoading() {
32+
const routeName = this.$route && this.$route.name;
33+
return this.pendingRequests.length > 0 && routeName !== "splash";
34+
},
35+
shouldShowFooter() {
36+
const routeName = this.$route && this.$route.name;
37+
return routeName !== "city-map";
3438
},
35-
shouldShowFooter () {
36-
const routeName = this.$route && this.$route.name
37-
return routeName !== 'city-map'
38-
}
3939
},
4040
methods: mapMutations({
41-
removeNotification: 'REMOVE_NOTIFICATION'
41+
removeNotification: "REMOVE_NOTIFICATION",
4242
}),
4343
components: {
44-
'nav-bar': NavBar,
45-
'notification': Notification,
46-
'site-footer': SiteFooter
47-
}
48-
}
44+
"nav-bar": NavBar,
45+
notification: Notification,
46+
"site-footer": SiteFooter,
47+
},
48+
};
4949
</script>
5050

5151
<style lang="sass">

0 commit comments

Comments
 (0)