/** * @author tyankatsu * See LICENSE file in root directory for full license. */ 'use strict' const { isVElement } = require('../utils') /** * check whether has attribute `src` * @param {VElement} componentBlock */ function hasAttributeSrc(componentBlock) { const hasAttribute = componentBlock.startTag.attributes.length > 0 const hasSrc = componentBlock.startTag.attributes.some( (attribute) => !attribute.directive && attribute.key.name === 'src' && attribute.value && attribute.value.value !== '' ) return hasAttribute && hasSrc } /** * check whether value under the component block is only whitespaces or break lines * @param {VElement} componentBlock */ function isValueOnlyWhiteSpacesOrLineBreaks(componentBlock) { return ( componentBlock.children.length === 1 && componentBlock.children[0].type === 'VText' && !componentBlock.children[0].value.trim() ) } module.exports = { meta: { type: 'suggestion', docs: { description: 'disallow the `