This PR brings a first set of new ESLint rules for XO Lite / 6 / Core stack.
vue/multi-word-component-names
This rule has been deactivated to allow single word components name. The way we import and use our component should not be a problem if HTML brings new tags later.
vue/block-order
Ensure consistency across components for template, script and style block order.
vue/block-tag-newline
Ensure consistency for block opening and closing tags.
<!-- GOOD -->
<template>Foobar</template>
<!-- GOOD -->
<template>
Foobar
</template>
<!-- BAD -->
<template>Foobar
</template>
vue/component-api-style
Ensure our components exclusively use script setup API.
vue/custom-event-name-casing
Ensure our custom event names to be camelCase
vue/define-props-declaration
Ensure our props are declared with TypeScript
// GOOD
defineProps<{ foo: string }>()
// BAD
defineProps({ foo: String })
vue/enforce-style-attribute
Ensure that all our components are using scoped or module style. This prevents leaking styles across the whole app
vue/html-comment-content-newline
Ensure consistency across HTML comments
vue/html-comment-content-spacing
Ensure consistency across HTML comments
vue/no-empty-component-block
Prevent defining empty script or style tags
vue/no-multiple-objects-in-class
<!-- GOOD -->
<div :class="[{ foo, bar }]">
<!-- BAD -->
<div :class="[{ foo }, { bar }]">
vue/no-required-prop-with-default
Prevent setting a default value for required props
vue/no-undef-components
Prevent using a non imported component in template
vue/no-unused-refs
Prevent defining a unused ref (<div ref="foo">) in template.
vue/no-use-v-else-with-v-for
Prevent using v-else-if or v-else on the same element as v-for
vue/no-useless-mustaches
Prevent using useless mustache syntax (e.g. <div>{{ 'My Text' }}</div>)
Description
This PR brings a first set of new ESLint rules for XO Lite / 6 / Core stack.
vue/multi-word-component-names
This rule has been deactivated to allow single word components name. The way we import and use our component should not be a problem if HTML brings new tags later.
vue/block-order
Ensure consistency across components for
template
,script
andstyle
block order.vue/block-tag-newline
Ensure consistency for block opening and closing tags.
vue/component-api-style
Ensure our components exclusively use
script setup
API.vue/custom-event-name-casing
Ensure our custom event names to be
camelCase
vue/define-props-declaration
Ensure our props are declared with TypeScript
vue/enforce-style-attribute
Ensure that all our components are using
scoped
ormodule
style. This prevents leaking styles across the whole appvue/html-comment-content-newline
Ensure consistency across HTML comments
vue/html-comment-content-spacing
Ensure consistency across HTML comments
vue/no-empty-component-block
Prevent defining empty
script
orstyle
tagsvue/no-multiple-objects-in-class
vue/no-required-prop-with-default
Prevent setting a default value for required props
vue/no-undef-components
Prevent using a non imported component in template
vue/no-unused-refs
Prevent defining a unused ref (
<div ref="foo">
) in template.vue/no-use-v-else-with-v-for
Prevent using
v-else-if
orv-else
on the same element asv-for
vue/no-useless-mustaches
Prevent using useless mustache syntax (e.g.
<div>{{ 'My Text' }}</div>
)vue/no-useless-v-bind
Prevent useless bind attribute (e.g.
<div :foo="'literal'">
)vue/no-v-text
Prevent usage of
v-text
vue/padding-line-between-blocks
Ensure a blank line between
template
,script
andtemplate
tagsvue/prefer-define-options
Force usage of
defineOptions
vue/prefer-separate-static-class
Prevent mixing static and dynamic classes
vue/prefer-true-attribute-shorthand
vue/require-macro-variable-name
Ensure consistency across macros variable names (e.g.
const props
fordefineProps
,const emit
fordefineEmits
etc.)vue/html-button-has-type
Prevent forgetting to add a
type
to<button>
which could lead to unexpected behavior since itsubmit
by default.Checklist
Fixes #007
,See xoa-support#42
,See https://...
)Introduced by
CHANGELOG.unreleased.md