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

Documentation issue, Library Usage page #2768

Closed
rich-newman opened this issue May 15, 2017 · 2 comments
Closed

Documentation issue, Library Usage page #2768

rich-newman opened this issue May 15, 2017 · 2 comments

Comments

@rich-newman
Copy link
Contributor

Your Library Usage page has sample code that no longer works, I think. The linter options now have to include a mandatory 'fix' flag, so the declaration of 'options' should look like:

const options = { fix: false, formatter: "json", rulesDirectory: "customRules/", formattersDirectory: "customFormatters/" };

Also as far as I can work out the code on the page won't work directly with node.js, which doesn't (yet) recognize the ES6 'import' syntax. This in spite of a title that says 'Using TSLint as a Node.js library'.

Can I politely suggest that it might be better to have JavaScript code that will run immediately with node here, rather than or as well as the TypeScript/ES6? It would save everyone having to edit it or transpile it to run it.

I'm happy to raise a PR for these if you like.

@adidahiya
Copy link
Contributor

Good points of feedback. Would be happy to accept those fixes / changes in a PR.

rich-newman added a commit to rich-newman/tslint that referenced this issue May 16, 2017
adidahiya pushed a commit that referenced this issue May 17, 2017
* Fix sample code for recent changes, show ES5 JavaScript code that will run with node (#2768)
* Fixes requested: no console.log, consistent use of spaces, boolean flag not literal
@ajafff
Copy link
Contributor

ajafff commented Oct 31, 2017

Fixed by #2772

@ajafff ajafff closed this as completed Oct 31, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants