Skip to content
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

Merged

Conversation

maciej-ka
Copy link
Contributor

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().

@@ -6,6 +6,8 @@
export default TheClass(
/** @lends TheClass.prototype */
{
/** My field */
myField: true,
Copy link
Contributor Author

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

@maciej-ka maciej-ka force-pushed the fix-lends-with-literal-property-key branch from 17bdbbf to 9fb7450 Compare March 3, 2018 18:46
@@ -6,6 +6,9 @@
export default TheClass(
/** @lends TheClass.prototype */
{
/** My field */
// prettier-ignore
Copy link
Contributor Author

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

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, thanks!

@coveralls
Copy link

coveralls commented Mar 3, 2018

Coverage Status

Coverage remained the same at 86.209% when pulling a3b3248 on maciej-ka:fix-lends-with-literal-property-key into e1528c4 on documentationjs:master.

@@ -6,6 +6,9 @@
export default TheClass(
/** @lends TheClass.prototype */
{
/** My field */
// prettier-ignore
Copy link
Member

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.

@maciej-ka maciej-ka force-pushed the fix-lends-with-literal-property-key branch from 9fb7450 to a3b3248 Compare March 4, 2018 01:20
@tmcw
Copy link
Member

tmcw commented Mar 4, 2018

Thanks! 🎉

@tmcw tmcw merged commit 99ad49b into documentationjs:master Mar 4, 2018
@maciej-ka
Copy link
Contributor Author

maciej-ka commented Mar 4, 2018

You're welcome!
Any suggestions for "good-second-contribution"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quoted property names ignore @lends
3 participants