Nuxt 中的 Stylelint 错误(基于类):意外的空源(无空源)
我的两个组件突然出现 Stylelint 错误,我不知道为什么。
Unexpected empty source (no-empty-source)
我创建了第三个组件,并将内容删除到没有剩余内容的程度,并且该组件仍然显示错误。 那么问题可能是什么? 我试图理解 这个 eslint 文档页面 ,但我不太明白其中的内容,它没有解释什么是“来源”。
这是简化的组件(项目中未使用):
<template>
<p>ok</p>
</template>
<script lang="ts">
import { Component, Vue } from 'nuxt-property-decorator';
@Component
export default class NewComponent extends Vue {}
</script>
<style lang="postcss" scoped></style>
我得到:
components/common/NewComponent.vue
12:31 × Unexpected empty source no-empty-source
I get this Stylelint error suddenly in two of my components, I don't know why.
Unexpected empty source (no-empty-source)
I created a third component and removed content to the point where there is no content left, and the error still shows for that component too.
So what can the issue be?
I tried to understand this eslint documentation page , but I don't understand much of it, it does not explain what a "source" is.
Here is the simplified component (which is not used in the project):
<template>
<p>ok</p>
</template>
<script lang="ts">
import { Component, Vue } from 'nuxt-property-decorator';
@Component
export default class NewComponent extends Vue {}
</script>
<style lang="postcss" scoped></style>
I get:
components/common/NewComponent.vue
12:31 × Unexpected empty source no-empty-source
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
发生该问题的原因是存在一个空的
style
标记,删除它可以解决该问题。The issue was happening because there was an empty
style
tag, removing it fixed the issue.