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

Updated "Output options" > "comments" in README.md #3717

Merged
merged 2 commits into from
Feb 15, 2020
Merged

Updated "Output options" > "comments" in README.md #3717

merged 2 commits into from
Feb 15, 2020

Conversation

marcogrcr
Copy link
Contributor

Expanded the current documentation to include:

  • What the value of "some" means based on lib/output.js.
  • Information about the Function overload parameters and expected output.

Expanded the current documentation to include:

- What the value of `"some"` means based on `lib/output.js`.
- Information about the `Function` overload parameters and expected output.
README.md Outdated
comments, `"some"` to preserve some comments, a regular expression string
(e.g. `/^!/`) or a function.
comments, `"some"` to preserve some comments (i.e. `/@preserve|@license|@cc_on/i`), a regular expression string
(e.g. `/^!/`), or a function that returns a *truthy/falsy* value that will be converted to `boolean` (e.g. `(_, comment) => preserveComment(comment.value)` where `preserveComment` is a user-defined function).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks good with two minor requests:

  • please format to ~80 characters per line
  • please use non-ES6 syntax for the function example, i.e.
function(node, comment) {
    return comment.value.indexOf("@type " + node.TYPE) >= 0;
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh and comments="some" only preserve multi-line comments that also matches the RegExp pattern, e.g. //@preserve will not be retained whilst /*@preserve*/ would.

@alexlamsl alexlamsl merged commit 31a7bf2 into mishoo:master Feb 15, 2020
@alexlamsl
Copy link
Collaborator

Thanks for improving documentation 👍

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.

None yet

2 participants