Skip to content

Commit

Permalink
feat(eslint): enable vue/prefer-use-template-ref
Browse files Browse the repository at this point in the history
  • Loading branch information
ModyQyW committed Nov 15, 2024
1 parent 914dec7 commit c65d5d7
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/eslint/configs/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import {
import type { Config, Rules, VueOptions } from "../types.ts";

const vueBaseRules: Rules = {
// https://github.com/vuejs/eslint-plugin-vue/blob/v9.30.0/lib/configs/base.js
// https://github.com/vuejs/eslint-plugin-vue/blob/v9.31.0/lib/configs/base.js
"vue/comment-directive": "error",
"vue/jsx-uses-vars": "error",
};

const vue3Rules: Rules = {
// https://github.com/vuejs/eslint-plugin-vue/blob/v9.30.0/lib/configs/vue3-essential.js
// https://github.com/vuejs/eslint-plugin-vue/blob/v9.31.0/lib/configs/vue3-essential.js
// 'vue/multi-word-component-names': 'error', // Too ideal for business.
"vue/multi-word-component-names": "warn",
"vue/no-arrow-functions-in-watch": "error",
Expand Down Expand Up @@ -99,7 +99,7 @@ const vue3Rules: Rules = {
"vue/valid-v-slot": "error",
"vue/valid-v-text": "error",

//https://github.com/vuejs/eslint-plugin-vue/blob/v9.30.0/lib/configs/vue3-strongly-recommended.js
//https://github.com/vuejs/eslint-plugin-vue/blob/v9.31.0/lib/configs/vue3-strongly-recommended.js
"vue/attribute-hyphenation": "warn",
"vue/component-definition-name-casing": "warn",
// 'vue/first-attribute-linebreak': 'warn', // Conflicts with Prettier.
Expand All @@ -126,7 +126,7 @@ const vue3Rules: Rules = {
"vue/v-on-style": "warn",
"vue/v-slot-style": "warn",

// https://github.com/vuejs/eslint-plugin-vue/blob/v9.30.0/lib/configs/vue3-recommended.js
// https://github.com/vuejs/eslint-plugin-vue/blob/v9.31.0/lib/configs/vue3-recommended.js
// 'vue/attributes-order': 'warn',
"vue/attributes-order": [
"warn",
Expand Down Expand Up @@ -289,6 +289,7 @@ const vue3Rules: Rules = {
"vue/prefer-prop-type-boolean-first": "error",
"vue/prefer-separate-static-class": "error",
"vue/prefer-true-attribute-shorthand": "error",
"vue/prefer-use-template-ref": "error",
"vue/require-default-export": "error",
"vue/require-emit-validator": "error",
"vue/require-explicit-slots": "error",
Expand All @@ -307,7 +308,7 @@ const vue3Rules: Rules = {
};

const vue2Rules: Rules = {
// https://github.com/vuejs/eslint-plugin-vue/blob/v9.30.0/lib/configs/vue2-essential.js
// https://github.com/vuejs/eslint-plugin-vue/blob/v9.31.0/lib/configs/vue2-essential.js
// 'vue/multi-word-component-names': 'error', // Too ideal for business.
"vue/multi-word-component-names": "off",
"vue/no-arrow-functions-in-watch": "error",
Expand Down Expand Up @@ -368,7 +369,7 @@ const vue2Rules: Rules = {
"vue/valid-v-slot": "error",
"vue/valid-v-text": "error",

// https://github.com/vuejs/eslint-plugin-vue/blob/v9.30.0/lib/configs/vue2-strongly-recommended.js
// https://github.com/vuejs/eslint-plugin-vue/blob/v9.31.0/lib/configs/vue2-strongly-recommended.js
"vue/attribute-hyphenation": "warn",
"vue/component-definition-name-casing": "warn",
// 'vue/first-attribute-linebreak': 'warn', // Conflicts with Prettier.
Expand All @@ -393,7 +394,7 @@ const vue2Rules: Rules = {
"vue/v-on-style": "warn",
"vue/v-slot-style": "warn",

// https://github.com/vuejs/eslint-plugin-vue/blob/v9.30.0/lib/configs/vue2-recommended.js
// https://github.com/vuejs/eslint-plugin-vue/blob/v9.31.0/lib/configs/vue2-recommended.js
// 'vue/attributes-order': 'warn',
"vue/attributes-order": [
"warn",
Expand Down Expand Up @@ -551,6 +552,7 @@ const vue2Rules: Rules = {
"vue/prefer-prop-type-boolean-first": "error",
"vue/prefer-separate-static-class": "error",
"vue/prefer-true-attribute-shorthand": "error",
"vue/prefer-use-template-ref": "error",
"vue/require-default-export": "error",
"vue/require-emit-validator": "error",
"vue/require-explicit-slots": "error",
Expand Down

0 comments on commit c65d5d7

Please sign in to comment.