Search code examples
vue.jsnuxt.jseslintstylelint

Stylelint error in Nuxt (class based): 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

Solution

  • The issue was happening because there was an empty style tag, removing it fixed the issue.