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

Commit

Permalink
Prepare release 4.1.0 (#1875)
Browse files Browse the repository at this point in the history
Update docs and changelog
  • Loading branch information
nchen63 authored and adidahiya committed Dec 15, 2016
1 parent 8f1daab commit 2218cfc
Show file tree
Hide file tree
Showing 10 changed files with 169 additions and 19 deletions.
145 changes: 145 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

19 changes: 10 additions & 9 deletions docs/_data/rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
{
"ruleName": "ban",
"description": "Bans the use of specific functions or global methods.",
"optionsDescription": "\nA list of `['object', 'method', 'optional explanation here']` or `['globalMethod']` which ban `object.method()` \nor respectively `globalMethod()`.",
"optionsDescription": "\nA list of `['object', 'method', 'optional explanation here']` or `['globalMethod']` which ban `object.method()`\nor respectively `globalMethod()`.",
"options": {
"type": "list",
"listType": {
Expand All @@ -83,7 +83,7 @@
}
},
"optionExamples": [
"[true, [\"someGlobalMethod\"], [\"someObject\", \"someFunction\"], \n [\"someObject\", \"otherFunction\", \"Optional explanation\"]]"
"[true, [\"someGlobalMethod\"], [\"someObject\", \"someFunction\"],\n [\"someObject\", \"otherFunction\", \"Optional explanation\"]]"
],
"type": "functionality",
"typescriptOnly": false
Expand Down Expand Up @@ -142,7 +142,7 @@
},
"optionExamples": [
"true",
"[true, [\"classes\", \"functions\"]"
"[true, \"classes\", \"functions\"]"
],
"type": "style",
"typescriptOnly": false
Expand Down Expand Up @@ -975,7 +975,7 @@
"ruleName": "object-literal-key-quotes",
"description": "Enforces consistent object literal property quote style.",
"descriptionDetails": "\nObject literal property names can be defined in two ways: using literals or using strings.\nFor example, these two objects are equivalent:\n\nvar object1 = {\n property: true\n};\n\nvar object2 = {\n \"property\": true\n};\n\nIn many cases, it doesn’t matter if you choose to use an identifier instead of a string\nor vice-versa. Even so, you might decide to enforce a consistent style in your code.\n\nThis rules lets you enforce consistent quoting of property names. Either they should always\nbe quoted (default behavior) or quoted only as needed (\"as-needed\").",
"optionsDescription": "\nPossible settings are:\n\n* `\"always\"`: Property names should always be quoted. (This is the default.)\n* `\"as-needed\"`: Only property names which require quotes may be quoted (e.g. those with spaces in them).\n* `\"consistent\"`: Property names should either all be quoted or unquoted.\n* `\"consistent-as-needed\"`: If any property name requires quotes, then all properties must be quoted. Otherwise, no \nproperty names may be quoted.\n\nFor ES6, computed property names (`{[name]: value}`) and methods (`{foo() {}}`) never need\nto be quoted.",
"optionsDescription": "\nPossible settings are:\n\n* `\"always\"`: Property names should always be quoted. (This is the default.)\n* `\"as-needed\"`: Only property names which require quotes may be quoted (e.g. those with spaces in them).\n* `\"consistent\"`: Property names should either all be quoted or unquoted.\n* `\"consistent-as-needed\"`: If any property name requires quotes, then all properties must be quoted. Otherwise, no\nproperty names may be quoted.\n\nFor ES6, computed property names (`{[name]: value}`) and methods (`{foo() {}}`) never need\nto be quoted.",
"options": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -1066,21 +1066,22 @@
"ruleName": "only-arrow-functions",
"description": "Disallows traditional (non-arrow) function expressions.",
"rationale": "Traditional functions don't bind lexical scope, which can lead to unexpected behavior when accessing 'this'.",
"optionsDescription": "\nOne argument may be optionally provided:\n\n* `\"allow-declarations\"` allows standalone function declarations.\n ",
"optionsDescription": "\nTwo arguments may be optionally provided:\n\n* `\"allow-declarations\"` allows standalone function declarations.\n* `\"allow-named-functions\"` allows the expression `function foo() {}` but not `function() {}`.\n ",
"options": {
"type": "array",
"items": {
"type": "string",
"enum": [
"allow-declarations"
"allow-declarations",
"allow-named-functions"
]
},
"minLength": 0,
"maxLength": 1
},
"optionExamples": [
"true",
"[true, \"allow-declarations\"]"
"[true, \"allow-declarations\", \"allow-named-functions\"]"
],
"type": "typescript",
"typescriptOnly": false
Expand All @@ -1089,7 +1090,7 @@
"ruleName": "ordered-imports",
"description": "Requires that import statements be alphabetized.",
"descriptionDetails": "\nEnforce a consistent ordering for ES6 imports:\n- Named imports must be alphabetized (i.e. \"import {A, B, C} from \"foo\";\")\n - The exact ordering can be controlled by the named-imports-order option.\n - \"longName as name\" imports are ordered by \"longName\".\n- Import sources must be alphabetized within groups, i.e.:\n import * as foo from \"a\";\n import * as bar from \"b\";\n- Groups of imports are delineated by blank lines. You can use these to group imports\n however you like, e.g. by first- vs. third-party or thematically.",
"optionsDescription": "\nYou may set the `\"import-sources-order\"` option to control the ordering of source\nimports (the `\"foo\"` in `import {A, B, C} from \"foo\"`).\n\nPossible values for `\"import-sources-order\"` are:\n* `\"case-insensitive'`: Correct order is `\"Bar\"`, `\"baz\"`, `\"Foo\"`. (This is the default.)\n* `\"lowercase-first\"`: Correct order is `\"baz\"`, `\"Bar\"`, `\"Foo\"`.\n* `\"lowercase-last\"`: Correct order is `\"Bar\"`, `\"Foo\"`, `\"baz\"`.\n* `\"any\"`: Allow any order.\n\nYou may set the `\"named-imports-order\"` option to control the ordering of named\nimports (the `{A, B, C}` in `import {A, B, C} from \"foo\"`).\n\nPossible values for `\"named-imports-order\"` are:\n\n* `\"case-insensitive'`: Correct order is `{A, b, C}`. (This is the default.)\n* `\"lowercase-first\"`: Correct order is `{b, A, C}`.\n* `\"lowercase-last\"`: Correct order is `{A, C, b}`.\n* `\"any\"`: Allow any order.\n\n ",
"optionsDescription": "\nYou may set the `\"import-sources-order\"` option to control the ordering of source\nimports (the `\"foo\"` in `import {A, B, C} from \"foo\"`).\n\nPossible values for `\"import-sources-order\"` are:\n\n* `\"case-insensitive'`: Correct order is `\"Bar\"`, `\"baz\"`, `\"Foo\"`. (This is the default.)\n* `\"lowercase-first\"`: Correct order is `\"baz\"`, `\"Bar\"`, `\"Foo\"`.\n* `\"lowercase-last\"`: Correct order is `\"Bar\"`, `\"Foo\"`, `\"baz\"`.\n* `\"any\"`: Allow any order.\n\nYou may set the `\"named-imports-order\"` option to control the ordering of named\nimports (the `{A, B, C}` in `import {A, B, C} from \"foo\"`).\n\nPossible values for `\"named-imports-order\"` are:\n\n* `\"case-insensitive'`: Correct order is `{A, b, C}`. (This is the default.)\n* `\"lowercase-first\"`: Correct order is `{b, A, C}`.\n* `\"lowercase-last\"`: Correct order is `{A, C, b}`.\n* `\"any\"`: Allow any order.\n\n ",
"options": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1187,7 +1188,7 @@
{
"ruleName": "radix",
"description": "Requires the radix parameter to be specified when calling `parseInt`.",
"rationale": "\nFrom [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt): \n> Always specify this parameter to eliminate reader confusion and to guarantee predictable behavior.\n> Different implementations produce different results when a radix is not specified, usually defaulting the value to 10.",
"rationale": "\nFrom [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt):\n> Always specify this parameter to eliminate reader confusion and to guarantee predictable behavior.\n> Different implementations produce different results when a radix is not specified, usually defaulting the value to 10.",
"optionsDescription": "Not configurable.",
"options": null,
"optionExamples": [
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/ban/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
description: Bans the use of specific functions or global methods.
optionsDescription: |-

A list of `['object', 'method', 'optional explanation here']` or `['globalMethod']` which ban `object.method()`
A list of `['object', 'method', 'optional explanation here']` or `['globalMethod']` which ban `object.method()`
or respectively `globalMethod()`.
options:
type: list
Expand All @@ -15,7 +15,7 @@
maxLength: 3
optionExamples:
- |-
[true, ["someGlobalMethod"], ["someObject", "someFunction"],
[true, ["someGlobalMethod"], ["someObject", "someFunction"],
["someObject", "otherFunction", "Optional explanation"]]
type: functionality
typescriptOnly: false
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/completed-docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
- properties
optionExamples:
- 'true'
- '[true, ["classes", "functions"]'
- '[true, "classes", "functions"]'
type: style
typescriptOnly: false
layout: rule
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/object-literal-key-quotes/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* `"always"`: Property names should always be quoted. (This is the default.)
* `"as-needed"`: Only property names which require quotes may be quoted (e.g. those with spaces in them).
* `"consistent"`: Property names should either all be quoted or unquoted.
* `"consistent-as-needed"`: If any property name requires quotes, then all properties must be quoted. Otherwise, no
* `"consistent-as-needed"`: If any property name requires quotes, then all properties must be quoted. Otherwise, no
property names may be quoted.

For ES6, computed property names (`{[name]: value}`) and methods (`{foo() {}}`) never need
Expand Down
9 changes: 6 additions & 3 deletions docs/rules/only-arrow-functions/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,23 @@
rationale: 'Traditional functions don''t bind lexical scope, which can lead to unexpected behavior when accessing ''this''.'
optionsDescription: |-

One argument may be optionally provided:
Two arguments may be optionally provided:

* `"allow-declarations"` allows standalone function declarations.
* `"allow-named-functions"` allows the expression `function foo() {}` but not `function() {}`.

options:
type: array
items:
type: string
enum:
- allow-declarations
- allow-named-functions
minLength: 0
maxLength: 1
optionExamples:
- 'true'
- '[true, "allow-declarations"]'
- '[true, "allow-declarations", "allow-named-functions"]'
type: typescript
typescriptOnly: false
layout: rule
Expand All @@ -29,7 +31,8 @@
"items": {
"type": "string",
"enum": [
"allow-declarations"
"allow-declarations",
"allow-named-functions"
]
},
"minLength": 0,
Expand Down
1 change: 1 addition & 0 deletions docs/rules/ordered-imports/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
imports (the `"foo"` in `import {A, B, C} from "foo"`).

Possible values for `"import-sources-order"` are:

* `"case-insensitive'`: Correct order is `"Bar"`, `"baz"`, `"Foo"`. (This is the default.)
* `"lowercase-first"`: Correct order is `"baz"`, `"Bar"`, `"Foo"`.
* `"lowercase-last"`: Correct order is `"Bar"`, `"Foo"`, `"baz"`.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/radix/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
description: Requires the radix parameter to be specified when calling `parseInt`.
rationale: |-

From [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt):
From [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt):
> Always specify this parameter to eliminate reader confusion and to guarantee predictable behavior.
> Different implementations produce different results when a radix is not specified, usually defaulting the value to 10.
optionsDescription: Not configurable.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tslint",
"version": "4.0.2",
"version": "4.1.0",
"description": "An extensible static analysis linter for the TypeScript language",
"bin": {
"tslint": "./bin/tslint"
Expand Down
2 changes: 1 addition & 1 deletion src/linter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import { arrayify, dedent } from "./utils";
* Linter that can lint multiple files in consecutive runs.
*/
class Linter {
public static VERSION = "4.0.2";
public static VERSION = "4.1.0";

public static findConfiguration = findConfiguration;
public static findConfigurationPath = findConfigurationPath;
Expand Down

0 comments on commit 2218cfc

Please sign in to comment.