bind-comments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// yoyoyomamama comment on the file (note blank line after it) | |
// comment bound to function | |
function foo() { | |
// comment bound to if-statement | |
if (a) { | |
// comment bound to first block | |
b(); // comment bound to statement | |
} else if (b) { | |
// comment bound to second block | |
b(/* comment bound to expr */ 1); | |
} | |
} | |
// and so one. yah the devil is in the details but this is what we end up figuring out in tooling anyways | |
// so why not make it explicit with a few rules in the spec. the spec can also allow "free" comments i.e. | |
// all those that are not covered by any binding rules. Tooling keeps them with best-effort and linters | |
// can detect the presense of those. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment