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

Commit

Permalink
Merge pull request #1992 from palantir/next-4.3.0
Browse files Browse the repository at this point in the history
Prepare v4.3.0-dev.0
  • Loading branch information
nchen63 authored Jan 6, 2017
2 parents 1d521bc + 3b87ba9 commit 9a38cdc
Show file tree
Hide file tree
Showing 209 changed files with 4,730 additions and 812 deletions.
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- [ ] New feature, bugfix, or enhancement
- [ ] Includes tests
- [ ] Documentation update
- [ ] Enable CircleCI for your fork (https://circleci.com/add-projects)

#### What changes did you make?

Expand Down
14 changes: 5 additions & 9 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
},
"console": "internalConsole",
"sourceMaps": true,
"outFiles": [],
"outDir": "${workspaceRoot}/build"
"outFiles": ["${workspaceRoot}/build/**/*.js"]
},
{
"name": "Debug Mocha Tests",
Expand All @@ -40,8 +39,7 @@
},
"console": "internalConsole",
"sourceMaps": true,
"outFiles": [],
"outDir": "${workspaceRoot}/build"
"outFiles": ["${workspaceRoot}/build/**/*.js"]
},
{
"name": "Debug Rule Tests",
Expand All @@ -61,8 +59,7 @@
},
"console": "internalConsole",
"sourceMaps": true,
"outFiles": [],
"outDir": "${workspaceRoot}/build"
"outFiles": ["${workspaceRoot}/build/**/*.js"]
},
{
"name": "Debug Document Generation",
Expand All @@ -82,8 +79,7 @@
},
"console": "internalConsole",
"sourceMaps": true,
"outFiles": [],
"outDir": "${workspaceRoot}/build"
"outFiles": ["${workspaceRoot}/build/**/*/js"]
}
]
}
}
57 changes: 57 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,54 @@
Change Log
===

v4.3.0-dev.0
---

* Include latest v4.3.1 changes

v4.3.1
---

* [bugfix] Fix back-compat break. Allow formattersDirectory === null (#1997)

v4.3.0
---

* **Enabled additional rules in `tslint:latest` configuration** (#1981)
* [new-rule] `space-before-function-paren` (#1897)
* [new-rule] `typeof-compare` (#1927)
* [new-rule] `import-spacing` (#1935)
* [new-rule] `unified-signatures` (#1944)
* [new-fixer] `object-literal-key-quotes` (#1953)
* [new-fixer] `no-angle-bracket-type-assertion` (#1979)
* [bugfix] `adjacent-overload-signature` now handles static/computed function names (#1831)
* [bugfix] `file-header` now handles files with only comments (#1913)
* [bugfix] `no-consecutive-blank-lines` now allows blank lines in template strings (#1886)
* [bugfix] `object-literal-key-quotes` no longer throws exception when using rest operator (#1916)
* [bugfix] `restrict-plus-operands` no longer shows false positive in ternary operation (#1925)
* [bugfix] `prefer-for-of` now handles nested `for` loops with reused iterator (#1926)
* [bugfix] Exit gracefully when `tsconfig.json` passed as `--project` argument doens't have files (#1933)
* [bugfix] `object-literal-key-quotes` now handles shorthand and spread properties (#1945)
* [bugfix] `arrow-parens` Allow binding patterns `([x, y]) => ...` and `({x, y}) => ...` to have parens (#1958)
* [bugfix] `semicolon` fixer now handles comma separator in interfaces and indicates failure when commas are using in interfaces (#1856)
* [bugfix] `only-arrow-functions` option `allow-named-functions` now allows function declarations (#1961)
* [bugfix] `prefer-for-of` no longer shows false positive when array is in parentheses (#1986)
* [bugfix] `prefer-const` now works for TypeScript versions < 2.1.0 (#1989)
* [enhancement] `member-access` narrow location of error (#1964)

Thanks to our contributors!

* Andrii Dieiev
* @andy-ms
* Andy Hanson
* Josh Goldberg
* Klaus Meinhardt
* Linda_pp
* Mohsen Azimi
* Victor Grigoriu
* Yuichi Nukiyama
* cameron-mcateer

v4.2.0
---

Expand All @@ -16,6 +64,15 @@ v4.2.0
* [bugfix] `object-literal-key-quotes` now includes function names (#1874)
* [bugfix] error when EOF comes after `disable-next-line` comment (#1902)

Thanks to our contributors!

* Andrew Scott
* @andy-ms
* Andy Hanson
* James Booth
* Klaus Meinhardt
* Vladimir Matveev

v4.1.1
---

Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ tslint accepts the following command-line options:
--force:
Return status code 0 even if there are any lint errors.
Useful while running as npm script.
Useful while running TSLint via an npm script.
-i, --init:
Generates a tslint.json config file in the current working directory.
Expand Down Expand Up @@ -387,20 +387,25 @@ Development
-----------
<sup>[back to ToC &uarr;](#table-of-contents)</sup>

Requirements:

- `node` v7
- `yarn` v0.18

#### Quick Start

```bash
git clone git@github.com:palantir/tslint.git --config core.autocrlf=input --config core.eol=lf
npm install
npm run compile
npm run test
yarn install
yarn compile
yarn test
```

#### `next` branch

The [`next` branch of this repo](https://github.com/palantir/tslint/tree/next) tracks the latest TypeScript compiler
nightly release as a `peerDependency`. This allows you to develop the linter and its rules against the latest features of the
language. Releases from this branch are published to npm with the `next` dist-tag, so you may install the latest dev
language. Releases from this branch are published to NPM with the `next` dist-tag, so you may install the latest dev
version of TSLint via `npm install tslint@next`.

Creating a new release
Expand All @@ -409,7 +414,7 @@ Creating a new release

1. Bump the version number in `package.json` and `src/tslintMulti.ts`
2. Add release notes in `CHANGELOG.md`
3. `npm run verify` to build the latest sources
3. `yarn verify` to build the latest sources
4. Commit with message `Prepare release <version>`
5. Run `npm publish`
6. Create a git tag for the new release and push it ([see existing tags here](https://github.com/palantir/tslint/tags))
107 changes: 103 additions & 4 deletions docs/_data/rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
{
"ruleName": "array-type",
"description": "Requires using either 'T[]' or 'Array<T>' for arrays.",
"hasFix": true,
"optionsDescription": "\nOne of the following arguments must be provided:\n\n* `\"array\"` enforces use of `T[]` for all types T.\n* `\"generic\"` enforces use of `Array<T>` for all types T.\n* `\"array-simple\"` enforces use of `T[]` if `T` is a simple type (primitive or type reference).",
"options": {
"type": "string",
Expand All @@ -58,8 +59,9 @@
{
"ruleName": "arrow-parens",
"description": "Requires parentheses around the parameters of arrow function definitions.",
"hasFix": true,
"rationale": "Maintains stylistic consistency with other arrow function definitions.",
"optionsDescription": "\nif `ban-single-arg-parens` is specified, then arrow functions with one parameter \nmust not have parentheses if removing them is allowed by TypeScript.",
"optionsDescription": "\nif `ban-single-arg-parens` is specified, then arrow functions with one parameter\nmust not have parentheses if removing them is allowed by TypeScript.",
"options": {
"type": "string",
"enum": [
Expand All @@ -68,7 +70,7 @@
},
"optionExamples": [
"true",
"[true, ban-single-arg-parens]"
"[true, \"ban-single-arg-parens\"]"
],
"type": "style",
"typescriptOnly": false
Expand Down Expand Up @@ -247,6 +249,17 @@
"type": "functionality",
"typescriptOnly": false
},
{
"ruleName": "import-spacing",
"description": "Ensures proper spacing between import statement keywords",
"optionsDescription": "Not configurable.",
"options": null,
"optionExamples": [
"true"
],
"type": "style",
"typescriptOnly": false
},
{
"ruleName": "indent",
"description": "Enforces indentation with tabs or spaces.",
Expand Down Expand Up @@ -481,6 +494,7 @@
{
"ruleName": "no-angle-bracket-type-assertion",
"description": "Requires the use of `as Type` for type assertions instead of `<Type>`.",
"hasFix": true,
"rationale": "\nBoth formats of type assertions have the same effect, but only `as` type assertions\nwork in `.tsx` files. This rule ensures that you have a consistent type assertion style\nacross your codebase.",
"optionsDescription": "Not configurable.",
"options": null,
Expand Down Expand Up @@ -870,8 +884,9 @@
{
"ruleName": "no-string-throw",
"description": "Flags throwing plain strings or concatenations of strings because only Errors produce proper stack traces.",
"hasFix": true,
"options": null,
"optionsDescription": "",
"optionsDescription": "Not configurable.",
"type": "functionality",
"typescriptOnly": false
},
Expand Down Expand Up @@ -943,6 +958,7 @@
"ruleName": "no-unused-variable",
"deprecationMessage": "Use the tsc compiler options --noUnusedParameters and --noUnusedLocals instead.",
"description": "Disallows unused imports, variables, functions and private class members.",
"hasFix": true,
"optionsDescription": "\nThree optional arguments may be optionally provided:\n\n* `\"check-parameters\"` disallows unused function and constructor parameters.\n * NOTE: this option is experimental and does not work with classes\n that use abstract method declarations, among other things.\n* `\"react\"` relaxes the rule for a namespace import named `React`\n(from either the module `\"react\"` or `\"react/addons\"`).\nAny JSX expression in the file will be treated as a usage of `React`\n(because it expands to `React.createElement `).\n* `{\"ignore-pattern\": \"pattern\"}` where pattern is a case-sensitive regexp.\nVariable names that match the pattern will be ignored.",
"options": {
"type": "array",
Expand Down Expand Up @@ -992,6 +1008,7 @@
"ruleName": "no-var-keyword",
"description": "Disallows usage of the `var` keyword.",
"descriptionDetails": "Use `let` or `const` instead.",
"hasFix": true,
"optionsDescription": "Not configurable.",
"options": null,
"optionExamples": [
Expand Down Expand Up @@ -1025,6 +1042,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\").",
"hasFix": true,
"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",
Expand Down Expand Up @@ -1140,6 +1158,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.",
"hasFix": true,
"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",
Expand Down Expand Up @@ -1176,6 +1195,7 @@
"ruleName": "prefer-const",
"description": "Requires that variable declarations use `const` instead of `let` if possible.",
"descriptionDetails": "\nIf a variable is only assigned to once when it is declared, it should be declared using 'const'",
"hasFix": true,
"optionsDescription": "Not configurable.",
"options": null,
"optionExamples": [
Expand Down Expand Up @@ -1212,6 +1232,7 @@
{
"ruleName": "quotemark",
"description": "Requires single or double quotes for string literals.",
"hasFix": true,
"optionsDescription": "\nFive arguments may be optionally provided:\n\n* `\"single\"` enforces single quotes.\n* `\"double\"` enforces double quotes.\n* `\"jsx-single\"` enforces single quotes for JSX attributes.\n* `\"jsx-double\"` enforces double quotes for JSX attributes.\n* `\"avoid-escape\"` allows you to use the \"other\" quotemark in cases where escaping would normally be required.\nFor example, `[true, \"double\", \"avoid-escape\"]` would not report a failure on the string literal `'Hello \"World\"'`.",
"options": {
"type": "array",
Expand Down Expand Up @@ -1262,7 +1283,8 @@
{
"ruleName": "semicolon",
"description": "Enforces consistent semicolon usage at the end of every statement.",
"optionsDescription": "\nOne of the following arguments must be provided:\n\n* `\"always\"` enforces semicolons at the end of every statement.\n* `\"never\"` disallows semicolons at the end of every statement except for when they are necessary.\n\nThe following arguments may be optionaly provided:\n* `\"ignore-interfaces\"` skips checking semicolons at the end of interface members.\n* `\"ignore-bound-class-methods\"` skips checking semicolons at the end of bound class methods.",
"hasFix": true,
"optionsDescription": "\nOne of the following arguments must be provided:\n\n* `\"always\"` enforces semicolons at the end of every statement.\n* `\"never\"` disallows semicolons at the end of every statement except for when they are necessary.\n\nThe following arguments may be optionaly provided:\n\n* `\"ignore-interfaces\"` skips checking semicolons at the end of interface members.\n* `\"ignore-bound-class-methods\"` skips checking semicolons at the end of bound class methods.",
"options": {
"type": "array",
"items": [
Expand Down Expand Up @@ -1291,6 +1313,60 @@
"type": "style",
"typescriptOnly": false
},
{
"description": "Require or disallow a space before function parenthesis",
"hasFix": true,
"optionExamples": [
"true",
"[true, \"always\"]",
"[true, \"never\"]",
"[true, {\"anonymous\": \"always\", \"named\": \"never\", \"asyncArrow\": \"always\"}]"
],
"options": {
"properties": {
"anonymous": {
"enum": [
"always",
"never"
],
"type": "string"
},
"asyncArrow": {
"enum": [
"always",
"never"
],
"type": "string"
},
"constructor": {
"enum": [
"always",
"never"
],
"type": "string"
},
"method": {
"enum": [
"always",
"never"
],
"type": "string"
},
"named": {
"enum": [
"always",
"never"
],
"type": "string"
}
},
"type": "object"
},
"optionsDescription": "\nOne argument which is an object which may contain the keys `anonymous`, `named`, and `asyncArrow`\nThese should be set to either `\"always\"` or `\"never\"`.\n\n* `\"anonymous\"` checks before the opening paren in anonymous functions\n* `\"named\"` checks before the opening paren in named functions\n* `\"asyncArrow\"` checks before the opening paren in async arrow functions\n* `\"method\"` checks before the opening paren in class methods\n* `\"constructor\"` checks before the opening paren in class constructors\n ",
"ruleName": "space-before-function-paren",
"type": "style",
"typescriptOnly": false
},
{
"ruleName": "strict-boolean-expressions",
"description": "Usage of && or || operators should be with boolean operands and\nexpressions in If, Do, While and For statements should be of type boolean",
Expand All @@ -1317,6 +1393,7 @@
{
"ruleName": "trailing-comma",
"description": "\nRequires or disallows trailing commas in array and object literals, destructuring assignments, function and tuple typings,\nnamed imports and function parameters.",
"hasFix": true,
"optionsDescription": "\nOne argument which is an object with the keys `multiline` and `singleline`.\nBoth should be set to either `\"always\"` or `\"never\"`.\n\n* `\"multiline\"` checks multi-line object literals.\n* `\"singleline\"` checks single-line object literals.\n\nA array is considered \"multiline\" if its closing bracket is on a line\nafter the last array element. The same general logic is followed for\nobject literals, function and tuple typings, named import statements\nand function parameters.",
"options": {
"type": "object",
Expand Down Expand Up @@ -1504,6 +1581,28 @@
"type": "typescript",
"typescriptOnly": true
},
{
"ruleName": "typeof-compare",
"description": "Makes sure result of `typeof` is compared to correct string values",
"optionsDescription": "Not configurable.",
"options": null,
"optionExamples": [
"true"
],
"type": "functionality",
"typescriptOnly": false
},
{
"ruleName": "unified-signatures",
"description": "Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter.",
"optionsDescription": "Not configurable.",
"options": null,
"optionExamples": [
"true"
],
"type": "typescript",
"typescriptOnly": true
},
{
"ruleName": "use-isnan",
"description": "Enforces use of the `isNaN()` function to check for NaN references instead of a comparison to the `NaN` constant.",
Expand Down
Loading

0 comments on commit 9a38cdc

Please sign in to comment.