Skip to content

Commit

Permalink
Merge pull request #472 from twin-te/enable-format-typefix
Browse files Browse the repository at this point in the history
formatがチェックされるようにする
  • Loading branch information
HikaruEgashira authored Mar 20, 2022
2 parents dc85dc6 + 4bc69fc commit cbb9f9a
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ jobs:
env:
CI: true

- name: format
run: yarn format
env:
CI: true

- name: lint
run: yarn lint
env:
Expand Down
6 changes: 5 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "johnsoncodehk.volar"]
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"johnsoncodehk.volar"
]
}
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.validate": ["typescript", "vue"]
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"typecheck": "vue-tsc --noEmit",
"build": "yarn typecheck && vite build",
"build:staging": "vite build --mode staging",
"format": "prettier ./src --check",
"format:fix": "prettier ./src --write",
"lint": "eslint --ext .ts,.tsx,.vue ./src",
"lint:fix": "yarn lint --fix",
"test": "jest",
Expand Down
4 changes: 2 additions & 2 deletions src/components/PopupContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export default defineComponent({
},
gtmMarker: {
type: String,
default: ""
}
default: "",
},
},
emits: ["click"],
});
Expand Down
16 changes: 9 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import VueClickAway from "vue3-click-away";
import { createHead } from "@vueuse/head";
import * as Sentry from "@sentry/browser";
import { Integrations } from "@sentry/tracing";
import { createGtm } from "@gtm-support/vue-gtm"
import { createGtm } from "@gtm-support/vue-gtm";

import App from "./App.vue";
import { router } from "./route";
Expand All @@ -29,12 +29,14 @@ app
.use(store, StateKey)
.use(VueClickAway)
.use(head)
.use(createGtm({
id: "GTM-PHSLD8B",
vueRouter: router,
enabled: import.meta.env.PROD,
debug: import.meta.env.DEV,
}))
.use(
createGtm({
id: "GTM-PHSLD8B",
vueRouter: router,
enabled: import.meta.env.PROD,
debug: import.meta.env.DEV,
})
)
.mount("#app");

window.addEventListener("error", (event) => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/add/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export default defineComponent({
event: "search-courses",
term: searchWord.value,
use_only_blank: onlyBlank.value,
schedules: schedules.value
schedules: schedules.value,
});
}
isAccordionOpen.value = false;
Expand Down
6 changes: 4 additions & 2 deletions src/usecases/courseListToTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type OrdinarySchedule = CourseSchedule & {
period: Period;
};

const isOrdinarySchedule = (schedule: CourseSchedule) =>
const isOrdinarySchedule = (schedule: CourseSchedule) =>
isBaseModule(schedule.module) &&
isWeekDay(schedule.day) &&
1 <= schedule.period &&
Expand All @@ -54,7 +54,9 @@ export const courseListToTable = (
const schedules = course.schedules ?? course.course?.schedules ?? [];
const room = [...new Set(schedules.map((s) => s.room))].join(",");
schedules
.filter((schedule): schedule is OrdinarySchedule => isOrdinarySchedule(schedule))
.filter((schedule): schedule is OrdinarySchedule =>
isOrdinarySchedule(schedule)
)
.forEach((schedule) =>
table[schedule.module][weekdayNum(schedule.day as WeekDay)][
schedule.period - 1
Expand Down

0 comments on commit cbb9f9a

Please sign in to comment.