Why am I receiving a warning error message:
defineProps
is referencing locally declared variables. eslint(vue/valid-define-props)
whenever I utilize a custom validator in props within an SFC <script setup>
mode:
<script setup>
import { validateMarkers } from "./hooks"
import { defineProps } from 'vue'
const props = defineProps({
markers: {
type: [Array, Object],
validator: validateMarkers
}
})
</script>
This is my custom validator:
export const validateMarkers = (markers) =>
isNotEmpty(markers)
? isObject(markers)
? markerValidator(markers)
: isNotEmptyArray(markers)
? markers.every((marker) => markerValidator(marker))
: error('Undefined type of prop marker')
: null
What steps can I take to resolve this warning?