Skip to content

Latest commit

 

History

History
76 lines (56 loc) · 2.03 KB

no-deprecated-filter.md

File metadata and controls

76 lines (56 loc) · 2.03 KB
pageClass sidebarDepth title description since
rule-details
0
vue/no-deprecated-filter
disallow using deprecated filters syntax (in Vue.js 3.0.0+)
v7.0.0

vue/no-deprecated-filter

disallow using deprecated filters syntax (in Vue.js 3.0.0+)

  • ⚙️ This rule is included in all of "plugin:vue/vue3-essential", "plugin:vue/vue3-strongly-recommended" and "plugin:vue/vue3-recommended".

📖 Rule Details

This rule reports deprecated filters syntax (removed in Vue.js v3.0.0+).

See Migration Guide - Filters for more details.

<template>
  <!-- ✓ GOOD -->
  {{ filter(msg) }}
  {{ filter(msg, '') }}
  {{ filterB(filterA(msg)) }}
  <div v-bind:id="filter(msg)"></div>
  <div v-bind:id="filter(msg, '')"></div>
  <div v-bind:id="filterB(filterA(msg))"></div>

  <!-- ✗ BAD -->
  {{ msg | filter }}
  {{ msg | filter('') }}
  {{ msg | filterA | filterB }}
  <div v-bind:id="msg | filter"></div>
  <div v-bind:id="msg | filter('')"></div>
  <div v-bind:id="msg | filterA | filterB"></div>
</template>

:::warning Do not disable "parserOptions.vueFeatures.filter" to use this rule.

{
  "parser": "vue-eslint-parser",
  "parserOptions": {
    "vueFeatures": {
      "filter": false // Don't!!
    }
  }
}

:::

🔧 Options

Nothing.

📚 Further Reading

🚀 Version

This rule was introduced in eslint-plugin-vue v7.0.0

🔍 Implementation