Skip to content

Conversation

@fengkx
Copy link

@fengkx fengkx commented Feb 23, 2024

πŸ”— Linked issue

#21

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

I've tried to implement part of the functionality and turning on the WIP Pull Request first. Would like to have comments and suggestions for this API design.

Here are some choices I have made.

  1. mod.exports.default.a.$comment = 'asdsad' // throw Error because mod.exports.default.a is proxied to a string , So I make $comment on every object for now. Take a look at the test cases for exampes.
  2. Always use leadding comment block instead of comment line
  3. If it has multipe comment on one node, getter will join them with newline('\n')

Question

How to deal with array field for example:

export defaut {
	urls: [
		/* comment about first url */
		"http://example.com",
		/* comment about second url */
		"http://example2.com"
	]
}

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@fengkx fengkx changed the title [WIP] [WIP] support $comment Feb 23, 2024
@fengkx
Copy link
Author

fengkx commented Feb 23, 2024

@antfu Would you take a look on the API?

@Hugos68
Copy link

Hugos68 commented Jan 11, 2025

I'm in a big need of this, this would be awesome!

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.

2 participants