当前位置: 首页 > 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',},},
)

http://www.dtcms.com/a/232129.html

相关文章:

  • 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 模式
  • 什么是分布式锁?几种分布式锁分别是怎么实现的?
  • Python-多线程
  • 渗透测试服务如何全方位评估企业安全状况并揭示潜在缺陷?
  • 哈希表入门:用 C 语言实现简单哈希表(开放寻址法解决冲突)
  • Oj系统测试报告
  • 湖北理元理律师事务所:债务化解中的心理重建与法律护航
  • C++——智能指针 shared_ptr
  • SSH登陆Linux常见问题大全
  • 【unity游戏开发入门到精通——通用篇】AssetBundle(AB包)和AssetBundleBrowser的使用介绍
  • 【Unity】R3 CSharp 响应式编程 - 使用篇(二)
  • 树莓派上遇到插入耳机后显示“无输入设备”问题