Vize

vue/no-restricted-component-options

disallow specific component option.

Default severity Presets Automatic fix Options
warning None No None

Applies to: Vue SFC templates and blocks, with script context where the rule requires it.

Bad

The component sets the forbidden inheritAttrs option.

<script setup lang="ts">
defineOptions({ inheritAttrs: false });
</script>
<template>
  <p>ok</p>
</template>

Good

The component sets only name.

<script setup lang="ts">
defineOptions({ name: "Widget" });
</script>
<template>
  <p>ok</p>
</template>

Configuration (Vite+)

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

export default defineConfig({}).withVue({
  linter: {
    "preset": "incremental",
    "rules": {
      "vue/no-restricted-component-options": "warn"
    },
    "ruleOptions": {
      "vue/no-restricted-component-options": [
        "inheritAttrs"
      ]
    }
  },
});

Then run vp run lint.