Conversation
| d3.select(el.parentNode).append('path') | ||
| .attr({ | ||
| 'class': el3.attr('class'), | ||
| class: el3.attr('class'), |
There was a problem hiding this comment.
@alexcjohnson Do you recall if quotes around class are needed here?
There was a problem hiding this comment.
class is a reserved word, so it made me squeamish to leave it unquoted. But This note implies it's been fine for quite a long time:
Note: ECMAScript 3 didn’t allow the use of unquoted reserved words as property names. Here’s the full list of ES3 reserved words: abstract, boolean, break, byte, case, catch, char, class, const, continue, debugger, default, delete, do, double, else, enum, export, extends, false, final, finally, float, for, function, goto, if, implements, import, in, instanceof, int, interface, long, native, new, null, package, private, protected, public, return, short, static, super, switch, synchronized, this, throw, throws, transient, true, try, typeof, var, void, volatile, while, and with. Avoid using these as unquoted property names if backwards compatibility is a concern.
This is fine in ES5 and beyond 🎉
alexcjohnson
left a comment
There was a problem hiding this comment.
Ha OK, this was a lot more widespread than I realized 😅
Thanks 💃
Addressing #6428 (comment) by using
as-neededoption.See https://eslint.org/docs/latest/rules/quote-props for more details.
Please note that for files in
lib/localesfolder the rule is set toconsistent.It is also disabled for
regl_precompiled.jsfiles by b8e0041.@plotly/plotly_js
You could simply run the following to fix all the files: