-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
💄 linter error: Unexpected aliasing of 'this' to local variable #102
Comments
starting form here: pacta-dashboard-svelte/src/js/pie_exploded.js Lines 235 to 256 in e85aead
We can remove the textLabels.each(function () {
thisLabelDoc = d3.select(this);
y1 = thisLabelDoc.attr('y');
thisLabel = this; // eslint-disable-line
textLabels.each(function () {
thatLabelDoc = d3.select(this);
y2 = thatLabelDoc.attr('y');
if (thisLabel == this) return;
if (thisLabelDoc.attr('text-anchor') != thatLabelDoc.attr('text-anchor')) return;
deltaY = y1 - y2;
if (Math.abs(deltaY) > minLabelSpacing) return;
again = true;
sign = deltaY > 0 ? 1 : -1;
adjustment = sign * alpha;
thisLabelDoc.attr('y', +y1 + adjustment);
thatLabelDoc.attr('y', +y2 - adjustment);
});
}); I believe the intent of textLabels.each(function () {
thisLabelDoc = d3.select(this);
y1 = thisLabelDoc.attr('y');
textLabels.each(function () {
thatLabelDoc = d3.select(this);
y2 = thatLabelDoc.attr('y');
if (thisLabelDoc == thatLabelDoc) return;
if (thisLabelDoc.attr('text-anchor') != thatLabelDoc.attr('text-anchor')) return;
deltaY = y1 - y2;
if (Math.abs(deltaY) > minLabelSpacing) return;
again = true;
sign = deltaY > 0 ? 1 : -1;
adjustment = sign * alpha;
thisLabelDoc.attr('y', +y1 + adjustment);
thatLabelDoc.attr('y', +y2 - adjustment);
});
}); not exactly sure what an element of |
I have silenced the errors for now, but these lines are causing complaints:
pacta-dashboard-svelte/src/js/pie_exploded.js
Lines 235 to 241 in 5e08a8f
We should look into a solution (rather than just disabling the linter)
The text was updated successfully, but these errors were encountered: