当前位置: 首页 > news >正文

vue3 eslint ts 关闭多单词命名检查

无效做法

import { globalIgnores } from 'eslint/config'
import {defineConfigWithVueTs,vueTsConfigs,
} from '@vue/eslint-config-typescript'
import pluginVue from 'eslint-plugin-vue'
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
// import { configureVueProject } from '@vue/eslint-config-typescript'
// configureVueProject({ scriptLangs: ['ts', 'tsx'] })
// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setupexport default defineConfigWithVueTs({name: 'app/files-to-lint',files: ['**/*.{ts,mts,tsx,vue}'],// 添加规则配置,关闭组件双单词命名检查rules: {'vue/multi-word-component-names': 'off',},},globalIgnores(['**/dist/**','**/dist-ssr/**','**/coverage/**',]),pluginVue.configs['flat/essential'],vueTsConfigs.recommended,skipFormatting,
)

原因:后面 

pluginVue.configs['flat/essential'],

  vueTsConfigs.recommended,

  skipFormatting,

有可能覆盖 前面 off 的配置

故配置为

import { globalIgnores } from 'eslint/config'
import {defineConfigWithVueTs,vueTsConfigs,
} from '@vue/eslint-config-typescript'
import pluginVue from 'eslint-plugin-vue'
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
// import { configureVueProject } from '@vue/eslint-config-typescript'
// configureVueProject({ scriptLangs: ['ts', 'tsx'] })
// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setupexport default defineConfigWithVueTs({name: 'app/files-to-lint',files: ['**/*.{ts,mts,tsx,vue}'],},globalIgnores(['**/dist/**','**/dist-ssr/**','**/coverage/**',]),pluginVue.configs['flat/essential'],vueTsConfigs.recommended,skipFormatting,// 将规则配置放在最后,确保不会被覆盖{rules: {'vue/multi-word-component-names': 'off',},},
)

相关文章:

  • kafka部署
  • 2025年低延迟业务DDoS防护全攻略:高可用架构与实战方案
  • 【Linux篇】0基础之学习操作系统进程
  • SpringCloud——Nacos
  • 免费工具-微软Bing Video Creator
  • 【十年技术演进深度解构:车载充电机(OBC)将成为新能源汽车的“能源大脑”】
  • 软件工程:如何做好软件产品
  • 高效集成AI能力:使用开放API打造问答系统,不用训练模型,也能做出懂知识的AI
  • 倍福 PLC程序解读
  • Linux服务器如何安装wps?
  • 可编辑PPT | 基于大数据中台新能源智能汽车应用解决方案汽车大数据分析与应用解决方案
  • 新能源汽车智慧充电桩管理方案:新能源充电桩散热问题及消防安全监管方案
  • 人工智能的社交课:从博弈游戏到健康关怀
  • elasticsearch-8.17.4
  • Windows 10 IoT 系统深度定制指南:从环境搭建到工业部署
  • 【物联网-S7Comm协议】
  • 桂花网蓝牙网关物联网医院动态血糖管理应用案例
  • 【学习记录】Linux 密码破解实战
  • Seata 分布式事务 XA 模式
  • 什么是分布式锁?几种分布式锁分别是怎么实现的?
  • 做网站和做app那个简单/网站维护收费标准
  • 珠海移动网站建设报价/seo页面优化的方法
  • 网站建设前期/域名官网
  • wordpress文章分组授权/百度seo运营工作内容
  • 海外网站建设/英文seo是什么
  • 广州建网站培训/网络销售平台上市公司有哪些