Skip to content

Conversation

@edemaine
Copy link
Collaborator

@edemaine edemaine commented Jan 2, 2026

There was a TODO to support ###...### inline like /*...*/, and I did that. The TODO suggested restricting support to coffeeComment mode, but our current support for ###...### doesn't do that, so I didn't here, but left another note. Happy to restrict to coffeeComment if desired (though this would be a breaking change). Hmm, docs should reflect whatever we decide.

Jumped through a few hoops to preserve the whitespace and, when relevant, not add the automatic space before {. Code is a little ugly but it works.

Fixes #1826

@edemaine edemaine changed the title -> preserves whitespace/comments, support CoffeeScript comment blocks ###...### anywhere /*...*/ works -> preserves return value whitespace/comment; support CoffeeScript comment blocks ###...### anywhere /*...*/ works Jan 2, 2026
@Kristinita
Copy link

Type: Proposal

@edemaine, 3 weeks ago I created the pull request to the repository of the one ESLint plugin. In this pull request I prevented deletion of flotate comments by this plugin.

I created 10 tests in my pull request. A function may have 0, 1, or more parameters, single-line and multiline comments, and comments inside a function body. I have considered all these cases in my tests.

I think users will have fewer chances to get unexpected bugs if Civet will have similar tests for more cases of possible comments and parameters.

Thank you for the pull request.

@edemaine
Copy link
Collaborator Author

edemaine commented Jan 4, 2026

@Kristinita Thanks for the suggested tests! Because of the way the parser works, I don't think we need to add cases where comments are absent, but I added tests for the function style of functions and multiple arguments.

@edemaine edemaine merged commit 5f9b329 into main Jan 13, 2026
4 checks passed
@edemaine edemaine deleted the return-comment branch January 13, 2026 01:48
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.

Coffee-style comments for flotate return type annotation

3 participants