Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr committed Sep 22, 2024
1 parent ae16656 commit 418c684
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 15 deletions.
2 changes: 0 additions & 2 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ declare module 'vue' {
export interface GlobalComponents {
Compile: typeof import('./src/components/Compile.vue')['default']
ConfigOptions: typeof import('./src/components/ConfigOptions.vue')['default']
copy: typeof import('./src/components/ConfigOptions copy.vue')['default']
Editor: typeof import('./src/components/Editor.vue')['default']
Features: typeof import('./src/components/Features.vue')['default']
HelloWorld: typeof import('./src/components/HelloWorld.vue')['default']
SideBar: typeof import('./src/components/SideBar.vue')['default']
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"devDependencies": {
"@babel/types": "^7.24.7",
"@fortawesome/fontawesome-free": "^6.6.0",
"@types/file-saver": "^2.0.7",
"@types/node": "^20.14.10",
"@vitejs/plugin-vue": "^5.0.5",
"sass": "1.77.6",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Compile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const { keymap } = useKeymapState()
const dialog = ref(false);
const jobID = ref('')
const { pause, resume, isActive } = useIntervalFn(async () => {
const { pause, resume } = useIntervalFn(async () => {
const { data } = await useFetch(`https://api.qmk.fm/v1/compile/${jobID.value}`).get().json()
console.log(data.value);
Expand Down
8 changes: 4 additions & 4 deletions src/components/ConfigOptions.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<v-switch label="Split USB Detect" v-model="usbdetect"/>
<v-switch label="Split Watchdog" v-model="watchdog"/>
<v-switch :hide-details="true" label="Split USB Detect" v-model="usbdetect"/>
<v-switch :hide-details="true" label="Split Watchdog" v-model="watchdog"/>
<v-select clearable label="Converter" :items="converters" v-model="converter"></v-select>
</template>

Expand Down Expand Up @@ -40,7 +40,7 @@ const usbdetect = computed({
keymap.value.config.split.usb_detect.enabled = true;
} else {
// TODO: delete actual value and clean up empty parents
delete keymap.value.config.split.usb_detect
delete keymap.value?.config?.split?.usb_detect
}
}
})
Expand All @@ -57,7 +57,7 @@ const watchdog = computed({
keymap.value.config.split.transport.watchdog = true;
} else {
// TODO: delete actual value and clean up empty parents
delete keymap.value.config.split.transport
delete keymap.value?.config?.split?.transport
}
}
})
Expand Down
8 changes: 4 additions & 4 deletions src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const code = computed({
},
set(km_str) {
try {
km = JSON.parse(km);
const km = JSON.parse(km_str);
keymap.value = km
} catch (error) {
// log?
Expand All @@ -50,10 +50,10 @@ const code = computed({
})
const editor = shallowRef()
const handleMount = (editorInstance) => {
const handleMount = (editorInstance: any) => {
editor.value = editorInstance;
const { isPending, start, stop } = useTimeoutFn(() => {
useTimeoutFn(() => {
formatCode();
}, 200)
}
Expand All @@ -69,7 +69,7 @@ const handleChange= () => {
// ??
}
const handleError= (markers) => {
const handleError= (markers: any[]) => {
console.log(markers)
error.value = markers.length ? "Errors detected..." : '';
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/Features.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<v-switch hide-details="true" label="Extra" v-model="extrakey"/>
<v-switch hide-details="true" label="Mouse" v-model="mousekey"/>
<v-switch hide-details="true" label="VIA" v-model="via"/>
<v-switch :hide-details="true" label="Extra" v-model="extrakey"/>
<v-switch :hide-details="true" label="Mouse" v-model="mousekey"/>
<v-switch :hide-details="true" label="VIA" v-model="via"/>
</template>

<script lang="ts" setup>
Expand Down
12 changes: 11 additions & 1 deletion src/composables/useKeymapState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,17 @@ export type Keymap = {

layers:string[][],

config?: Object,
config?: {
features?: Record<string, boolean>
split?: {
usb_detect?: {
enabled?: boolean
},
transport?: {
watchdog?: boolean
},
},
},

converter?: string,

Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50"
integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==

"@types/file-saver@^2.0.7":
version "2.0.7"
resolved "https://registry.yarnpkg.com/@types/file-saver/-/file-saver-2.0.7.tgz#8dbb2f24bdc7486c54aa854eb414940bbd056f7d"
integrity sha512-dNKVfHd/jk0SkR/exKGj2ggkB45MAkzvWCaqLUUgkyjITkGNzH8H+yUwr+BLJUBjZOe9w8X3wgmXhZDRg1ED6A==

"@types/node@^20.14.10":
version "20.16.5"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.16.5.tgz#d43c7f973b32ffdf9aa7bd4f80e1072310fd7a53"
Expand Down

0 comments on commit 418c684

Please sign in to comment.