@@ -26,8 +26,6 @@ const { getScope } = require('./scope')
2626 * @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentInferTypeEmit } ComponentInferTypeEmit
2727 * @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentUnknownEmit } ComponentUnknownEmit
2828 * @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentEmit } ComponentEmit
29- * @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentArraySlot } ComponentArraySlot
30- * @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentObjectSlot } ComponentObjectSlot
3129 * @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentTypeSlot } ComponentTypeSlot
3230 * @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentInferTypeSlot } ComponentInferTypeSlot
3331 * @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentUnknownSlot } ComponentUnknownSlot
@@ -3387,19 +3385,6 @@ function getComponentEmitsFromDefineEmits(context, node) {
33873385 * @return {ComponentSlot[] } Array of component slots
33883386 */
33893387function getComponentSlotsFromDefineSlots ( context , node ) {
3390- if ( node . arguments . length > 0 ) {
3391- const defNode = getObjectOrArray ( context , node . arguments [ 0 ] )
3392- if ( defNode ) {
3393- return getComponentSlotsFromDefine ( defNode )
3394- }
3395- return [
3396- {
3397- type : 'unknown' ,
3398- slotName : null ,
3399- node : node . arguments [ 0 ]
3400- }
3401- ]
3402- }
34033388 const typeArguments =
34043389 'typeArguments' in node ? node . typeArguments : node . typeParameters
34053390 if ( typeArguments && typeArguments . params . length > 0 ) {
@@ -3578,67 +3563,6 @@ function getComponentEmitsFromDefine(emitsNode) {
35783563 } )
35793564}
35803565
3581- /**
3582- * Get all slots by looking at all component's properties
3583- * @param {ObjectExpression|ArrayExpression } slotsNode Object with slots definition
3584- * @return {(ComponentArraySlot | ComponentObjectSlot | ComponentUnknownSlot)[] } Array of component slots
3585- */
3586- function getComponentSlotsFromDefine ( slotsNode ) {
3587- if ( slotsNode . type === 'ObjectExpression' ) {
3588- return slotsNode . properties . map (
3589- /** @returns {ComponentArraySlot | ComponentObjectSlot | ComponentUnknownSlot } */
3590- ( slot ) => {
3591- if ( ! isProperty ( slot ) ) {
3592- return {
3593- type : 'unknown' ,
3594- slotName : null ,
3595- node : slot
3596- }
3597- }
3598- const slotName = getStaticPropertyName ( slot )
3599- if ( slotName != null ) {
3600- return {
3601- type : 'object' ,
3602- key : slot . key ,
3603- slotName,
3604- value : skipTSAsExpression ( slot . value ) ,
3605- node : slot
3606- }
3607- }
3608- return {
3609- type : 'object' ,
3610- key : null ,
3611- slotName : null ,
3612- value : skipTSAsExpression ( slot . value ) ,
3613- node : slot
3614- }
3615- }
3616- )
3617- }
3618-
3619- return slotsNode . elements . filter ( isDef ) . map ( ( slot ) => {
3620- if ( slot . type === 'Literal' || slot . type === 'TemplateLiteral' ) {
3621- const slotName = getStringLiteralValue ( slot )
3622- if ( slotName != null ) {
3623- return {
3624- type : 'array' ,
3625- key : slot ,
3626- slotName,
3627- value : null ,
3628- node : slot
3629- }
3630- }
3631- }
3632- return {
3633- type : 'array' ,
3634- key : null ,
3635- slotName : null ,
3636- value : null ,
3637- node : slot
3638- }
3639- } )
3640- }
3641-
36423566/**
36433567 * @param {RuleContext } context The rule context object.
36443568 * @param {ESNode } node
0 commit comments