Inline _ or $ in the root of a method chain (#4621)
parent
26b13b6274
commit
a4da6e6c8e
|
@ -4440,10 +4440,11 @@ function printMemberChain(path, options, print) {
|
|||
// .map(x => x)
|
||||
//
|
||||
// In order to detect those cases, we use an heuristic: if the first
|
||||
// node is an identifier with the name starting with a capital letter.
|
||||
// The rationale is that they are likely to be factories.
|
||||
// node is an identifier with the name starting with a capital
|
||||
// letter or just a sequence of _$. The rationale is that they are
|
||||
// likely to be factories.
|
||||
function isFactory(name) {
|
||||
return /^[A-Z]/.test(name);
|
||||
return /^[A-Z]|^[_$]+$/.test(name);
|
||||
}
|
||||
|
||||
// In case the Identifier is shorter than tab width, we can keep the
|
||||
|
|
|
@ -607,6 +607,16 @@ Object.keys(
|
|||
.forEach(locale => {
|
||||
// ...
|
||||
});
|
||||
|
||||
this.layoutPartsToHide = this.utils.hashset(
|
||||
_.flatMap(this.visibilityHandlers, fn => fn())
|
||||
.concat(this.record.resolved_legacy_visrules)
|
||||
.filter(Boolean)
|
||||
);
|
||||
|
||||
var jqxhr = $.ajax("example.php")
|
||||
.done(doneFn)
|
||||
.fail(failFn);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Object.keys(
|
||||
availableLocales({
|
||||
|
@ -616,6 +626,16 @@ Object.keys(
|
|||
// ...
|
||||
});
|
||||
|
||||
this.layoutPartsToHide = this.utils.hashset(
|
||||
_.flatMap(this.visibilityHandlers, fn => fn())
|
||||
.concat(this.record.resolved_legacy_visrules)
|
||||
.filter(Boolean)
|
||||
);
|
||||
|
||||
var jqxhr = $.ajax("example.php")
|
||||
.done(doneFn)
|
||||
.fail(failFn);
|
||||
|
||||
`;
|
||||
|
||||
exports[`logical.js 1`] = `
|
||||
|
|
|
@ -6,3 +6,13 @@ Object.keys(
|
|||
.forEach(locale => {
|
||||
// ...
|
||||
});
|
||||
|
||||
this.layoutPartsToHide = this.utils.hashset(
|
||||
_.flatMap(this.visibilityHandlers, fn => fn())
|
||||
.concat(this.record.resolved_legacy_visrules)
|
||||
.filter(Boolean)
|
||||
);
|
||||
|
||||
var jqxhr = $.ajax("example.php")
|
||||
.done(doneFn)
|
||||
.fail(failFn);
|
||||
|
|
Loading…
Reference in New Issue