Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cc35c58

Browse files
Fix regression on no-unused-components rule (#1909)
1 parent a8ab4fd commit cc35c58

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

‎lib/rules/no-unused-components.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,13 @@ module.exports = {
120120
name === casing.camelCase(n))
121121
)
122122
) {
123-
return
123+
continue
124124
}
125125
} else {
126126
// In any other case the used component name must exactly match
127127
// the registered name
128128
if (usedComponents.has(name)) {
129-
return
129+
continue
130130
}
131131
}
132132

‎tests/lib/rules/no-unused-components.js‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,36 @@ tester.run('no-unused-components', rule, {
695695
line: 13
696696
}
697697
]
698+
},
699+
700+
// Many components and one in middle is no present
701+
{
702+
filename: 'test.vue',
703+
code: `
704+
<template>
705+
<div>
706+
<Foo />
707+
<fio.fio />
708+
<baz />
709+
</div>
710+
</template>
711+
<script>
712+
export default {
713+
components: {
714+
Foo,
715+
'fio.fio': FioFio,
716+
Bar,
717+
Baz
718+
},
719+
}
720+
</script>
721+
`,
722+
errors: [
723+
{
724+
message: 'The "Bar" component has been registered but not used.',
725+
line: 14
726+
}
727+
]
698728
}
699729
]
700730
})

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /