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
feat(eslint): update settings to remove editor errors #792
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #792 +/- ##
=======================================
- Coverage 40% 39.6% -0.41%
=======================================
Files 68 68
Lines 2217 2207 -10
Branches 633 632 -1
=======================================
- Hits 887 874 -13
Misses 1171 1171
- Partials 159 162 +3
Continue to review full report at Codecov.
|
.eslintrc.js
Outdated
"prefer-reflect": "off", | ||
"prefer-template": "off", | ||
"quote-props": "off", | ||
quotes: "off", |
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.
If you use doublequotes, maybe to enable this rule?
quotes: [2, "double", "avoid-escape"]
'commonjs': true, | ||
'es6': true | ||
env: { | ||
browser: true, |
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.
Why here not using quotes?
this breaks uniformity
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.
Because Prettier did it. It only escapes illegal object key identifiers. I personally like this, but ultimately, I just go with whatever the tool does for me. Had it maintained consistency, I would have deferred to that. I will say this: prettier is a fairly accurate representation of the majority consensus of js style. In other words: you may not like it, but most people do.
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.
My personal reason for appreciating dropping quoting object keys that are legal identifiers: it enables syntax highlighting. For me, string syntax highlighting gives me no indication of what the token is. I like being able to tell it's an object key. Not a big deal to me either way though. I just hit format, and move on. Guilty 😜
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.
there's eslint rule about this case - "quote-props"
currently it switched off, my offer to set it to: "quote-props": [2, "as-needed", { "keywords": true }]
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 use double quotes always in JSON object files, since quotes preferred over double quotes within source code around strings (unless the string has a lot of escaped single quotes), and literals for keys, unless they have unsupported characters.
Everyone has a personal taste ;-)
I find single quotes make the file lighter than double quotes (less black ink, heheh)
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'm just trying to let my OCD go to my tooling. Of course, then my tooling OCD becomes a problem...
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.
doublequotes are default setting for eslint
As stated, just trying to remove all the red squigglies from my editor.