eslint-plugin-vue-no-static-computed

ESLint rule to disallow Vue computed() wrapping purely static values with no reactive dependencies
892
Install
npm install eslint-plugin-vue-no-static-computed
Latest Version:0.1.0
License:MIT
Last Updated:Mar 27, 2026
Links: GitHub  ·  npm
Maintainer: arghmeleg

eslint-plugin-vue-no-static-computed

ESLint rule to disallow Vue computed() wrapping purely static values with no reactive dependencies.

Installation

npm install --save-dev eslint-plugin-vue-no-static-computed

Usage

In your ESLint flat config (eslint.config.js):

import vueNoStaticComputed from 'eslint-plugin-vue-no-static-computed'

export default [
  {
    plugins: {
      'vue-no-static-computed': vueNoStaticComputed,
    },
    rules: {
      'vue-no-static-computed/no-static-computed': 'error',
    },
  },
]

Rule Details

no-static-computed flags computed() calls where the getter returns a value with no reactive dependencies. These should be plain variables instead.

Examples

Bad:

import { computed } from 'vue'

const items = computed(() => ['a', 'b', 'c'])
const config = computed(() => ({ key: 'value' }))
const label = computed(() => 'hello')

Good:

import { computed, ref } from 'vue'

const items = ['a', 'b', 'c']
const config = { key: 'value' }
const label = 'hello'

const count = ref(0)
const doubled = computed(() => count.value * 2)

License

MIT

Related Packages

eslint-plugin-vue-storefront

ESLint rules for Vue Storefront

39,292
@scayle/eslint-plugin-vue-composable

Rules to avoid unpleasant composable problems

207,394 4
@component-hook/eslint-plugin

ESLint config for component hook

8,834 4
eslint-plugin-test-id

This checks is data-test-id prop is present, on some tags which are useful for e...

10,384 17
eslint-plugin-vueunused

a eslint plugin for detecting unused code in vue single file component

939

Version History

Version Released License
0.1.0 MIT