Laravel  
laravel
文档
数据库
架构
入门
php技术
    
Laravelphp
laravel / php / java / vue / mysql / linux / python / javascript / html / css / c++ / c#

vue3 eslint

作者:戮尽逆者   发布日期:2026-02-22   浏览:19

// .eslintrc.js 配置文件示例

module.exports = {
  root: true,
  env: {
    node: true,
  },
  extends: [
    'plugin:vue/vue3-essential',
    'eslint:recommended',
    '@vue/typescript/recommended',
    '@vue/prettier',
    '@vue/prettier/@typescript-eslint',
  ],
  parserOptions: {
    ecmaVersion: 2020,
  },
  rules: {
    'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
    'prettier/prettier': [
      'error',
      {
        singleQuote: true,
        semi: false,
      },
    ],
  },
};

// 解释说明:
// 这是一个 Vue 3 项目中常用的 ESLint 配置文件示例。它结合了 Vue 3 的最佳实践、TypeScript 支持以及 Prettier 格式化工具。
// - `extends` 中包含了 Vue 3 的基础规则、ESLint 推荐规则、TypeScript 支持和 Prettier 集成。
// - `rules` 中定义了一些自定义规则,例如在生产环境中禁用 console 和 debugger。
// - `parserOptions` 指定了 ECMAScript 版本为 2020。

上一篇:vue unshift

下一篇:vue图表

大家都在看

vue.js devtools用法

three.js vue

vue js for循环

vue.min.js 本地引入

highlight.js vue

vue.config.js 配置

vue.config.js 配置代理

vue.config.js configu

node.js vue

vue3 写法

Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3

Laravel 中文站