From 19f045ca8ac5b2ab6f38ab6ff1a557fc12f5a8ea Mon Sep 17 00:00:00 2001 From: Pan Date: Thu, 20 Sep 2018 09:49:13 +0800 Subject: [PATCH] add eslint --- .eslintrc.js | 16 ++++++++-------- .postcssrc.js | 4 ++-- package.json | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 0e5c28a..e56e590 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -7,21 +7,21 @@ module.exports = { env: { browser: true, node: true, - es6: true, + es6: true }, extends: ['plugin:vue/recommended', 'eslint:recommended'], // add your custom rules here - //it is base on https://github.com/vuejs/eslint-config-vue + // it is base on https://github.com/vuejs/eslint-config-vue rules: { - "vue/max-attributes-per-line": [2, { - "singleline": 10, - "multiline": { - "max": 1, - "allowFirstLine": false + 'vue/max-attributes-per-line': [2, { + 'singleline': 10, + 'multiline': { + 'max': 1, + 'allowFirstLine': false } }], - "vue/name-property-casing": ["error", "PascalCase"], + 'vue/name-property-casing': ['error', 'PascalCase'], 'accessor-pairs': 2, 'arrow-spacing': [2, { 'before': true, diff --git a/.postcssrc.js b/.postcssrc.js index 09948d6..10473ef 100644 --- a/.postcssrc.js +++ b/.postcssrc.js @@ -1,8 +1,8 @@ // https://github.com/michael-ciniawsky/postcss-load-config module.exports = { - "plugins": { + 'plugins': { // to edit target browsers: use "browserslist" field in package.json - "autoprefixer": {} + 'autoprefixer': {} } } diff --git a/package.json b/package.json index c6522f0..4762fe0 100644 --- a/package.json +++ b/package.json @@ -5,11 +5,10 @@ "description": "A vue admin template with Element UI & axios & iconfont & permission control & lint", "author": "Pan ", "scripts": { - "dev": "vue-cli-service serve --mode development", - "start": "npm run dev", - "build": "node build/build.js", - "build:report": "npm_config_report=true npm run build", - "lint": "eslint --ext .js,.vue src", + "dev": "vue-cli-service serve", + "build": "vue-cli-service build", + "build:report": "vue-cli-service build --report", + "lint": "vue-cli-service lint --ext .js,.vue src", "test": "npm run lint", "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml" }, @@ -25,6 +24,7 @@ }, "devDependencies": { "@vue/cli-plugin-babel": "3.0.3", + "@vue/cli-plugin-eslint": "3.0.3", "@vue/cli-service": "3.0.3", "node-sass": "^4.9.3", "sass-loader": "7.1.0",