Vize

所有铜绿统治

本页列出了crates/vize_patina/src/rules下宣告的所有238个Patina规则实现。分类页面保留较长的示例;本页是涵盖范围、默认严重度、预设成员资格、可修复性和源代码实现的简要参考。

预设名称使用 Vize CLI 术语。oxlint 插件的元数据名称general-recommended此处显示为 happy-path_none_意味着规则是选择加入的、由主机驱动的,或者不在捆绑的 lint 预设之外。

分类

类别 规则
必看 48
强烈推荐 12
推荐 41
可及性 31
HTML 符合性 9
类型意识 5
蒸汽 7
生态系统 9
CSS 10
穆西亚 6
剧本 60

必看(48)

规则 严重程度 预设 可修复 实现 描述
petite-vue/no-unsupported-directive error 来源 禁止 petite-vue 不支持的指令
petite-vue/valid-v-effect error 来源 要求v-效应的表达式非空
petite-vue/valid-v-scope error 来源 要求 v-scope 绑定对象字面
vue/multi-word-component-names error essentialnuxtopinionated 来源 要求组件名称为多词
vue/no-child-content error essentialhappy-pathnuxtecosystemopinionated 来源 使用v-html或v-text时禁止儿童内容
vue/no-deprecated-filter error 来源 禁止使用管道操作符
vue/no-deprecated-functional-template error 来源 禁止在SFC上使用functional属性<template>
vue/no-deprecated-html-element-is error 来源 禁止在本地HTML元素上使用 is 属性
vue/no-deprecated-router-link-tag-prop error 来源 禁止<router-link>上的 tag prop
vue/no-deprecated-scope-attribute error 来源 禁止在<模板上禁用的 scope 属性>
vue/no-deprecated-slot-attribute error 来源 禁止被淘汰的slot属性
vue/no-deprecated-slot-scope-attribute error 来源 禁止弃用的 slot-scope 属性
vue/no-deprecated-v-bind-sync error 来源 .sync禁止在v-bind
vue/no-deprecated-v-on-native-modifier error 来源 .native禁止在v-on
vue/no-deprecated-v-on-number-modifiers error 来源 keyCode禁止在v-on
vue/no-dupe-v-else-if error essentialhappy-pathnuxtecosystemopinionated 来源 禁止v-if / v-else-if链中重复条件
vue/no-duplicate-attributes error essentialhappy-pathnuxtecosystemopinionated 来源 禁止同一元素上重复属性
vue/no-mutating-props error happy-pathnuxtecosystemopinionated 来源 禁止变异组件道具
vue/no-reserved-component-names error essentialhappy-pathnuxtecosystemopinionated 来源 禁止将保留名称作为组件名称使用
vue/no-template-key error essentialhappy-pathnuxtecosystemopinionated 来源 禁止key属性在<template>
vue/no-textarea-mustache error essentialhappy-pathnuxtecosystemopinionated 来源 禁止在<textarea>
vue/no-unused-components warning happy-pathnuxtecosystemopinionated 来源 禁止注册未在模板中使用的组件
vue/no-unused-vars warning essentialhappy-pathnuxtecosystemopinionated 来源 禁止在 v-for 和 v-slot 指令中使用未使用的变量定义
vue/no-use-v-if-with-v-for warning essentialhappy-pathnuxtecosystemopinionated 来源 禁止在与v-if v-for
vue/no-useless-template-attributes error essentialhappy-pathnuxtecosystemopinionated 来源 禁止在<template>元素上添加无用属性
vue/no-v-for-template-key-on-child error essentialhappy-pathnuxtecosystemopinionated 来源 禁止key<template v-for>的子女身上
vue/no-v-html warning essentialhappy-pathnuxtecosystemopinionated 来源 警告v-html以防止XSS漏洞
vue/no-v-text-v-html-on-component error essentialhappy-pathnuxtecosystemopinionated 来源 禁止组件元素上的v-text/v-html
vue/permitted-contents error happy-pathnuxtecosystemopinionated 来源 执行HTML内容模型规则
vue/require-component-is error essentialhappy-pathnuxtecosystemopinionated 来源 要求<component>元素v-bind:is
vue/require-toggle-inside-transition error essentialhappy-pathnuxtecosystemopinionated 来源 需要在被<transition>
vue/require-v-for-key error essentialhappy-pathnuxtecosystemopinionated 来源 要求v-bind:key v-for指令
vue/use-v-on-exact warning essentialnuxtopinionated 来源 当存在基于修改符的handler v-on .exact
vue/valid-attribute-name error essentialhappy-pathnuxtecosystemopinionated 来源 要求有效的属性名称
vue/valid-template-root error essentialhappy-pathnuxtecosystemopinionated 来源 强制执行 Vue 3 片段语义的有效 <template>
vue/valid-v-bind error essentialhappy-pathnuxtecosystemopinionated 来源 执行有效的v-bind指令
vue/valid-v-cloak error essentialhappy-pathnuxtecosystemopinionated 来源 执行有效的v-cloak指令
vue/valid-v-else error essentialhappy-pathnuxtecosystemopinionated 是的 来源 执行有效的v-else指令
vue/valid-v-for error essentialhappy-pathnuxtecosystemopinionated 来源 执行有效的v-for指令
vue/valid-v-html error essentialhappy-pathnuxtecosystemopinionated 来源 执行有效的v-html指令
vue/valid-v-if error essentialhappy-pathnuxtecosystemopinionated 来源 执行有效的v-if指令
vue/valid-v-memo error essentialhappy-pathnuxtecosystemopinionated 来源 执行有效的v-memo指令
vue/valid-v-model error essentialhappy-pathnuxtecosystemopinionated 来源 执行有效的v-model指令
vue/valid-v-on error essentialhappy-pathnuxtecosystemopinionated 来源 执行有效的v-on指令
vue/valid-v-once error essentialhappy-pathnuxtecosystemopinionated 来源 执行有效的v-once指令
vue/valid-v-show error essentialhappy-pathnuxtecosystemopinionated 来源 执行有效的v-show指令
vue/valid-v-slot error essentialhappy-pathnuxtecosystemopinionated 来源 执行有效的v-slot指令
vue/valid-v-text error essentialhappy-pathnuxtecosystemopinionated 来源 执行有效的v-text指令

强烈推荐(12)

规则 严重程度 预设 可修复 实现 描述
vue/attribute-hyphenation warning happy-pathnuxtecosystemopinionated 是的 来源 在自定义组件上强制属性命名风格
vue/component-definition-name-casing warning happy-pathnuxtecosystemopinionated 来源 对组件定义名称强制使用PascalCase
vue/html-quotes warning happy-pathnuxtecosystemopinionated 是的 来源 强制执行HTML属性的引号样式
vue/html-self-closing warning nuxtopinionated 是的 来源 强制自闭格式
vue/mustache-interpolation-spacing warning happy-pathnuxtecosystemopinionated 是的 来源 在胡须插值中强制保持一致间距
vue/no-multi-spaces warning happy-pathnuxtecosystemopinionated 是的 来源 禁止连续多个空格
vue/no-template-shadow warning nuxtopinionated 来源 禁止使用在外部作用域中遮蔽变量的变量名
vue/no-unused-properties warning happy-pathnuxtecosystemopinionated 来源 禁止定义Props
vue/prop-name-casing warning happy-pathnuxtecosystemopinionated 来源 在模板中强制执行kebab-case道具名称
vue/v-bind-style warning nuxtopinionated 是的 来源 强制执行v-bind指令样式
vue/v-on-style warning happy-pathnuxtecosystemopinionated 是的 来源 强制执行v-on指令样式
vue/v-slot-style warning happy-pathnuxtecosystemopinionated 是的 来源 执行v-slot指令风格

推荐(41)

规则 严重程度 预设 可修复 实现 描述
ssr/no-browser-globals-in-ssr warning happy-pathnuxtecosystemopinionated 来源 在SSR上下文中禁止仅浏览器全局
ssr/no-hydration-mismatch warning happy-pathnuxtecosystemopinionated 来源 禁止使用导致水合不匹配的非确定性值
vue/a11y-img-alt warning 来源 要求图片附加属性以便无障碍
vue/attribute-order warning happy-pathnuxtecosystemopinionated 来源 强制执行一致的属性顺序
vue/component-name-in-template-casing warning nuxtopinionated 是的 来源 在模板中强制组件名称使用特定外壳
vue/html-button-has-type warning nuxtopinionated 来源 要求按钮元素 的显式有效类型
vue/no-array-index-key warning nuxtopinionated 来源 禁止直接使用 v-for 索引变量作为 :key
vue/no-bare-strings-in-template warning 来源 禁止模板中应国际化的原始人类可读文本
vue/no-boolean-attr-value warning nuxtopinionated 是的 来源 禁止对布尔HTML属性使用显式值
vue/no-empty-component-block warning nuxtopinionated 来源 禁止空的SFC块
vue/no-inline-style warning nuxtopinionated 来源 不鼓励使用内联样式属性
vue/no-invalid-html-attribute warning happy-pathnuxtecosystemopinionated 来源 禁止HTML属性的无效静态值
vue/no-lone-template warning happy-pathnuxtecosystemopinionated 来源 禁止不必要的<template>元素
vue/no-multiple-objects-in-class warning nuxtopinionated 来源 禁止在 :class 数组绑定中同时存在多个对象文字
vue/no-negated-v-if-condition warning nuxtopinionated 来源 当链中有v-else
vue/no-preprocessor-lang warning nuxtopinionated 是的 来源 劝阻使用CSS预处理器,转而使用现代CSS
vue/no-root-v-if warning nuxtopinionated 来源 在模板的单根元素上不允许 v-if
vue/no-script-non-standard-lang warning nuxtopinionated 来源 不鼓励非标准文字语言值
vue/no-src-attribute warning nuxtopinionated 来源 不鼓励在SFC方块上使用src属性
vue/no-template-lang warning nuxtopinionated 是的 来源 不鼓励模板块上的lang属性
vue/no-template-target-blank warning happy-pathnuxtecosystemopinionated 来源 Disallow target=“_blank”,无rel=“noopener”
vue/no-undefined-refs warning 来源 模板中禁止未定义变量引用
vue/no-unsafe-url warning essentialhappy-pathnuxtecosystemopinionated 来源 警告潜在不安全的URL绑定
vue/no-unsandboxed-iframe warning happy-pathnuxtecosystemopinionated 来源 要求对iframe元素
vue/no-unused-refs warning nuxtopinionated 来源 报告模板参考(ref=“x”)从未在<script>
vue/no-useless-mustaches warning nuxtopinionated 来源 禁止使用胡须插值,其表达式为常数字符串文字
vue/no-useless-v-bind warning nuxtopinionated 来源 禁止 v-bind 的值为纯字符串字面值
vue/no-v-text warning nuxtopinionated 来源 禁止 v-text 指令;偏好胡子插值
vue/prefer-props-shorthand warning nuxtopinionated 是的 来源 推荐道具速写语法(Vue 3.4+)
vue/prefer-true-attribute-shorthand warning nuxtopinionated 来源 更倾向于用绑定为true
vue/require-component-registration warning opinionated 来源 要求组件明确导入或注册
vue/require-scoped-style warning happy-pathnuxtecosystemopinionated 来源 要求样式标签使用scoped属性
vue/scoped-event-names warning nuxtopinionated 来源 建议使用上下文:事件格式
vue/sfc-element-order warning happy-pathnuxtecosystemopinionated 来源 强制执行SFC顶层元素的一致顺序
vue/single-style-block warning happy-pathnuxtecosystemopinionated 来源 建议使用单一样式块
vue/slot-name-casing warning nuxtopinionated 来源 强制使用 v-slot 的命名槽口的 kebab-case。
vue/this-in-template warning nuxtopinionated 来源 模板表达式中禁止this.
vue/v-on-event-hyphenation warning nuxtopinionated 来源 在组件 的 v-on 中强制自定义事件名称的连字符
vue/v-on-handler-style warning nuxtopinionated 来源 强制将v-on处理器写入为方法引用或内联函数
vue/warn-custom-block warning nuxtopinionated 来源 警告SFC文件中的自定义方块
vue/warn-custom-directive warning nuxtopinionated 来源 提醒需要注册的自定义指令

无障碍性(31)

规则 严重程度 预设 可修复 实现 描述
a11y/alt-text warning happy-pathnuxtecosystemopinionated 来源 要求媒体元素的替代文本
a11y/anchor-has-content warning happy-pathnuxtecosystemopinionated 来源 要求锚点元素具有可访问内容
a11y/anchor-is-valid warning happy-pathnuxtecosystemopinionated 来源 对锚点元素强制有效 href
a11y/aria-props error happy-pathnuxtecosystemopinionated 来源 禁止无效的ARIA属性
a11y/aria-role error happy-pathnuxtecosystemopinionated 来源 具有ARIA角色的元素必须使用有效且非抽象的ARIA角色
a11y/aria-unsupported-elements error happy-pathnuxtecosystemopinionated 来源 禁止在不支持ARIA属性的元素上使用
a11y/click-events-have-key-events warning happy-pathnuxtecosystemopinionated 来源 要求键盘事件处理程序支持点击事件
a11y/form-control-has-label warning happy-pathnuxtecosystemopinionated 来源 要求表单控制具有关联标签
a11y/heading-has-content warning happy-pathnuxtecosystemopinionated 来源 要求标题元素具有可访问内容
a11y/heading-levels warning nuxtopinionated 来源 禁止跳过标题层级
a11y/iframe-has-title warning happy-pathnuxtecosystemopinionated 来源 要求 iframe 元素具有标题属性
a11y/img-alt warning happy-pathnuxtecosystemopinionated 来源 要求图片附加属性以便无障碍
a11y/interactive-supports-focus warning happy-pathnuxtecosystemopinionated 来源 要求交互式角色元素可聚焦
a11y/label-has-for warning happy-pathnuxtecosystemopinionated 来源 要求标签具有相关的表单控制
a11y/landmark-roles warning nuxtopinionated 来源 验证标志性角色定位和独特性
a11y/media-has-caption warning happy-pathnuxtecosystemopinionated 来源 要求媒体元素必须有字幕
a11y/mouse-events-have-key-events warning happy-pathnuxtecosystemopinionated 来源 要求用鼠标事件进行聚焦/模糊事件
a11y/no-access-key warning happy-pathnuxtecosystemopinionated 来源 禁止使用 accesskey 属性
a11y/no-aria-hidden-on-focusable error happy-pathnuxtecosystemopinionated 来源 禁止在可聚焦元素上使用 aria-hidden=“true”
a11y/no-autofocus warning happy-pathnuxtecosystemopinionated 来源 禁止使用自动对焦属性
a11y/no-distracting-elements warning happy-pathnuxtecosystemopinionated 来源 禁止使用像<marquee>和<blink>
a11y/no-i-for-icon warning happy-pathnuxtecosystemopinionated 来源 禁止在图标中使用<i>元素
a11y/no-redundant-roles warning happy-pathnuxtecosystemopinionated 是的 来源 禁止冗余的ARIA角色
a11y/no-refer-to-non-existent-id warning happy-pathnuxtecosystemopinionated 来源 禁止引用不存在的ID
a11y/no-role-presentation-on-focusable error happy-pathnuxtecosystemopinionated 来源 在可聚焦元素上,不允许 role=“presentation” 或 role=“none”
a11y/no-static-element-interactions warning happy-pathnuxtecosystemopinionated 来源 禁止静态元素上的事件处理程序
a11y/placeholder-label-option warning nuxtopinionated 来源 要求在选择占位符选项中禁用或隐藏
a11y/role-has-required-aria-props warning happy-pathnuxtecosystemopinionated 来源 要求ARIA职位具备所需属性
a11y/tabindex-no-positive warning happy-pathnuxtecosystemopinionated 来源 禁止正tabindex值
a11y/use-list warning nuxtopinionated 来源 建议使用列表元素来表达项目符号
vue/use-unique-element-ids warning nuxtopinionated 来源 使用 useId() 而非静态文字强制执行唯一元素 ID

HTML 符合性 (9)

规则 严重程度 预设 可修复 实现 描述
html/deprecated-attr warning happy-pathnuxtecosystemopinionated 来源 禁止弃用的HTML属性
html/deprecated-element warning happy-pathnuxtecosystemopinionated 来源 禁止弃用的HTML元素
html/id-duplication error essentialhappy-pathnuxtecosystemopinionated 来源 禁止重复元素ID
html/no-consecutive-br warning happy-pathnuxtecosystemopinionated 来源 禁止连续的<br>元素
html/no-dupe-style-properties warning nuxtopinionated 来源 禁止在内联风格属性中重复属性
html/no-duplicate-class warning nuxtopinionated 来源 不允许静态类属性中重复的类名
html/no-duplicate-dt warning happy-pathnuxtecosystemopinionated 来源 禁止在<dl>中重复<dt>名字
html/no-empty-palpable-content warning happy-pathnuxtecosystemopinionated 来源 禁止允许期望有可见内容的空元素
html/require-datetime warning happy-pathnuxtecosystemopinionated 来源 要求在<time>元素上设置datetime属性

类型感知(5)

规则 严重程度 预设 可修复 实现 描述
type/no-floating-promises warning nuxtopinionated 来源 禁止浮动(未处理)承诺
type/no-reactivity-loss warning nuxtopinionated 来源 禁止在赋值和调用之间使用反应式值的纯快照
type/no-unsafe-template-binding warning nuxtopinionated 来源 禁止解析为不安全类型的模板绑定
type/require-typed-emits warning happy-pathnuxtecosystemopinionated 来源 要求对 defineEmits 进行类型定义
type/require-typed-props warning happy-pathnuxtecosystemopinionated 来源 定义Props

蒸汽(7)

规则 严重程度 预设 可修复 实现 描述
script/no-get-current-instance error opinionatednuxt 来源 在 Vapor 模式下 Disallow getCurrentInstance() 返回空
script/no-next-tick error 来源 禁止在面向蒸汽的组件中使用nextTick()
script/no-options-api error opinionated 来源 在蒸汽模式下禁止选项API模式
vapor/no-inline-template error nuxtopinionated 来源 禁止弃用的内联模板属性
vapor/no-vue-lifecycle-events error happy-pathnuxtecosystemopinionated 来源 禁止每个元素设置@vue:xxx生命周期事件(Vapor不支持)
vapor/prefer-static-class warning nuxtopinionated 是的 来源 字符串文字
vapor/require-vapor-attribute warning nuxtopinionated 是的 来源 建议在脚本设置中添加蒸气属性

生态系统(9)

规则 严重程度 预设 可修复 实现 描述
ecosystem/nuxt-prefer-nuxt-link warning ecosystem 来源 内部应用链接优先使用 NuxtLink
ecosystem/pinia-prefer-store-to-refs warning ecosystem 来源 在结构化Pinia存储时,优先使用storeToRefs()
ecosystem/router-link-require-to error ecosystem 来源 需要在RouterLink和NuxtLink组件上设置to目标
ecosystem/void-link-require-href error ecosystem 来源 需要href Void Vue Link组件
ecosystem/void-link-valid-method warning ecosystem 来源 Validate static Void Vue Link method props
ecosystem/vue-i18n-no-missing-key warning ecosystem 来源 报告本地SFC消息中缺失的静态vue-i18n密钥
ecosystem/vue-router-prefer-named-link warning ecosystem 来源 在 RouterLink 中更倾向于使用命名路由对象而非静态路径字符串
ecosystem/vue-router-prefer-named-push warning ecosystem 来源 Vue 路由器程序化导航偏好命名路由对象
ecosystem/vue-test-utils-no-html-snapshot warning ecosystem 来源 避免在 Vue 测试 Utils 测试中快照 wrapper.html()

CSS (10)

规则 严重程度 预设 可修复 实现 描述
css/no-display-none warning opinionatednuxt 来源 建议用v-show代替display:无
css/no-hardcoded-values warning opinionatednuxt 来源 建议使用CSS变量代替硬编码值
css/no-id-selectors warning opinionatednuxt 来源 不鼓励在CSS中使用ID选择器
css/no-important warning opinionatednuxt 来源 不鼓励在CSS中使用!important
css/no-utility-classes warning opinionatednuxt 来源 警告不要在组件样式中实现实用类
css/no-v-bind-performance warning opinionatednuxt 来源 警告CSS v-bind()
css/prefer-logical-properties warning opinionatednuxt 来源 推荐CSS逻辑属性以提升i18n支持
css/prefer-nested-selectors warning opinionatednuxt 来源 建议使用 CSS 嵌套作为后代选择器
css/prefer-slotted warning opinionatednuxt 来源 推荐 ::v-slotted() 来设计槽位内容
css/require-font-display warning opinionatednuxt 来源 要求字体显示@font字规则

博物馆(6)

规则 严重程度 预设 可修复 实现 描述
musea/no-empty-variant warning 来源 禁止空的<变体>块
musea/prefer-design-tokens warning 来源 更倾向于使用设计令牌CSS变量而非硬编码的原始值
musea/require-component warning 来源 要求在<art>块中要求组件属性
musea/require-title error 来源 要求标题属性在<art>块
musea/unique-variant-names error 来源 需要唯一的变体名称
musea/valid-variant error 来源 在<变体>块中要求name属性

剧本(60)

规则 严重程度 预设 可修复 实现 描述
script/component-options-name-casing error opinionatednuxt 来源 为组件name选项强制执行PascalCase
script/custom-event-name-casing error opinionatednuxt 来源 强制执行 camelCase 用于发出的自定义事件名称
script/define-emits-declaration warning opinionatednuxt 来源 ><在运行时/数组形式
script/define-macros-order warning opinionatednuxt 来源 在<script设置中强制Vue编译器宏的一致顺序>
script/define-props-declaration warning opinionatednuxt 来源 强制执行基于类型的定义Props<{ ... }>() 在运行时/对象形式
script/define-props-destructuring warning opinionatednuxt 来源 禁止在<script设置中结构化defineProps的返回值>
script/no-arrow-functions-in-watch error opinionatednuxt 来源 禁止箭头功能作为选项API的监控处理程序
script/no-async-in-computed error 来源 在计算属性中禁止异步函数
script/no-boolean-default warning opinionatednuxt 来源 禁止布尔道具的默认设置
script/no-deep-destructure-in-props warning 来源 禁止在defineProps
script/no-deprecated-data-object-declaration error 来源 禁止将对象字面量作为组件数据选项(Vue 3 需要函数)
script/no-deprecated-dollar-listeners-api error 来源 禁止在 Vue 3(合并为 $attrs)中移除的 $listeners 实例属性
script/no-deprecated-dollar-scopedslots-api error 来源 禁止在 Vue 3 中移除的 $scopedSlots 实例属性(使用 $slots)
script/no-deprecated-events-api error 来源 禁止移除的Vue 2事件API($on / $off / $once)
script/no-deprecated-props-default-this error 来源 禁止this在prop默认/验证函数中(Vue 3中移除)
script/no-dupe-keys error 来源 禁止在选项 API props/data/computed/methods/setup/inject 之间重复键
script/no-duplicate-attr-inheritance warning opinionatednuxt 来源 将显式inheritAttrs: true选项标记为冗余(true为默认)
script/no-export-in-script-setup error opinionatednuxt 来源 禁止在<script设置中使用导出语句>
script/no-import-compiler-macros error 来源 禁止导入自动导入的Vue编译器宏
script/no-internal-imports error 来源 禁止从 Vue 内部模块导入
script/no-multiple-slot-args warning opinionatednuxt 来源 禁止将多个参数传递给一个有作用域槽的函数调用
script/no-potential-component-option-typo error opinionatednuxt 来源 标记选项API组件选项名称中的可能错别字
script/no-reactive-destructure warning 来源 禁止对失去反应性的物体进行结构化
script/no-ref-as-operand error opinionatednuxt 来源 要求引用绑定变量在用作操作数时必须通过.value访问
script/no-required-prop-with-default error opinionatednuxt 来源 禁止既要求 true 又 default
script/no-reserved-identifiers error 来源 禁止使用 Vue 编译器保留标识符
script/no-reserved-keys error opinionatednuxt 来源 禁止 Vue 保留名称作为选项 API props/data/computed/methods/setup/inject key
script/no-reserved-props error opinionatednuxt 来源 禁止组件的 props 声明中保留名称
script/no-restricted-globals error 来源 禁止引用必须通过类型化封装器的运行环境全局函数
script/no-restricted-members error 来源 禁止项目配置的 object.property 成员访问
script/no-side-effects-in-computed-properties error 来源 禁止选项中的副作用 API 计算的获取器
script/no-top-level-ref-in-script error 来源 禁止顶层引用/反应式,以防止交叉请求状态污染
script/no-unstable-nested-components warning opinionatednuxt 来源 禁止在设置函数或渲染函数中定义组件
script/no-unused-emit-declarations warning opinionatednuxt 来源 旗帜声明但从未发射的事件
script/no-use-computed-property-like-method error opinionatednuxt 来源 禁止调用 API 计算的 Options 属性,如同方法
script/no-with-defaults warning 来源 劝阻withDefaults,倾向于结构化默认(Vue 3.5+)
script/prefer-computed warning 来源 偏好计算()作为派生反应态
script/prefer-define-options warning opinionatednuxt 来源 更倾向于使用 defineOptions() 而不是只设置 name/inheritAttrs 的普通 <script(脚本>
script/prefer-import-from-vue warning 是的 来源 更倾向于从“vue”导入,而不是内部包
script/prefer-ref-over-reactive warning 来源 建议在状态管理中使用ref()而非reactive()
script/prefer-use-attrs warning 来源 建议使用 useAttrs() 而不是 context.attrs
script/prefer-use-id warning 来源 建议使用 useId() 来生成唯一 ID(Vue 3.5+)
script/prefer-use-slots warning 来源 推荐使用 useSlots() 而不是 context.slots
script/prefer-use-template-ref warning 来源 推荐使用useTemplateRef而非ref(null)来引用模板(Vue 3.5+)
script/require-default-prop error opinionatednuxt 来源 要求为每个可选的非布尔道具
script/require-explicit-emits warning opinionatednuxt 来源 要求在 defineEmits 或 emits 选项中声明已发射事件
script/require-explicit-slots warning opinionatednuxt 来源 要求通过 useSlots() 使用时的槽位必须显式地输入 defineSlots<...>()
script/require-function-return-type warning 来源 要求函数 的返回类型注释
script/require-prop-type-constructor error opinionatednuxt 来源 要求prop type值为构造子而非字符串文字
script/require-prop-types error opinionatednuxt 来源 要求每个道具声明一个类型
script/require-symbol-provide warning 来源 建议使用 Symbol 作为 provision/inject 的注入键
script/require-typed-object-prop warning opinionatednuxt 来源 要求在运行时类型为 ObjectArray 的道具上明确类型
script/require-typed-ref warning opinionatednuxt 来源 要求对初始化无值、空或未定义 的ref()使用显式类型参数。
script/require-valid-default-prop error opinionatednuxt 来源 要求一个道具的默认值对其声明的类型有效
script/return-in-computed-property error opinionatednuxt 来源 要求每个计算出的 getter
script/return-in-emits-validator error opinionatednuxt 来源 要求每个选项中都有一个返回值,API 会 emits validator
script/valid-define-emits error opinionatednuxt 来源 强制执行有效的 defineEmits() 使用(无类型+运行时 args,无本地引用,单次调用)
script/valid-define-options error opinionatednuxt 来源 强制执行有效的 defineOptions() 使用(单一对象 arg,无道具/发射/暴露/槽位)
script/valid-define-props error opinionatednuxt 来源 强制执行有效的 defineProps() 使用(单次调用,不同时用于类型和运行时的 arg,无本地引用)
script/valid-next-tick warning opinionatednuxt 来源 要求 nextTick() 调用的结果被等待、串联或回调