Skip to content

@rotki/composable-prefer-shallowref

Prefer shallowRef() over ref() for primitive values in composables

  • ✒️️ The --fix option on the command line can automatically fix some of the problems reported by this rule.

📖 Rule Details

This rule reports ref() calls with primitive literal arguments inside composables and suggests using shallowRef() instead for better performance.

🔧 Options

json
{
  "@rotki/composable-prefer-shallowref": ["error", { "autofix": false }]
}

autofix

  • Type: boolean
  • Default: false

When true, enables auto-fix via the --fix CLI flag. When false (default), the fix is available only as an editor suggestion.

🚀 Version

This rule was introduced in @rotki/eslint-plugin v1.3.0

🔍 Implementation