* Ember: set TS version to 3.7, Ember version to 3.12
* Ember Data: set TS version to 3.7, Ember Data version to 3.12
* Ember: bump *all* Ember-related types to require 3.7
Bumping the core types has a ripple effect, such that *every* type in
the broader ecosystem which relies on them must *also* be updated. This
includes older versions specified by `typesVersions`, which *implicitly*
use the newer versions from the `@ember/*` and `@ember-data/*` types,
because of declaration merging.
* Ember, Ember Data: override npm-naming
Ember and Ember Data's packages describe their *build-time* behavior,
not their *run-time* behavior, so the TSLint rule doesn't apply.
* Ember: set correct baseUrl in tsconfig for namespace package
* Ember, Ember Data: target current LTS (3.16) version
TS 3.9 now forbids deleting properties that aren't optional or undefined. This
exposed a bug in ember tests where the tests were deleting a property
with the type `{} | null`. I changed the type to `{} | undefined` to
reflect what will actually happen at runtime.
* remove non-existing constructor method from Array in Ember
* removed method named "new" and added a constructor to the Collaborator class in google-drive-realtime
* made LocalizedObservable into the class that it actually is in Knockout
* removed a method named "constructor" and replaced it with a constructor in microsoft-ajax
* removed a method called "new" and replaced it with a constructor in microsoft-ajax
* autoformat
* made QueryCursor into the class it actually is in mongoose
* made Connection into a class
* made QueryStream and QueryCursor into a classes
* removed two methods called "new" and replaced them with constructors
* change EventSubscriptionVendor into a class
* removed class only used internally Route (it had a wrongly declared method named "constructor")
* removed non-existing method named "constructor" in rx-angular
* made StackFrame into a class
* made StreamMeter into a class
* removed a method named "new" and replaced it with a constructor
Typescript 3.7 includes a flag that will allow people to migrate to the
Class Fields ECMA proposal as currently specified, which is at Stage 3.
When `--useDefineForClassFields` is turned on, Typescript
issues 3 new errors in places where the current Typescript semantics
would cause errors with the Stage 3 spec.
Two of the errors are very rare. The third shows up whenever classes want
to redeclare the type of a property from a superclass, usually when the
base property's type is `any` or `unknown`.
```ts
class ColumnSizerExample extends React.Component<any, any> {
context: React.ContextType<typeof MyContext>
}
```
Without `--useDefineForClassFields`, this *only* redeclares the type of
`context`. With `--useDefineForClassFields`, it redeclares the type of
`context` **and** initialises it to `undefined`. This is very surprising.
To avoid this, Typescript 3.7 introduces new syntax for exactly this scenario:
```ts
class ColumnSizerExample extends React.Component<any, any> {
declare context: React.ContextType<typeof MyContext>
}
```
However, Definitely Typed tests cannot use this new syntax because it
only works with Typescript 3.7, which isn't even in beta until next
week. So this PR uses several other workarounds instead:
1. Moving a constructor initialiser to a property declaration initialiser.
2. Using a dummy initialiser:
3. Adding type annotations so the type of the base property can be correctly inferred.
4. Deleting the declaration when it has the same type as the base. In this case it's redundant.
* Add new npm-naming exemptions
These packages fail the upcoming requirement that the types package
version match a version that exists for the original package.
In other words, these packages have a version, like 0.0 or 1.0, that
their original package doesn't have. The "npm-naming" lint rule will
soon prevent this, so these packages need to be exempt from this rule.
* Restore some useful comments/formatting
* Update required TS version for stale packages
1. Add handlebars depdencies missed in #33518, which deprecated
@types/handlebars now that handlebars ships its own types.
2. Add project homepage for kafkajs.
1. Ember-data tests had the wrong return type in a couple of places. TS
3.4 catches this error, and this PR fixes it.
2. Ember-data's Model class became invariant in 3.4 because of its use of the
`this` type. This PR uses a `this` parameter with a method-local type
parameter to avoid using Model's `this` type.
3. Ember v2's tests were broken by TS 3.4's more complete return-type
inference, which caused a variable declaration's type annotation to
break inference through contextual typing. This PR converts the type
annotation to type parameters on the call, which short-circuits
inference entirely. It's also shorter.
Note that this *trivially* updates project urls by adding the NPM url to
the end, even when the urls are almost identical or the DT one is
outdated. I'll clean up the urls in a later commit.
This PR is unfinished! Please do not merge it yet.
Prior to this commit `redirect()` hook was mistakenly
typed and documented the same way as `refresh()`.
It's now fixed for v2 and v3 now.
While v3 is provided with a positive and a negative test
cases, v2 is only provided with a positive one.
This is because v2 uses typescript of version 2.4 which is
not able to catch the failing test case.