no-unused-vars in template pug
Eyrum opened this issue · 2 comments
Eyrum commented
Before You File a Bug Report Please Confirm You Have Done The Following...
- I'm using eslint-plugin-vue.
- I'm sure the problem is a parser problem. (If you are not sure, search for the issue in eslint-plugin-vue repo and open the issue in eslint-plugin-vue repo if there is no solution.
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
What version of ESLint are you using?
9.21.0
What version of eslint-plugin-vue and vue-eslint-parser are you using?
- vue-eslint-parser@latest
- eslint-plugin-vue@latest
What did you do?
no-unused-vars in template pug
import js from "@eslint/js";
import vueParser from 'vue-eslint-parser'
import babelParser from '@babel/eslint-parser'
import pluginVue from 'eslint-plugin-vue'
export default [
js.configs.recommended,
{
languageOptions: {
parser: vueParser,
parserOptions: {
parser: babelParser,
},
}
},
...pluginVue.configs['flat/essential'],
{
rules: {
quotes: ["error", "double"],
},
},
];
<script setup>
import HelloWorld from "./HelloWorld.vue"
// 'HelloWorld' is defined but never used.
</script>
<template lang="pug">
HelloWorld
</template>
What did you expect to happen?
HelloWorld is used in template which should be a used var. No errors will be present.
What actually happened?
'HelloWorld' is defined but never used.
(no-unused-vars)
Link to Minimal Reproducible Example
Additional comments
ota-meshi commented
eslint-plugin-vue and vue-eslint-parser projects do not officially support pug templates.
Using eslint-plugin-vue-pug may solve the problem, but I'm not sure.
Thanks for your understanding.