-
Notifications
You must be signed in to change notification settings - Fork 485
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
fix: lends with object property using literal key #1035
fix: lends with object property using literal key #1035
Conversation
__tests__/fixture/lends.input.js
Outdated
@@ -6,6 +6,8 @@ | |||
export default TheClass( | |||
/** @lends TheClass.prototype */ | |||
{ | |||
/** My field */ | |||
myField: 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.
prettier or something similar is changing this line from "myField"
into myField
, ... looking for proper ignore annotation
17bdbbf
to
9fb7450
Compare
__tests__/fixture/lends.input.js
Outdated
@@ -6,6 +6,9 @@ | |||
export default TheClass( | |||
/** @lends TheClass.prototype */ | |||
{ | |||
/** My field */ | |||
// prettier-ignore |
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.
without prettier-ignore "myField"
will be changed into myField
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.
how about naming the field "my field"? Prettier only unquotes properties that are valid identifiers.
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.
right, thanks!
__tests__/fixture/lends.input.js
Outdated
@@ -6,6 +6,9 @@ | |||
export default TheClass( | |||
/** @lends TheClass.prototype */ | |||
{ | |||
/** My field */ | |||
// prettier-ignore |
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.
how about naming the field "my field"? Prettier only unquotes properties that are valid identifiers.
9fb7450
to
a3b3248
Compare
Thanks! 🎉 |
You're welcome! |
Good day,
This MR closes #840
At the moment if object property key is a literal it will not be processed correctly because conditions check for
NodePath.isIdentifier()
.