惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
Microsoft Security Blog
Microsoft Security Blog
Recent Announcements
Recent Announcements
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Last Week in AI
Last Week in AI
罗磊的独立博客
腾讯CDC
云风的 BLOG
云风的 BLOG
月光博客
月光博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
宝玉的分享
宝玉的分享
U
Unit 42
I
InfoQ
D
DataBreaches.Net
Blog — PlanetScale
Blog — PlanetScale
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
V2EX
美团技术团队
IT之家
IT之家
Stack Overflow Blog
Stack Overflow Blog
F
Fortinet All Blogs
GbyAI
GbyAI
S
SegmentFault 最新的问题

博客园 - 草率的龙果果

window 11 Ultra5‑125H,Arrow Lake 卡顿解决办法 npm配置内网,git配置内网 jenkins打包完镜像更新页面没有变化 vue2 element ui dialog拖拽功能实现。 AI整理提示词 数字转换为中文数字 前端数据导出excel工具函数 自动监测数据有效传输率统计算法说明 echarts官方扩展vue组件vue-echarts实现链接两个charts实现联动 OPPO商店签名认领应用 iframe跨域通信(postMessage) 博文阅读密码验证 - 博客园 项目常用工具函数获取url参数和hash参数 Copilot键怎么改成Ctrl键? plus.downloader.createDownload 发送 POST 请求并携带 token vue2,vue3中在template中使用component组件is属性绑定jsx的vnode vue3 vite idea中control+鼠标单击不能跳转到文件定义的解决办法 Vue2项目解决van-calendar 显示白色空白,需滑动一下屏幕,才可正常显示 Windows Terminal/Powershell 设置自动补全, 智能提示 【类似于mac的iterm2功能】 vue中使用axios获取不到响应头Content-Disposition的解决办法 ES7 新增方法:Array.prototype.some、Array.prototype.every 博文阅读密码验证 - 博客园 vue2使用openlayers10.3.0版本组包 javascript跨域问题排查
vue/html-self-closing
草率的龙果果 · 2025-02-20 · via 博客园 - 草率的龙果果

安装依赖

pnpm i eslint-plugin-vue --save-dev
pnpm install eslint-plugin-react --save-dev

 eslint

module.exports = {
  root: true,
  env: {
    node: true,
  },
  extends: [
    "plugin:vue/essential",
    "plugin:vue/recommended",
    "eslint:recommended",
    "@vue/prettier",
  ],
  parserOptions: {
    parser: "@babel/eslint-parser",
  },
  rules: {
    "vue/html-self-closing": [
      "error",
      {
        html: {
          void: "any",
          normal: "always",
          component: "always",
        },
        svg: "always",
        math: "always",
      },
    ],
    "react/self-closing-comp": [
      "error",
      {
        // 使用这个规则来处理 JSX 自闭合
        component: true,
        html: true,
      },
    ],
    "vue/component-name-in-template-casing": [
      "error",
      "kebab-case",
      {
        registeredComponentsOnly: false,
        ignores: ["currentPage", "pageSize"],
      },
    ],
    // "vue/name-property-casing": ["error", "kebab-case"],
    "vue/order-in-components": [
      "error",
      {
        order: [
          "name",
          "components",
          "props",
          "data",
          "computed",
          "watch",
          "methods",
          "beforeCreate",
          "created",
          "beforeMount",
          "mounted",
          "beforeUpdate",
          "updated",
          "beforeDestroy",
          "destroyed",
          "activated",
          "deactivated",
          "errorCaptured",
          "filters",
          "directives",
          "provide",
          "inject",
        ],
      },
    ],
    "vue/attributes-order": [
      "error",
      {
        order: [
          // ["id"],
          // ["class"],
          // "name",
          // "data-*",
          // "src",
          // "href",
          // "alt",
          // "title",
          // "style",
          // "v-*",
          // "on*",
          // "bind*",
          // "directives*",
          // "slot",
          // "key"
        ],
      },
    ],
    "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
    "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
    "no-unused-vars": "off",
    eqeqeq: "error",
    "prettier/prettier": [
      "error",
      {
        semi: false,
        singleQuote: true,
        printWidth: 80,
        endOfLine: "auto",
        trailingComma: "none",
        proseWrap: "never",
        arrowParens: "avoid",
      },
    ],
    "vue/no-unused-components": 0,
  },
  globals: {
    T: true,
  },
  overrides: [
    {
      files: [
        "**/__tests__/*.{j,t}s?(x)",
        "**/tests/unit/**/*.spec.{j,t}s?(x)",
      ],
      env: {
        mocha: true,
      },
    },
  ],
  plugins: [
    "react", // 添加这一行
  ],
};