Skip to content

Commit

Permalink
fix(prettier-config): add arrowParens avoid to prevent regression via…
Browse files Browse the repository at this point in the history
… prettier 2.0
  • Loading branch information
JounQin committed Feb 1, 2020
1 parent abcf3a7 commit 1336067
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 182 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"devDependencies": {
"@angular/core": "^8.2.14",
"@types/jest": "^25.1.1",
"@types/node": "^13.5.3",
"@types/node": "^13.7.0",
"@types/react": "^16.9.19",
"@types/unist": "^2.0.3",
"core-js": "^3.6.4",
Expand All @@ -43,7 +43,7 @@
"resolutions": {
"@babel/core": "^7.8.4",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "prettier/prettier",
"prettier": "prettier/prettier#next",
"typescript": "^3.7.5"
},
"typeCoverage": {
Expand Down
1 change: 1 addition & 0 deletions packages/prettier-config/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
arrowParens: 'avoid',
htmlWhitespaceSensitivity: 'ignore',
semi: false,
singleQuote: true,
Expand Down
12 changes: 6 additions & 6 deletions tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ promisify(fs.readFile())

class Basic {}

function* generator() {
function *generator() {
yield '44'
yield '55'
}
Expand All @@ -20,11 +20,11 @@ function foo(cb1) {
bar()
}

foo(function() {
foo(function() {
foo(function() {
foo(function() {
foo(function() {
foo(function () {
foo(function () {
foo(function () {
foo(function () {
foo(function () {
// Do something
})
})
Expand Down
2 changes: 1 addition & 1 deletion tests/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface X {
p?: Position
}

function* generator() {
function *generator() {
yield '44'
yield '55'
}
Expand Down
5 changes: 1 addition & 4 deletions tests/test.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ export default Vue.extend({
await new Promise(resolve => {
setTimeout(resolve, 500)
})
this.msg = this.msg
.split('')
.reverse()
.join('')
this.msg = this.msg.split('').reverse().join('')
},
},
})
Expand Down
Loading

0 comments on commit 1336067

Please sign in to comment.