Skip to content

[RFC]: add REPL text lint rule for catching semicolon omission in examples #2428

Closed

Description

Description

This RFC proposes adding tooling support for warning when semicolons are omitted from examples in REPL text help files. For reference, semicolons are used to silence/suppress the display of return values in the REPL. As an example,

> function foo() { return 'bar'; }
> foo()
'bar'

The above should trigger a warning (or perhaps more strongly an error) to indicate that the function declaration should not be displayed as return output. Instead, the above should be

> function foo() { return 'bar'; };
> foo()
'bar'

Discussion of return value suppression can be found in the REPL developer guide: https://github.com/stdlib-js/stdlib/blob/481690174833259628032a259dbe7d26bbde807d/docs/repl_text.md#examples.

Related Issues

n/a

Questions

No.

Other

No.

Checklist

  • I have read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
  • The issue name begins with RFC:.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

AcceptedRFC feature request which has been accepted.Help WantedExtra attention is needed.REPLIssue or pull request specific to the project REPL.RFCRequest for comments. Feature requests and proposed changes.ToolsIssue or pull request related to project tooling.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions