add eslint

vue-cli
Pan 2018-09-20 09:49:13 +08:00
parent 9105c44966
commit 19f045ca8a
3 changed files with 15 additions and 15 deletions

View File

@ -7,21 +7,21 @@ module.exports = {
env: { env: {
browser: true, browser: true,
node: true, node: true,
es6: true, es6: true
}, },
extends: ['plugin:vue/recommended', 'eslint:recommended'], extends: ['plugin:vue/recommended', 'eslint:recommended'],
// add your custom rules here // 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: { rules: {
"vue/max-attributes-per-line": [2, { 'vue/max-attributes-per-line': [2, {
"singleline": 10, 'singleline': 10,
"multiline": { 'multiline': {
"max": 1, 'max': 1,
"allowFirstLine": false 'allowFirstLine': false
} }
}], }],
"vue/name-property-casing": ["error", "PascalCase"], 'vue/name-property-casing': ['error', 'PascalCase'],
'accessor-pairs': 2, 'accessor-pairs': 2,
'arrow-spacing': [2, { 'arrow-spacing': [2, {
'before': true, 'before': true,

View File

@ -1,8 +1,8 @@
// https://github.com/michael-ciniawsky/postcss-load-config // https://github.com/michael-ciniawsky/postcss-load-config
module.exports = { module.exports = {
"plugins": { 'plugins': {
// to edit target browsers: use "browserslist" field in package.json // to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {} 'autoprefixer': {}
} }
} }

View File

@ -5,11 +5,10 @@
"description": "A vue admin template with Element UI & axios & iconfont & permission control & lint", "description": "A vue admin template with Element UI & axios & iconfont & permission control & lint",
"author": "Pan <panfree23@gmail.com>", "author": "Pan <panfree23@gmail.com>",
"scripts": { "scripts": {
"dev": "vue-cli-service serve --mode development", "dev": "vue-cli-service serve",
"start": "npm run dev", "build": "vue-cli-service build",
"build": "node build/build.js", "build:report": "vue-cli-service build --report",
"build:report": "npm_config_report=true npm run build", "lint": "vue-cli-service lint --ext .js,.vue src",
"lint": "eslint --ext .js,.vue src",
"test": "npm run lint", "test": "npm run lint",
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml" "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
}, },
@ -25,6 +24,7 @@
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "3.0.3", "@vue/cli-plugin-babel": "3.0.3",
"@vue/cli-plugin-eslint": "3.0.3",
"@vue/cli-service": "3.0.3", "@vue/cli-service": "3.0.3",
"node-sass": "^4.9.3", "node-sass": "^4.9.3",
"sass-loader": "7.1.0", "sass-loader": "7.1.0",