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

Blog entry for 4.0 #1734

Merged
merged 4 commits into from
Nov 18, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/build/
/docs/site/
/scripts/*.js
/scripts/*.js.map
/lib/
/test/executable/tslint.json
node_modules/
Expand Down
58 changes: 58 additions & 0 deletions docs/_posts/2016-11-17-new-for-4.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
layout: post
title: "New for 4.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

I might call this "TSLint 4.0 Released", but up to you

date: 2016-11-17 15:19:00
---

TSLint [4.0][0] has been released! With this release comes a few exciting [changes][1]. Some of the highlights:
* **Fixers** - Do you dread turning on a new rule because of all of the new errors? For some of the most common issues, we'll fix them for you. To use this feature, run `tslint` with the `--fix` option. Here are the rules we fix right now:
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of "rules we fix" might say "rules that support --fix" or something

Copy link
Contributor

Choose a reason for hiding this comment

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

can you also write about & provide examples of how to implement a fixer (perhaps suggest that it's easy) to encourage contributions?

* [array-type][2]
* [arrow-parens][3]
* [no-unused-variable][4] (for imports)
* [no-var-keyword][5]
* [ordered-imports][6]
* [semicolon][7]
* [trailing-comma][8]
* **Linting `.js` files** - Make migrating from JavaScript even easier! Just add a `jsRules` [section][9] to your `tslint.json` file.
Copy link
Contributor

Choose a reason for hiding this comment

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

this isn't exactly the purpose... the purpose here is so that users don't have to use two linters (if they are considering tslint while migrating, they almost certainly were using eslint before). also note that it was a highly requested community feature (we didn't drive it)

Copy link
Contributor

Choose a reason for hiding this comment

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

I've wondered how jsRules fits in. Is it only for React? I don't know why I think that. Is there something written up about it?

I know there is https://github.com/buzinas/tslint-eslint-rules, maybe we reference that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I looked at the original ticket, and migrating was one of the reasons given. Can change the text, though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@olore jsRules is another set of rules (from the same general pool of TSLint rules) that runs on .js files. Previously, TSLint would just error when given a .js file. Since JavaScript is a subset of TypeScript, some of the same rules can be applied to them

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks @nchen63

* **TypeScript 2.0+ required** - This lets us deprecate/remove rules that are checked by the compiler.
Copy link
Contributor

Choose a reason for hiding this comment

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

might be worth detailing which compiler features?

Copy link
Contributor

@olore olore Nov 17, 2016

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@olore thanks!

* **API Change** - [Moved and renamed][11] some things to make more sense.
Copy link
Contributor

Choose a reason for hiding this comment

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

can you clarify that this is the Node.js API and the imports, in particular, are simpler

* **Recommended Rules [Updated][12]**
* [adjacent-overload-signatures][13]
* [array-type][14]
* [arrow-parens][15]
* [max-classes-per-file][16]
* [no-unsafe-finally][17]
* [object-literal-key-quotes][18] (as needed)
* [object-literal-shorthand][19]
* [only-arrow-functions][20]
* [ordered-imports][21]
* [prefer-for-of][22]
* **Other rules you might find handy**:
* [completed-docs][23]
* [cyclomatic-complexity][24]

[0]: https://github.com/palantir/tslint/releases
[1]: https://github.com/palantir/tslint/blob/master/CHANGELOG.md
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe link to release instead of the changelog?

[2]: {{ site.baseurl }}/rules/array-type
[3]: {{ site.baseurl }}/rules/arrow-parens
[4]: {{ site.baseurl }}/rules/no-unused-variable
[5]: {{ site.baseurl }}/rules/no-var-keyword
[6]: {{ site.baseurl }}/rules/ordered-imports
[7]: {{ site.baseurl }}/rules/semicolon
[8]: {{ site.baseurl }}/rules/trailing-comma
[9]: https://raw.githubusercontent.com/palantir/tslint/master/src/configs/recommended.ts
[10]: {{ site.baseurl }}/usage/third-party-tools/
[11]: https://github.com/palantir/tslint/pull/1720
[12]: https://github.com/palantir/tslint/pull/1717/files#diff-6e3940e8ec3d59837c4435f32975ed2c
[13]: {{ site.baseurl }}/rules/adjacent-overload-signatures
[14]: {{ site.baseurl }}/rules/array-type
[15]: {{ site.baseurl }}/rules/arrow-parens
[16]: {{ site.baseurl }}/rules/max-classes-per-file
[17]: {{ site.baseurl }}/rules/no-unsafe-finally
[18]: {{ site.baseurl }}/rules/object-literal-key-quotes
[19]: {{ site.baseurl }}/rules/object-literal-shorthand
[20]: {{ site.baseurl }}/rules/only-arrow-functions
[21]: {{ site.baseurl }}/rules/ordered-imports
[22]: {{ site.baseurl }}/rules/prefer-for-of
[23]: {{ site.baseurl }}/rules/completed-docs
[24]: {{ site.baseurl }}/rules/cyclomatic-complexity