Skip to content

Commit afec265

Browse files
authored
Fix false positives for non-vue file in vue/multi-word-component-names rule (#1684)
1 parent 0437972 commit afec265

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/lib/rules/multi-word-component-names.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,35 @@ tester.run('multi-word-component-names', rule, {
169169
}
170170
</script>
171171
`
172+
},
173+
{
174+
filename: 'test.js',
175+
code: `
176+
new Vue({})
177+
`
178+
},
179+
{
180+
// https://github.com/vuejs/eslint-plugin-vue/issues/1670
181+
filename: 'main.ts',
182+
code: `
183+
import Vue from 'vue'
184+
import VueCompositionAPI, { h } from '@vue/composition-api'
185+
import i18n from '@/i18n'
186+
import router from '@/router'
187+
import store from '@/store'
188+
// ...
189+
190+
Vue.use(VueCompositionAPI)
191+
192+
new Vue({
193+
i18n,
194+
router,
195+
store,
196+
setup() {
197+
return () => h(App)
198+
},
199+
}).$mount('#app')
200+
`
172201
}
173202
],
174203
invalid: [

0 commit comments

Comments
 (0)