Skip to content

Commit a6b3968

Browse files
authored
prettier:fix (#254)
1 parent 689f266 commit a6b3968

18 files changed

+38
-38
lines changed

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"codecov": "^3.6.5",
6565
"eslint": "^6.8.0",
6666
"eslint-config-airbnb-base": "^14.1.0",
67-
"eslint-config-prettier": "^6.10.0",
67+
"eslint-config-prettier": "^6.10.1",
6868
"eslint-plugin-import": "^2.20.1",
6969
"jest": "^25.1.0",
7070
"jest-mock-now": "^1.3.0",
@@ -75,7 +75,7 @@
7575
"emoji-regex": "^8.0.0",
7676
"escape-string-regexp": "^2.0.0",
7777
"extract-comments": "^1.1.0",
78-
"prettier": "^1.19.1",
78+
"prettier": "^2.0.2",
7979
"semver": "^7.1.3",
8080
"solidity-parser-diligence": "^0.4.18",
8181
"string-width": "^4.2.0"

src/binary-operator-printers/arithmetic.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const {
55
} = require('prettier/standalone');
66
const comparison = require('./comparison.js');
77

8-
const groupIfNecessaryBuilder = path => doc => {
8+
const groupIfNecessaryBuilder = (path) => (doc) => {
99
const parentNode = path.getParentNode();
1010
if (
1111
parentNode.type === 'BinaryOperation' &&
@@ -16,7 +16,7 @@ const groupIfNecessaryBuilder = path => doc => {
1616
return group(doc);
1717
};
1818

19-
const indentIfNecessaryBuilder = path => doc => {
19+
const indentIfNecessaryBuilder = (path) => (doc) => {
2020
let node = path.getNode();
2121
for (let i = 0; ; i += 1) {
2222
const parentNode = path.getParentNode(i);
@@ -33,7 +33,7 @@ const indentIfNecessaryBuilder = path => doc => {
3333
};
3434

3535
module.exports = {
36-
match: op => ['+', '-', '*', '/', '%'].includes(op),
36+
match: (op) => ['+', '-', '*', '/', '%'].includes(op),
3737
print: (node, path, print) => {
3838
const groupIfNecessary = groupIfNecessaryBuilder(path);
3939
const indentIfNecessary = indentIfNecessaryBuilder(path);

src/binary-operator-printers/assignment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const {
55
} = require('prettier/standalone');
66

77
module.exports = {
8-
match: op =>
8+
match: (op) =>
99
[
1010
'=',
1111
'|=',
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const arithmetic = require('./arithmetic.js');
22

33
module.exports = {
4-
match: op => ['&', '|', '^'].includes(op),
4+
match: (op) => ['&', '|', '^'].includes(op),
55
print: arithmetic.print
66
};

src/binary-operator-printers/comparison.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const {
44
}
55
} = require('prettier/standalone');
66

7-
const indentIfNecessaryBuilder = path => doc => {
7+
const indentIfNecessaryBuilder = (path) => (doc) => {
88
let node = path.getNode();
99
for (let i = 0; ; i += 1) {
1010
const parentNode = path.getParentNode(i);
@@ -19,7 +19,7 @@ const indentIfNecessaryBuilder = path => doc => {
1919
};
2020

2121
module.exports = {
22-
match: op => ['<', '>', '<=', '>=', '==', '!='].includes(op),
22+
match: (op) => ['<', '>', '<=', '>=', '==', '!='].includes(op),
2323
print: (node, path, print) => {
2424
const indentIfNecessary = indentIfNecessaryBuilder(path);
2525

src/binary-operator-printers/exponentiation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const {
55
} = require('prettier/standalone');
66

77
module.exports = {
8-
match: op => op === '**',
8+
match: (op) => op === '**',
99
print: (node, path, print) => {
1010
const right = concat([
1111
ifBreak(' ', ''),

src/binary-operator-printers/logical.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ const {
44
}
55
} = require('prettier/standalone');
66

7-
const groupIfNecessaryBuilder = path => doc =>
7+
const groupIfNecessaryBuilder = (path) => (doc) =>
88
path.getParentNode().type === 'BinaryOperation' ? doc : group(doc);
99

10-
const indentIfNecessaryBuilder = path => doc => {
10+
const indentIfNecessaryBuilder = (path) => (doc) => {
1111
let node = path.getNode();
1212
for (let i = 0; ; i += 1) {
1313
const parentNode = path.getParentNode(i);
@@ -21,7 +21,7 @@ const indentIfNecessaryBuilder = path => doc => {
2121
};
2222

2323
module.exports = {
24-
match: op => ['&&', '||'].includes(op),
24+
match: (op) => ['&&', '||'].includes(op),
2525
print: (node, path, print) => {
2626
const groupIfNecessary = groupIfNecessaryBuilder(path);
2727
const indentIfNecessary = indentIfNecessaryBuilder(path);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const arithmetic = require('./arithmetic.js');
22

33
module.exports = {
4-
match: op => ['<<', '>>'].includes(op),
4+
match: (op) => ['<<', '>>'].includes(op),
55
print: arithmetic.print
66
};

src/comments/printer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function isIndentableBlockComment(comment) {
1111
// `*/` delimiters are not included in the comment value, so add them
1212
// back first.
1313
const lines = `*${comment.raw}*`.split('\n');
14-
return lines.length > 1 && lines.every(line => line.trim()[0] === '*');
14+
return lines.length > 1 && lines.every((line) => line.trim()[0] === '*');
1515
}
1616

1717
function printIndentableBlockComment(comment) {

0 commit comments

Comments
 (0)