Short rule should only apply to the first identifier (#4575)
parent
2505926533
commit
a6db391556
|
@ -4477,9 +4477,7 @@ function printMemberChain(path, options, print) {
|
|||
(lastNode.type === "MemberExpression" ||
|
||||
lastNode.type === "OptionalMemberExpression") &&
|
||||
lastNode.property.type === "Identifier" &&
|
||||
(isFactory(lastNode.property.name) ||
|
||||
(isExpression && isShort(lastNode.property.name)) ||
|
||||
hasComputed)
|
||||
(isFactory(lastNode.property.name) || hasComputed)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -494,6 +494,15 @@ d3.select('body')
|
|||
d3.scaleLinear()
|
||||
.domain([1950, 1980])
|
||||
.range([0, width])
|
||||
|
||||
not.d3.select('body')
|
||||
.append('circle')
|
||||
.at({ width: 30, fill: '#f0f' })
|
||||
.st({ fontWeight: 600 })
|
||||
|
||||
not.d3.scaleLinear()
|
||||
.domain([1950, 1980])
|
||||
.range([0, width])
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
d3.select("body")
|
||||
.append("circle")
|
||||
|
@ -504,6 +513,17 @@ d3.scaleLinear()
|
|||
.domain([1950, 1980])
|
||||
.range([0, width]);
|
||||
|
||||
not.d3
|
||||
.select("body")
|
||||
.append("circle")
|
||||
.at({ width: 30, fill: "#f0f" })
|
||||
.st({ fontWeight: 600 });
|
||||
|
||||
not.d3
|
||||
.scaleLinear()
|
||||
.domain([1950, 1980])
|
||||
.range([0, width]);
|
||||
|
||||
`;
|
||||
|
||||
exports[`first_long.js 1`] = `
|
||||
|
|
|
@ -6,3 +6,12 @@ d3.select('body')
|
|||
d3.scaleLinear()
|
||||
.domain([1950, 1980])
|
||||
.range([0, width])
|
||||
|
||||
not.d3.select('body')
|
||||
.append('circle')
|
||||
.at({ width: 30, fill: '#f0f' })
|
||||
.st({ fontWeight: 600 })
|
||||
|
||||
not.d3.scaleLinear()
|
||||
.domain([1950, 1980])
|
||||
.range([0, width])
|
||||
|
|
Loading…
Reference in New Issue