Skip to content

Commit

Permalink
feat: support Prettier eslint config (pending)
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 16, 2018
1 parent a4fbee1 commit d84df9a
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 5 deletions.
5 changes: 4 additions & 1 deletion packages/@vue/cli-plugin-eslint/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ module.exports = (api, { config, lintOn = [] }) => {
'@vue/eslint-config-standard': '^3.0.0-alpha.1'
})
} else if (config === 'prettier') {
// TODO
pkg.eslintConfig.extends.push('@vue/prettier')
Object.assign(pkg.devDependencies, {
'@vue/eslint-config-prettier': '^3.0.0-alpha.1'
})
} else {
// default
pkg.eslintConfig.extends.push('eslint:recommended')
Expand Down
9 changes: 9 additions & 0 deletions packages/@vue/eslint-config-prettier/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
plugins: ['prettier'],
extends: [
require.resolve('eslint-config-prettier')
],
rules: {
'prettier/prettier': 'error'
}
}
7 changes: 6 additions & 1 deletion packages/@vue/eslint-config-prettier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@
"bugs": {
"url": "https://github.com/vuejs/vue-cli/issues"
},
"homepage": "https://github.com/vuejs/vue-cli/packages/@vue/eslint-config-prettier#readme"
"homepage": "https://github.com/vuejs/vue-cli/packages/@vue/eslint-config-prettier#readme",
"dependencies": {
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-prettier": "^2.4.0",
"prettier": "^1.10.2"
}
}
30 changes: 27 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ babel-plugin-syntax-object-rest-spread@^6.13.0:
version "6.13.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5"

babel-plugin-transform-es2015-modules-commonjs@^6.24.1, babel-plugin-transform-es2015-modules-commonjs@^6.26.0:
babel-plugin-transform-es2015-modules-commonjs@^6.24.1:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz#0d8394029b7dc6abe1a97ef181e00758dd2e5d8a"
dependencies:
Expand Down Expand Up @@ -3141,6 +3141,12 @@ eslint-config-airbnb-base@^12.1.0:
dependencies:
eslint-restricted-globals "^0.1.1"

eslint-config-prettier@^2.9.0:
version "2.9.0"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.9.0.tgz#5ecd65174d486c22dff389fe036febf502d468a3"
dependencies:
get-stdin "^5.0.1"

eslint-config-standard@^11.0.0-beta.0:
version "11.0.0-beta.0"
resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-11.0.0-beta.0.tgz#f8afe69803d95c685a4b8392b8793188eb03cbb3"
Expand Down Expand Up @@ -3215,6 +3221,13 @@ eslint-plugin-node@^5.2.1:
resolve "^1.3.3"
semver "5.3.0"

eslint-plugin-prettier@^2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.4.0.tgz#85cab0775c6d5e3344ef01e78d960f166fb93aae"
dependencies:
fast-diff "^1.1.1"
jest-docblock "^21.0.0"

eslint-plugin-promise@^3.6.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-3.6.0.tgz#54b7658c8f454813dc2a870aff8152ec4969ba75"
Expand Down Expand Up @@ -3558,6 +3571,10 @@ fast-deep-equal@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff"

fast-diff@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.2.tgz#4b62c42b8e03de3f848460b639079920695d0154"

fast-extend@0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/fast-extend/-/fast-extend-0.0.2.tgz#f5ec42cf40b9460f521a6387dfb52deeed671dbd"
Expand Down Expand Up @@ -3963,6 +3980,10 @@ get-stdin@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe"

get-stdin@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398"

get-stream@^2.2.0:
version "2.3.1"
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de"
Expand Down Expand Up @@ -5125,6 +5146,10 @@ jest-diff@^22.1.0:
jest-get-type "^22.1.0"
pretty-format "^22.1.0"

jest-docblock@^21.0.0:
version "21.2.0"
resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414"

jest-docblock@^22.1.0:
version "22.1.0"
resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-22.1.0.tgz#3fe5986d5444cbcb149746eb4b07c57c5a464dfd"
Expand Down Expand Up @@ -7182,7 +7207,7 @@ preserve@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"

prettier@^1.7.0:
prettier@^1.10.2, prettier@^1.7.0:
version "1.10.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.10.2.tgz#1af8356d1842276a99a5b5529c82dd9e9ad3cc93"

Expand Down Expand Up @@ -9223,7 +9248,6 @@ vue-jest@yyx990803/vue-jest:
version "1.4.0"
resolved "https://codeload.github.com/yyx990803/vue-jest/tar.gz/2ce12141b70161893982325ea72f1f2dcfdc6f04"
dependencies:
babel-plugin-transform-es2015-modules-commonjs "^6.26.0"
chalk "^2.1.0"
find-babel-config "^1.1.0"
js-beautify "^1.6.14"
Expand Down

0 comments on commit d84df9a

Please sign in to comment.