Skip to content

no-unused-vars in template pug #248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks done
Eyrum opened this issue Feb 26, 2025 · 2 comments
Closed
4 tasks done

no-unused-vars in template pug #248

Eyrum opened this issue Feb 26, 2025 · 2 comments

Comments

@Eyrum
Copy link

Eyrum commented Feb 26, 2025

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

https://eslint-online-playground.netlify.app/#eNp9VEtv1DAQ/ivGl4C067RckJaCVoIDNzggONSLlE1mFwfHNn6krar8946dZ7u7vSTxzPfNfPNwHqmzZf4NpNS/tZUVawPQDb3x0BhZeCCyUMdPnJpw5PQzV4RUon37jvyNDHIXKW+4uslHPELoiu6LPUhWanUQR1Y7rTDkYyRjIAsOvON0Q2453SZk3hvXoFpOVwjaooo8udaDq3b3nO646jB6VPwTnP+iG6MVKD+KdqUVxhPEB4NCBLqtJ3Nx5GB1g+HZi4I55SrPSTZbMyIcqeAgFFRkHzxR0IIlwUHFYrl9JsyBh8utmuOdtgicFKh86hHqH/TWbtS57UF5je36ONWDgn8U1qGcBMvwvO6Ba5Ps2QRNLXwGHhp+AW9kOAr1K8CAHmHJvMZECOUK7hMY21ME6XGMWGrthlIcs1DqpgFVQbWKrjR4kroTiiN8N15o5TajnZBexWYuLNFmzylj5iwqnFjd8NXFV39gjE21jUJvswOOA1vhcIVEIbPdUq4NEpYp/wftowGXFqzVtl/USoe9xP3pqWO2+NzhwHDMpij/YdEvLoF/MEja4FejK0yEwXpHBe1XMLF3qhSQbsmg4Pk2RGrcJecHagT0/gvOky25gDu3IK/mW2zH6yFLbQfEnw/sil2dIpa/gfO48/+FhL1m1+x9vMlp8B3tngBJU6Bn

Additional comments

Something like this

@Eyrum
Copy link
Author

Eyrum commented Feb 26, 2025

#189

@ota-meshi
Copy link
Member

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.

https://github.com/rashfael/eslint-plugin-vue-pug

@ota-meshi ota-meshi closed this as not planned Won't fix, can't repro, duplicate, stale Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants