Skip to content

Commit

Permalink
fix: resolve typescript warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mrholek committed Nov 3, 2023
1 parent f930785 commit 50b1767
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
12 changes: 7 additions & 5 deletions packages/coreui-vue/src/components/dropdown/utils.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import type { Placement } from '@popperjs/core'
import type { Placements } from '../../types'
import type { Alignments } from './types'
import type { Alignments, Breakpoints } from './types'

export const getAlignmentClassNames = (alignment: object | string) => {
export const getAlignmentClassNames = (alignment: Alignments) => {
const classNames: string[] = []
if (typeof alignment === 'object') {
Object.keys(alignment).map((key) => {
classNames.push(`dropdown-menu${key === 'xs' ? '' : `-${key}`}-${alignment[key]}`)
})
for (const key in alignment) {
classNames.push(
`dropdown-menu${key === 'xs' ? '' : `-${key}`}-${alignment[key as keyof Breakpoints]}`,
)
}
}

if (typeof alignment === 'string') {
Expand Down
8 changes: 6 additions & 2 deletions packages/coreui-vue/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { App } from 'vue'
import * as Components from './components'
import * as Directives from './directives'

const CoreuiVue = {
install: (app: App): void => {
for (const key in Components) {
app.component(key, Components[key])
app.component(key, (Components as { [key: string]: any })[key])
}

for (const key in Directives) {
app.directive(Directives[key]['name'], Directives[key])
app.directive(
(Directives as { [key: string]: any })[key]['name'],
(Directives as { [key: string]: any })[key],
)
}
},
}
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"esModuleInterop": true,
Expand Down

0 comments on commit 50b1767

Please sign in to comment.