zoukankan      html  css  js  c++  java
  • eslint and stylelint config

    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"
  • 相关阅读:
    1507. Reformat Date
    430. Flatten a Multilevel Doubly Linked List
    Java 面试
    429. N-ary Tree Level Order Traversal
    637. Average of Levels in Binary Tree
    662. Maximum Width of Binary Tree
    463. Island Perimeter
    PHP error_reporting() 函数设置应该报告何种 PHP 错误
    php+js实现极验滑块拖动验证码-tncode【转】
    Cocos Creator 动态改变sprite图片【转】
  • 原文地址:https://www.cnblogs.com/RainyBear/p/12973341.html
Copyright © 2011-2022 走看看