vue.js - Nuxt 中的 Stylelint 错误(基于类): Unexpected empty source (no-empty-source)

标签 vue.js nuxt.js eslint stylelint

我的两个组件突然出现这个 Stylelint 错误,我不知道为什么。

Unexpected empty source (no-empty-source)

我创建了第三个组件并将内容删除到没有内容留下的地步,但该组件的错误仍然显示。 那么问题是什么? 我试图理解 this 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

最佳答案

问题的发生是因为有一个空的 style 标签,删除它可以解决问题。

关于vue.js - Nuxt 中的 Stylelint 错误(基于类): Unexpected empty source (no-empty-source),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71591902/

相关文章:

vue.js - 如何在 vue.js 2 的其他组件中调用方法?

vue.js - 如何跨多个子 Vue 组件捕获事件

nuxt.js - Nuxt js - 未定义窗口或文档

javascript - 错误 : No ESLint configuration found

eslint - 为什么会在这里找到 require-atomic-updates ?

javascript - Vue v-model 不会触发第三方下拉菜单

javascript - 观看未按预期工作

javascript - 如何使用 Promise.all 使用 Axios Async Await

javascript - 我如何在两个 nuxt 页面之间转换,同时首先等待子组件转换/动画完成?

javascript - 为什么在每种情况下我都应该从 .then() 返回?