Skip to content

Commit e74e728

Browse files
committed
passing linter
1 parent d26e5d3 commit e74e728

File tree

5 files changed

+17
-12
lines changed

5 files changed

+17
-12
lines changed

Diff for: src/binary-operator-printers/arithmetic.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { doc } from 'prettier';
22
import { comparison } from './comparison.js';
3+
import { rightOperand } from './right-operand.js';
34

4-
const { group, line, indent } = doc.builders;
5+
const { group, indent } = doc.builders;
56

67
const groupIfNecessaryBuilder = (path) => (document) => {
78
const parentNode = path.getParentNode();
@@ -30,11 +31,6 @@ export const indentIfNecessaryBuilder = (path) => (document) => {
3031
}
3132
};
3233

33-
export const rightOperand = (node, path, print, options) =>
34-
options.experimentalOperatorPosition === 'end'
35-
? [' ', node.operator, line, path.call(print, 'right')]
36-
: [line, node.operator, ' ', path.call(print, 'right')];
37-
3834
export const arithmetic = {
3935
match: (op) => ['+', '-', '*', '/', '%'].includes(op),
4036
print: (node, path, print, options) => {

Diff for: src/binary-operator-printers/comparison.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { doc } from 'prettier';
2-
import { rightOperand } from './arithmetic.js';
2+
import { rightOperand } from './right-operand.js';
33

4-
const { group, indent, line } = doc.builders;
4+
const { group, indent } = doc.builders;
55

66
const indentIfNecessaryBuilder = (path) => (document) => {
77
let node = path.getNode();

Diff for: src/binary-operator-printers/exponentiation.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { doc } from 'prettier';
2-
import { indentIfNecessaryBuilder, rightOperand } from './arithmetic.js';
2+
import { indentIfNecessaryBuilder } from './arithmetic.js';
3+
import { rightOperand } from './right-operand.js';
34

4-
const { group, line } = doc.builders;
5+
const { group } = doc.builders;
56

67
export const exponentiation = {
78
match: (op) => op === '**',

Diff for: src/binary-operator-printers/logical.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { doc } from 'prettier';
2-
import { rightOperand } from './arithmetic.js';
2+
import { rightOperand } from './right-operand.js';
33

4-
const { group, line, indent } = doc.builders;
4+
const { group, indent } = doc.builders;
55

66
const groupIfNecessaryBuilder = (path) => (document) =>
77
path.getParentNode().type === 'BinaryOperation' ? document : group(document);

Diff for: src/binary-operator-printers/right-operand.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { doc } from 'prettier';
2+
3+
const { line } = doc.builders;
4+
5+
export const rightOperand = (node, path, print, options) =>
6+
options.experimentalOperatorPosition === 'end'
7+
? [' ', node.operator, line, path.call(print, 'right')]
8+
: [line, node.operator, ' ', path.call(print, 'right')];

0 commit comments

Comments
 (0)