Vize

vapor/no-inline-template

Vapor で削除済みの inline-template 属性を検出します。

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

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

悪い例

LegacyCard の内部のマークアップに inline-template を使っています。

<template>
  <LegacyCard inline-template>
    <p>Profile</p>
  </LegacyCard>
</template>

良い例

同じマークアップを default slot として渡します。

<template>
  <LegacyCard>
    <template #default>
      <p>Profile</p>
    </template>
  </LegacyCard>
</template>

設定(Vite+)

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

export default defineConfig({}).withVue({
  linter: {
    "preset": "incremental",
    "rules": {
      "vapor/no-inline-template": "error"
    }
  },
});

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

関連ページ