chore(web stack): add new ESLint Vue rules #5 #7736
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Better ESLint configuration for Core/6/Lite projects.
Group rules by sections
Reorder rules alphabetically
Updated
no-void
rules to re-enable it, while allowingvoid
as statementChanged "Vue 3 Recommended" rules from
warn
toerror
vue/attribute-hyphenation
Enforces the use of hyphenated attribute names in templates.
vue/component-definition-name-casing
Ensures
PascalCase
casing for component definition names.vue/first-attribute-linebreak
Enforces the location of the first attribute on a new line when multiline.
vue/html-closing-bracket-newline
Enforces a newline before the closing bracket in a multiline element.
Forbids a newline before the closing bracket in a singleline element.
(disabled, conflicts with Prettier)vue/html-closing-bracket-spacing
Enforces spacing before>
in self-closing tag (e.g. ✅<div />
, ❌<div/>
)Forbids spacing before>
in other tags (e.g. ✅<div>
, ❌<div >
)vue/html-end-tags
Enforces end tags in templates.
(disabled, conflicts with Prettier)vue/html-indent
Enforces consistent indentation in<template>
.vue/html-quotes
Enforces double-quotes for HTML attributes.
vue/html-self-closing
Enforces self-closing style for empty components and HTML elements (e.g. ✅
<MyComponent />
)Forbid self-closing style for void elements (e.g. ✅
<img>
, ❌<img />
)(disabled, conflicts with Prettier)vue/max-attributes-per-line
({ singleline: 3, multiline: 1 }
)Limits the number of attributes per line to improve readability.vue/multiline-html-element-content-newline
Requires a line break before and after the content of multiline elements.
vue/mustache-interpolation-spacing
Enforces 1 space around mustache interpolations (e.g. ✅
{{ foo }}
, ❌{{foo}}
)vue/no-multi-spaces
Disallows multiple spaces in templates (e.g. ✅
<div class="x">
, ❌<div class="x">
)vue/no-spaces-around-equal-signs-in-attribute
Disallows spaces around equal signs in attribute assignments (❌
<div class = "x">
)vue/no-template-shadow
Prevents variable declarations from shadowing variables declared in the outer scope in template
vue/prop-name-casing
Enforces camelCase naming for props.
vue/require-explicit-emits
Requires explicitly defining emitted events in a component.
vue/require-prop-types
Requires type definitions in props.
vue/v-bind-style
Enforces short v-bind directive style (✅
:foo="foo"
, ❌v-bind:foo="foo"
).vue/v-on-event-hyphenation
Enforces hyphenated naming style for custom event names in v-on.
vue/v-on-style
Enforces short v-on directive style (✅
@foo="handle()"
, ❌v-on:foo="handle()"
).vue/v-slot-style
Enforces consistent v-slot directive style.
vue/attributes-order
Enforces a specific order for attributes.
vue/no-lone-template
Disallows unnecessary
<template>
tags.vue/no-multiple-slot-args
Disallows multiple slot arguments
vue/no-v-html
Disallows the use of
v-html
to prevent XSS vulnerabilities.vue/this-in-template
Disallows usage of this in templates.
Checklist
Fixes #007
,See xoa-support#42
,See https://...
)Introduced by
CHANGELOG.unreleased.md