# jsx-uses-vars

Rule `vue/jsx-uses-vars`. Prevent variables used in JSX to be marked as unused

- Source: vue
- Technologies: Vue
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 11.8M weekly downloads of presets that enable it
- Trend: +49.7% last quarter
- Rank: #841 by reach, #844 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vue/jsx-uses-vars` | yes | no | package `eslint-plugin-vue` | [docs](https://eslint.vuejs.org/rules/jsx-uses-vars.html) |

## Enable it

### ESLint: `eslint.config.js`

```js
import vue from "eslint-plugin-vue";

export default [
  {
    plugins: { vue },
    rules: {
      "vue/jsx-uses-vars": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Vue recommended](https://lintradar.dev/presets/vue-recommended.md) | ESLint | `eslint-plugin-vue` | 118 | 9.5M | +46.6% |
| [Vue essential](https://lintradar.dev/presets/vue-essential.md) | ESLint | `eslint-plugin-vue` | 85 | 9.5M | +46.6% |
| [Vue strongly recommended](https://lintradar.dev/presets/vue-strongly-recommended.md) | ESLint | `eslint-plugin-vue` | 110 | 9.5M | +46.6% |
| [Nuxt](https://lintradar.dev/presets/nuxt.md) | ESLint | `@nuxt/eslint-config` | 188 | 1.5M | +72.8% |
| [Anthony Fu's config](https://lintradar.dev/presets/antfu.md) | ESLint | `@antfu/eslint-config` | 294 | 758.7K | +49.9% |

## Related rules

- [react/jsx-uses-vars](https://lintradar.dev/rules/react/jsx-uses-vars.md): Disallow variables used in JSX to be incorrectly marked as unused
- [vue/comment-directive](https://lintradar.dev/rules/vue/comment-directive.md): Support comment-directives in `<template>`
- [vue/no-parsing-error](https://lintradar.dev/rules/vue/no-parsing-error.md): Disallow parsing errors in `<template>`
- [vue/no-unused-vars](https://lintradar.dev/rules/vue/no-unused-vars.md): Disallow unused variable definitions of v-for directives or scope attributes
- [vue/no-unused-components](https://lintradar.dev/rules/vue/no-unused-components.md): Disallow registering components that are not used inside templates
- [vue/no-reserved-component-names](https://lintradar.dev/rules/vue/no-reserved-component-names.md): Disallow the use of reserved names in component definitions

---

Web page: https://lintradar.dev/rules/vue/jsx-uses-vars. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
