Commit Graph

32012 Commits

Author SHA1 Message Date
csigs 6d81577ad4 LEGO: check in for master to temporary branch. 2020-04-21 04:10:31 +00:00
Josh Goldberg d12b741004 Excluded type unions from the generale source types 2020-04-20 23:32:34 -04:00
Sheetal Nandi e7774c6144 Handle non literal computed name when trying to get the name for object literal property name in json object (#37988)
Fixes #37984
2020-04-20 12:58:38 -07:00
Dan Dascalescu 0f3f37b30c Fix typo in issue template titles (#38042) 2020-04-20 12:14:26 -07:00
Eli Barzilay 9c1157a801 fix(37242): add reference to return type for JSDocFunctionType (#37911) 2020-04-20 14:17:03 -04:00
Andrew Branch 547fd12c2f Fix doc comment template on assignment expressions (#38032) 2020-04-20 11:15:12 -07:00
Anders Hejlsberg 5d78cbdbbd Propagate nonInferrableType in &&, || and ?? operators (#38035)
* Propagate nonInferrableType in &&, || and ?? operators

* Add regression test

* Simpler solution: getTypeFacts(neverType) should return TypeFacts.None
2020-04-20 11:04:24 -07:00
csigs 38f8db5e45 LEGO: Merge pull request 38072
LEGO: Merge pull request 38072
2020-04-20 09:11:02 -07:00
csigs c0f64f1821 LEGO: check in for master to temporary branch. 2020-04-20 16:10:20 +00:00
Josh Goldberg 035b9ac1c1 Lint fix 2020-04-19 22:09:53 -04:00
Josh Goldberg 1b3c7a28c1 This had better be the last unit test fix... 2020-04-19 21:50:17 -04:00
Josh Goldberg cb19b3d251 Again fixed up manual unit tests 2020-04-19 21:34:05 -04:00
Josh Goldberg 769a2f2cfc Eased up on some of the more aggressive reporting changes 2020-04-19 20:25:24 -04:00
Josh Goldberg af4ea605f2 Fixed a couple of tsserver unit tests 2020-04-19 17:18:02 -04:00
Josh Goldberg b14b231d26 Report primitive type in literal-to-primitive relation complaints 2020-04-19 13:26:38 -04:00
Jacob Bandes-Storch d00f2b53ad replace the original not-callable error 2020-04-18 21:23:31 -07:00
sergeir82 b346f5764e prefix-unused-parameter-with-_ codefix now works in jsdoc @param (#36152)
* Fix prepending unused TypeScript variables with underscore doesn't rename JSDoc @param.
Fix test for quick fix "Prefix all unused declarations with '_' where possible".
Fixes #33021.

* Replace FindAllReferences.Core.eachSymbolReferenceInFile function call to more ligher call of getJSDocParameterTags when searching for a parameter in jsdoc.

* Remove redundant constant declaration.

* Add test for prefix single unused parameter in jsdoc.
2020-04-17 13:18:05 -07:00
Alexander T a2628c9088 fix(37242): add reference to return type for JSDocFunctionType 2020-04-17 09:05:23 +03:00
Wesley Wigham deb5bac520 Use string representation for negative numeric property names (#37936) 2020-04-15 21:11:05 -07:00
TypeScript Bot ca1f467233 Update user baselines (#37946)
Co-authored-by: typescript-bot <typescript@microsoft.com>
2020-04-15 13:55:30 -07:00
Wesley Wigham cdc384006c Fix crash on declaration emit for globalThis (#37992) 2020-04-15 13:37:51 -07:00
Alexander T a16c44180a fix(37940): add space after parameter decorator (#37959) 2020-04-15 11:42:29 -07:00
Nathan Shively-Sanders 6fbaeeb42f Typo at Uint8Array[Symbol.toStringTag] (#37989)
* Update es2015.symbol.wellknown.d.ts

* Update baselines

Co-authored-by: sirian <sirianru@gmail.com>
2020-04-15 11:40:33 -07:00
Joe Previte 583e70b3d1 fix(refactor): keep comments after refactor (#35937)
* add two tests: Refactor: Remove braces from arrow function

* refactor: simplify test and add another test

* fix: copyTrailingAsLeadingComments in addOrRemoveBracesToArrowFunction

* test: add additional test

* fix: clean up changes

* fix: add check for newEdit

* fix: add function for semi colon modifier

* feat: grab all comments during refactor

* refactor: update addOrRemoveBraces logic

* fix: remove duplicate function call

* Update src/services/refactors/addOrRemoveBracesToArrowFunction.ts

* remove blank line

remove blank line

Co-authored-by: Jesse Trinity <42591254+jessetrinity@users.noreply.github.com>
2020-04-15 11:06:04 -07:00
okmttdhr 06e05f25e1 Improve error message for computed enums (#37790)
* Add error message for computed enums

* Add test case for computed enums

* Accept baselines

* Fix returned value when error
2020-04-15 13:50:33 -04:00
Anders Hejlsberg 92cd3ae299 No iteration type errors during CFA (#37965)
* No iteration type errors during CFA

* Add regression test
2020-04-15 10:34:07 -07:00
csigs 15c3e99cbd LEGO: Merge pull request 37976
LEGO: Merge pull request 37976
2020-04-14 21:11:08 -07:00
csigs e505c79091 LEGO: check in for master to temporary branch. 2020-04-15 04:10:28 +00:00
csigs 04069db846 LEGO: Merge pull request 37969
LEGO: Merge pull request 37969
2020-04-14 15:11:21 -07:00
csigs 49f5fbb2c7 LEGO: check in for master to temporary branch. 2020-04-14 22:10:38 +00:00
Ashley Claymore 4538640d8a Added error when Enum member initaliser references itself (#34655)
Fixes #34606
2020-04-14 15:20:19 -04:00
Wesley Wigham edd4e0a42b Add fastpath to isRelatedTo for type references (#37481)
* Add fastpath to isRelatedTo for type references

* Do not check intersections or unions to ignore propegating reference flags, properly set comparing jsx flag

* Re-remove unneeded check

* Just check for TypeFlags.Object

* Remove else clause
2020-04-13 15:54:37 -07:00
Wesley Wigham 8dd6b3a389 Accept recent tests with updated baseline code (#37945) 2020-04-13 15:34:34 -07:00
TypeScript Bot cede6ef30e Update user baselines (#37935)
Co-authored-by: typescript-bot <typescript@microsoft.com>
2020-04-13 15:08:41 -07:00
Wesley Wigham 6a5508b343 Update __exportStar helper to skip default and __esModule members (#37236)
* Update __exportStar helper to skip default and __esModule

* Accept new baselines

* Remove esmodule check from helper
2020-04-13 13:10:24 -07:00
Pierre-Antoine Mills eb569a5c74 chore(ts-toolbelt): remove deprecated test (#37932) 2020-04-13 12:32:01 -07:00
Wesley Wigham 141ee01c8c Retain imports in declaration emit if they augment an export of the importing file (#37820)
* Retain imports in declaration emit if they augment an export of the importing file

* (sp)

* Check that a merge occurs, just because
2020-04-13 12:31:14 -07:00
Alexander T a8e1ad4e62 fix(37781): import missing argument types for a new method (#37857) 2020-04-13 10:23:12 -07:00
Nathan Shively-Sanders 5f46d42ad1 Error on missing BigInt in es2020 (#37899)
* Error on missing BigInt in ES2020 too.

Previously it was only on ESNext, but bigint ships in ES 2020.

There are no tests for this; passing `false` doesn't cause any tests to
fail at least.

* add tests
2020-04-13 08:30:59 -07:00
Jacob Bandes-Storch d00a5c954f Add _0_is_declared_here pointing to accessor declaration 2020-04-11 15:58:35 -07:00
Jacob Bandes-Storch 61f60057f1 Better error message for accidental calls to get-accessors 2020-04-11 15:52:17 -07:00
Nathan Shively-Sanders eb105efdcd Avoid circular reference in this-property assignments (#37827)
* Avoid circular reference in this-property assignments

To do this, don't check this-property assigments that have the
this-property of the lhs appearing somewhere on the rhs:

```js
class C {
  m() {
    this.x = 12
    this.x = this.x + this.y
  }
}
```

I tried suppressing the circularity error, but because we cache the
first type discovered for a property, this still results in an implicit
any for `x` in the previous example. It just doesn't have an error.

Fixes #35099

* Add test case + rename function

* Use isMatchingReference
2020-04-10 16:41:31 -07:00
Nathan Shively-Sanders 4d541d2b74 Minor cleanup
1. Fix lint.
2. Make code easier to read.
3. Turns some asserts into bails instead.
2020-04-10 09:55:36 -07:00
Alexander T 795a5c83fe fix(37150): ignore private fields in string index type checking (#37183) 2020-04-10 12:53:53 -04:00
Alexander T aa6be6ee6f fix(37364): show completions for string literal index on mapped type (#37367) 2020-04-10 12:36:26 -04:00
Nathan Shively-Sanders 3428e275e6 Reorder tsconfig and move one more function 2020-04-10 09:06:43 -07:00
Neonit d6af9b7cbc Fix indentation preservation in JSDoc (#37717)
This fixes two bugs in the parseJSDocCommentWorker().

1. The initial indent was calculated wrongly. It was set to the
   difference between the index of the last newline or beginning of file
   and the current start marker (position of /**). By calculating it
   this way, the newline character itself is counted as indentation
   character as well. The initial indent is used as margin for the
   whole comment. The margin contains the amount of characters to skip
   before the actual content or payload of a comment line. The algorithm
   does not skip non-whitespace characters at the beginning of the
   content, but it would strip away one whitespace character for
   indented content (which does matter, if there is e.g. a Markdown
   code block with indentation in the comment).

2. When reducing initial whitespace sequences of comment lines by the
   remaining margin the algorithm cut off one character too much. This
   might have been introduced to fix 1. It had a similar effect as 1.
2020-04-10 17:46:08 +02:00
Anders Hejlsberg 52dc9f2282 No recursive intersection property checks (#37854)
* No recursive intersection property checks

* Add comment
2020-04-09 19:23:36 -07:00
Anders Hejlsberg 6b1c102bd1 No excessive stack depth global errors (#37873)
* Report excessive stack depth on current node when no error node available

* Accept new baselines
2020-04-09 19:05:35 -07:00
Nathan Shively-Sanders 6eacc9c1e2 move into new, centrally (?) located file 2020-04-09 17:00:37 -07:00