Skip to content

Commit 60518ef

Browse files
committed
fix: fixed types and lint errors
- generic types still have some problems
1 parent c1f6988 commit 60518ef

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,18 @@
5151
"build": "vite build",
5252
"build:dev": "vite build --mode development",
5353
"build:watch": "vite build --watch --mode production",
54-
"build:types": "vue-tsc -p tsconfig.types.json",
54+
"build:types": "vue-tsc --emitDeclarationOnly -p tsconfig.types.json",
5555
"build:types:fix": "(echo \"Currently unused, any type of alias/baseUrl import causes issue when using as nuxt module.\" && exit 1) && tsc-alias -p tsconfig.types.json --debug",
5656
"storybook": "BROWSER=none storybook dev -p 6006",
5757
"storybook:clear-cache": "BROWSER=none storybook dev -p 6006 --no-manager-cache",
5858
"build:storybook": "storybook build -o docs/storybook",
5959
"doc": "pnpm run build:storybook",
6060
"doc:dev": "pnpm run storybook",
6161
"lint:eslint": "eslint \"{src,tests}/**/*.{js,ts,vue}\" \"*.{js,ts}\" --max-warnings=0 --report-unused-disable-directives",
62-
"lint:types": "vue-tsc --noEmit --pretty",
62+
"lint:types": "vue-tsc --noEmit --pretty --project tsconfig.types.json",
6363
"lint:commits": "commitlint --from $(git rev-list HEAD --not --remotes | tail -1)^ --to HEAD --verbose",
6464
"lint:imports": "madge --circular --extensions ts ./src",
65-
"lint": "echo temporarily disabled npm run lint:types && npm run lint:eslint && npm run lint:imports",
65+
"lint": "npm run lint:types && npm run lint:eslint && npm run lint:imports",
6666
"prepare": "husky install && npm run build",
6767
"actions:debug": "act -r -v -j build",
6868
"gen:exports": "indexit update --ignore **.d.ts **.stories.ts **.vue -o '${path}.js'"

src/components/LibColorInput/LibColorInput.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ import { extractRootEl as vExtractRootEl } from "../../directives/extractRootEl.
5959
import LibButton from "../LibButton/LibButton.vue"
6060
import LibColorPicker from "../LibColorPicker/LibColorPicker.vue"
6161
import LibPopup from "../LibPopup/LibPopup.vue"
62-
import { linkableByIdProps } from "../shared/props"
62+
import { linkableByIdProps } from "../shared/props.js"
6363
6464
6565
type HsvaColor = { h: number, s: number, v: number, a?: number }

src/components/LibInput/LibInput.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121

122122
<slot v-if="suggestions" name="suggestions" v-bind="suggestionProps">
123123
<!-- todo 1px needs to be abstracted to var -->
124-
<!-- @vue-expected-error -->
124+
<!-- @vue-expect-error -->
125125
<lib-suggestions
126126
class="
127127
border-accent-500
@@ -146,7 +146,7 @@
146146
<script setup lang="ts" generic="T extends string|number">
147147
import { computed, type PropType, ref, useAttrs, useSlots, watch } from "vue"
148148
149-
import { useDivideAttrs } from "../../composables/useDivideAttrs"
149+
import { useDivideAttrs } from "../../composables/useDivideAttrs.js"
150150
import { addValue } from "../../helpers/addValue.js"
151151
import { hasModifiers } from "../../helpers/hasModifiers.js"
152152
import { twMerge } from "../../helpers/twMerge.js"

src/components/LibNotifications/LibNotifications.vue

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
`, ($attrs as any).class)"
1313
v-bind="{ ...$attrs, class: undefined }"
1414
>
15-
<lib-notification
16-
class="pointer-events-auto"
15+
<lib-notification class="pointer-events-auto"
1716
:handler="handler"
1817
tabindex="0"
1918
:notification="notification"
@@ -22,11 +21,10 @@
2221
/>
2322
</TransitionGroup>
2423
<Transition>
25-
<div v-show="topNotifications.length > 0">AAAAAAAA</div>
24+
<div v-show="topNotifications.length > 0"/>
2625
</Transition>
2726
<Transition>
28-
<dialog
29-
v-show="topNotifications.length > 0"
27+
<dialog v-show="topNotifications.length > 0"
3028
:id="id"
3129
class="modal
3230
bg-transparent
@@ -38,8 +36,7 @@
3836
@click.self.prevent="NotificationHandler.dismiss(topNotifications[0])"
3937
>
4038
<form>
41-
<lib-notification
42-
v-if="topNotifications.length > 0"
39+
<lib-notification v-if="topNotifications.length > 0"
4340
:handler="handler"
4441
class="top-notification"
4542
:notification="topNotifications[0]"
@@ -116,7 +113,7 @@ const notificationListener = (entry: NotificationEntry, type: "added" | "resolve
116113
}
117114
props.handler.addNotificationListener(notificationListener)
118115
119-
for (const entry of props.handler.queue) {addNotification(entry)}
116+
for (const entry of props.handler.queue) { addNotification(entry) }
120117
onBeforeUnmount(() => {
121118
props.handler.removeNotificationListener(notificationListener)
122119
})

src/components/LibTable/LibTable.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@
8383
</table>
8484
</template>
8585

86-
87-
<script setup lang="ts" generic="T extends Record<string, any>">
86+
<!-- generic="T extends Record<string, any> -->"
87+
<script setup lang="ts">
88+
/* awaiting better support for emitting component types with genertics */
89+
type T = any
8890
import { keys, type MakeRequired } from "@alanscodelog/utils"
8991
import { computed, type PropType, ref } from "vue"
9092

tsconfig.types.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
// https://www.typescriptlang.org/tsconfig/
22
{
3-
"extends": "./tsconfig",
3+
"extends": "./tsconfig.nodenext",
44
"compilerOptions": {
55
"outDir": "dist",
66
"rootDir": "src",
77
"declaration": true,
88
"declarationMap": true,
9-
"emitDeclarationOnly": true,
9+
// controlled by build/lint:types scripts which both need this config
10+
// "emitDeclarationOnly": true,
1011
"noEmit": false,
1112
"allowJs": false,
1213
"skipLibCheck": true, // ignore node modules

0 commit comments

Comments
 (0)