Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

[docs] no-string-throw: add missing examples. #3701

Merged
merged 4 commits into from
May 1, 2018
Merged

[docs] no-string-throw: add missing examples. #3701

merged 4 commits into from
May 1, 2018

Conversation

BB9z
Copy link
Contributor

@BB9z BB9z commented Feb 7, 2018

PR checklist

  • Addresses an existing issue: #0000
  • New feature, bugfix, or enhancement
    • Includes tests
  • Documentation update

Overview of change:

This PR is really simple. no-string-throw rule miss an example.

https://palantir.github.io/tslint/rules/no-string-throw/

Is there anything you'd like reviewers to focus on?

CHANGELOG.md entry:

@aervin
Copy link
Contributor

aervin commented Apr 21, 2018

@BB9z The ability to add code examples just landed in master. Will you please consider adding an example for this rule? I know it seems like a straightforward rule, but...

If you're willing, please see the curly rule for an example.

@BB9z
Copy link
Contributor Author

BB9z commented Apr 21, 2018

@aervin Just merge and check the latest code. no-string-throw rule has not options, so just [true] is enough.

@aervin
Copy link
Contributor

aervin commented Apr 21, 2018

@BB9z The code examples would still be helpful for some people I think:

Passes:

try {
    // ...
} catch (e) {
    throw e;
}

Fails:

try {
    // ...
} catch {
    throw 'There was a problem.';
}

The ability to add these examples to the docs was just added to master. The curly rule has this sort of documentation, as an example.

@BB9z
Copy link
Contributor Author

BB9z commented Apr 21, 2018

@aervin I see. The code examples have add into the rationale.

@aervin
Copy link
Contributor

aervin commented Apr 21, 2018

@BB9z Looking good! But please see these files for the best way to add code examples to rules:

@BB9z
Copy link
Contributor Author

BB9z commented Apr 21, 2018

@aervin done. Seems this is a new feature added two days ago :]

@suchanlee suchanlee merged commit 921bd43 into palantir:master May 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants