Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit 7e66a08

Browse files
committed
refactor: return void on some functions
chore: outlaw forbidden null assertion chore: lint
1 parent fe1e5c6 commit 7e66a08

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

packages/bootstrap-vue-next/.eslintrc.cjs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module.exports = defineConfig({
1616
},
1717
rules: {
1818
'@typescript-eslint/no-explicit-any': 'warn',
19+
'@typescript-eslint/no-non-null-assertion': 'error',
1920
'prettier/prettier': [
2021
'warn',
2122
{

packages/bootstrap-vue-next/src/components/BTable/BTable.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ const emit = defineEmits<{
179179
key: TableFieldObject['key'],
180180
field: TableField,
181181
event: MouseEvent,
182-
isFooter: boolean
182+
isFooter: boolean,
183183
]
184184
'row-clicked': [item: TableItem, index: number, event: MouseEvent]
185185
'row-dbl-clicked': [item: TableItem, index: number, event: MouseEvent]

packages/bootstrap-vue-next/src/composables/useModalManager.ts

+9-5
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,19 @@ const MODAL_OPEN_CLASS_NAME = 'modal-open'
1212

1313
export const useSharedModalStack = createSharedComposable(() => {
1414
const registry: Ref<ComponentInternalInstance[]> = ref([])
15-
const stack: Ref<ComponentInternalInstance[]> = ref([])
15+
const stack: Ref<ComponentInternalInstance[]> = ref([])
1616
const count = computed(() => stack.value.length)
1717
const last = computed(() => stack.value[stack.value.length - 1])
18-
const push = (modal: ComponentInternalInstance) => stack.value.push(modal)
19-
const pop = () => stack.value.pop()
18+
const push = (modal: ComponentInternalInstance) => {
19+
stack.value.push(modal)
20+
}
21+
const pop = () => {
22+
stack.value.pop()
23+
}
2024
const remove = (modal: ComponentInternalInstance): void => {
2125
stack.value = stack.value.filter((item) => item.uid !== modal.uid)
2226
}
23-
const find = (id: string) => registry.value.find((modal) => modal.exposed!.id === id) || null
27+
const find = (id: string) => registry.value.find((modal) => modal.exposed?.id === id) || null
2428

2529
const updateHTMLAttrs = getSSRHandler('updateHTMLAttrs', (selector, attribute, value) => {
2630
const el =
@@ -48,7 +52,7 @@ export const useSharedModalStack = createSharedComposable(() => {
4852
})
4953

5054
export default (modalOpen: Ref<boolean>): void => {
51-
const {registry, push, remove, stack} = useSharedModalStack()
55+
const {registry, push, remove} = useSharedModalStack()
5256

5357
const currentModal = getCurrentInstance()
5458

0 commit comments

Comments
 (0)