-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
doc, lib, test, tools: eliminate quote escaping #20214
doc, lib, test, tools: eliminate quote escaping #20214
Conversation
It seems this should only be backported to v10 (easy) and v8 (not so hard): v6 is almost on maintenance and v9 will be EOL soon. I can do both backportings then (proactively if requested). |
this seems pretty large and i think escaping looks better, its probably fine how it is? |
Let's see what others think, we can easily close this) |
@nodejs/linting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
¯\_(ツ)_/¯ I have no strong feelings either way.
Not a strong feeling, but I tend to side with @devsnek that this is a fair amount of churn that doesn't seem to substantially improve the code. But if others feel differently, I'm fine with it. I would ask that if you intend to land it on master soon, that you open backport PRs right away because it seems highly likely it will not cleanly cherry-pick to the staging branches. |
Actually, upon further review, I'm a little concerned by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, sorry, but I gotta -1 this, at least as long as allowTemplateLiterals
is in there. With this change, this becomes acceptable to the linter:
var http = require(`http`); // using backticks instead of single quotes!
I imagine I'm not the only one that wouldn't want to make the linter more lenient that way.
Ok, I will close due to doubts and concerns) |
@vsemozhetbyt when looking at these changes, it feels like 95% were not about using backticks and just improved the situation by switching to double quotes instead of having escaped single quotes in single quotes. |
@BridgeAR Yeah, but there were also shared concerns if this actually makes the code better, and I do not want to make collaborators disturbed over heavy nits without obvious improvements) |
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesCurrently, we have ESLint rule that allows using double quotes to reduce escaping of single quotes inside strings.
However, we have some flaws in this domain:
This PR tries to fix both:
It seems this change improves readability and sometimes reduces string concatenating due to a shorter length of fixed strings.
Refs: https://eslint.org/docs/rules/quotes