Vize

vue/no-unsupported-features

指定した Vue.js の版で未対応の構文を検出します。

既定の重大度 プリセット 自動修正 オプション
warning なし なし なし

適用範囲:Vue SFC のテンプレートと各ブロック。ルールに必要な script の文脈も例に含めています。

悪い例

defineModel は設定した版より新しい Vue を必要とします。

<script setup lang="ts">
const model = defineModel<string>();
</script>
<template>
  <p>{{ model }}</p>
</template>

良い例

コンポーネントは版で制限されるマクロを使いません。

<script setup lang="ts">
const label = "ok";
</script>
<template>
  <p>{{ label }}</p>
</template>

設定(Vite+)

import { defineConfig } from "@vizejs/vite-plugin/vite-plus";

export default defineConfig({}).withVue({
  linter: {
    "preset": "incremental",
    "rules": {
      "vue/no-unsupported-features": "warn"
    },
    "ruleOptions": {
      "vue/no-unsupported-features": {
        "version": "^3.3.0"
      }
    }
  },
});

設定したら vp run lint を実行します。

関連ページ