eslint:


module.exports = {
  root: true,
  env: {
    browser: true,
    es6: true,
    node: true
  },
  extends: [
    'plugin:vue/recommended',
    '@vue/standard'
  ],
  parserOptions: {
    parser: 'babel-eslint'
  },
  rules: {
    'import/order': 2,
    'no-var': 2,
    'prefer-const': 0,
    'no-console': 1,
    'no-debugger': 1,
    'standard/no-callback-literal': 0,
    indent: 2,
    'vue/singleline-html-element-content-newline': 0,
    'vue/max-attributes-per-line': [2, {
      singleline: 2,
      multiline: {
        max: 1,
        allowFirstLine: false
      }
    }],
    'vue/script-indent': [2, 2, {
      baseIndent: 1,
      switchCase: 1
    }],
    'vue/order-in-components': 1,
    'vue/html-closing-bracket-newline': [2, {
      singleline: 'never',
      multiline: 'always'
    }]
  },
  overrides: [{ files: ['*.vue'], rules: { indent: 'off' } }]
}

stylelint:


module.exports = {
  extends: ['stylelint-config-standard'],
  plugins: ['stylelint-order'],
  rules: {
    'order/order': [
      'custom-properties',
      'declarations'
    ],
    'order/properties-alphabetical-order': true
  }
}

package.json:

"@vue/cli-plugin-babel": "~4.3.0",
"@vue/cli-plugin-eslint": "~4.3.0",
"@vue/cli-service": "~4.3.0",
"@vue/eslint-config-standard": "^5.1.2",
"babel-eslint": "^10.1.0",
"eslint": "^7.0.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-vue": "^6.2.2",
"less-loader": "^6.1.0",
"stylelint": "^13.5.0",
"stylelint-order": "^4.0.0",
"stylelint-config-standard": "^20.0.0",
"vue-template-compiler": "^2.6.11"

eslint and stylelint config的更多相关文章

  1. 如何为你的 Vue 项目添加配置 Stylelint

    如何为你的 Vue 项目添加配置 Stylelint 现在已经是 9102 年了,网上许多教程和分享帖都已经过期,照着他们的步骤来会踩一些坑,如 stylelint-processor-html 已经 ...

  2. StyleLint 使用指南

    StyleLint 是『一个强大的.现代化的 CSS 检测工具』, 与 ESLint 类似, 是通过定义一系列的编码风格规则帮助我们避免在样式表中出现错误. 安装stylelint npm insta ...

  3. 前端规范之CSS规范(Stylelint)

    代码规范是软件开发领域经久不衰的话题,几乎所有工程师在开发过程中都会遇到或思考过这一问题.而随着前端应用的大型化和复杂化,越来越多的前端团队也开始重视代码规范.同样,前段时间,笔者所在的团队也开展了一 ...

  4. 前端进阶(8) - 前端开发需要了解的工具集合:webpack, eslint, prettier, ...

    前端开发需要了解的工具集合:webpack, eslint, prettier, ... 前端开发需要了解的一些工具,这些工具能够帮助你在项目开发中事半功倍. 1. nrm: npm registry ...

  5. 使用stylelint对CSS/Sass做代码审查

    对样式审查?很少人会这么做吧,但实际上开发者应该有这样的态度,尤其是不同团队多人开发时,这一点尤为重要. 在本文中,我将陈述两点:一是为什么我们需要对样式进行审查,二是如何将审查工具融合到整体的构建流 ...

  6. eslint 代码规范

    官网:https://github.com/standard/standard/blob/master/docs/RULES-zhcn.md JavaScript Standard Style Eng ...

  7. webpack4.26的详细配置,包含babel, eslint, postcss, 及各种所需loader,内含大量注释

    github地址:https://github.com/qianxiaoning/demo-webpack4.26 内含详尽注释 欢迎大家star或者fork呀~ 目录结构: completeDemo ...

  8. stylelint — css书写规范

    sass lint guidance 一.安装:npm intsall -g stylelint 二.配置:http://stylelint.io/user-guide/rules/ (以下规则文件配 ...

  9. vscode 全局安装和配置 stylelint 像 webstorm 等 ide 一样来检查项目

    商店里安装完插件以后全局安装或者在项目中(记得加--save-dev)安装配置: npm install stylelint-config-recommended -g 然后在vscode setti ...

随机推荐

  1. PGSQL存储过程学习

    一.存储过程定义:   存储过程(Stored Procedure)是在大型数据库系统中,一组为了完成特定功能的SQL 语句集,它存储在数据库中,一次编译后永久有效,用户通过指定存储过程的名字并给出参 ...

  2. vue函数式组件详解

    本篇将详细介绍vue组件化之函数式组件,会用到以下api: Vue.component().Vue.extend().$createElement.patch(). 从事vue开发的小伙伴,平时组件化 ...

  3. 误改win10下的windowsapps文件夹权限,导致自带应用闪退问题

    在项目中,为了获得相关应用的具体位置(office的具体exe位置),修改了文件夹WindowsApps权限,导致所有自带应用打开闪退. 通过搜索相关资料,获得解决方法: 重置该文件的权限设置 ica ...

  4. 🔥 LeetCode 热题 HOT 100(31-40)

    75. 颜色分类 思路:将 2 往后放,0 往前放,剩余的1自然就放好了. 使用双指针:left.right 分别指向待插入的 0 和 2 的位置,初始 left 指向数组头,right 指向数组尾部 ...

  5. noip模拟29[简单的板子题](虽然我不会)

    \(noip模拟29\;solutions\) 这次考试给我最大的伤害,让我意识到了差距 这场考试可以说是非常的简单,就是简单到,看两眼,打个表就有结果了 但是呢?我考得非常的完蛋,只有30pts 据 ...

  6. Git常用命令和基础使用

    Git 参考:廖雪峰的Git教程 Git 常用命令 git config --global user.name "name" #配置git使用用户 git config --glo ...

  7. SQL遍历日期

    IF OBJECT_ID(N'tempdb..#temp', N'U') IS NOT NULL BEGIN DROP TABLE #temp;--临时表删除 END --创建临时表 CREATE T ...

  8. Vue 动态绑定CSS样式

    今天在做项目上遇见了一个需求,通过不能的进度类型展示不同的进度形态,进度形态通过背景色和背景色上的文字显示. 效果图: 由于Element UI版本我用的是2.5.4  使用进度条的话 就没有2.9. ...

  9. git从远程仓库里拉取一条本地不存在的分支

    查看远程分支和本地分支 git branch -va 当我想从远程仓库里拉取一条本地不存在的分支时: git checkout -b 本地分支名 origin/远程分支名 例如: 切换远程分支 git ...

  10. RSA加密算法学习

    一.公钥加密算法 对称加密 非对称加密 二.RSA加密算法