Skip to content

Commit

Permalink
Remove generated Typescript definitions
Browse files Browse the repository at this point in the history
When adding JSDoc to our functions our main points were
1. Give us documentation, API docs
2. Give autocomplete and type suggestions in supporting IDEs

As an added bonus, we found that it was possible to generate
TypeScript definition files directly from the JSDoc definitions.
There were already community efforts at DefinitelyTyped for
both sinon and its sub-projects, like fake-timers, but as
external projects they suffered from being out-of-sync
with the projects they were supposed to describe. Our thoughs
were then that by generating these directly from the source
that we could in time catch up with the DT efforts and
be the main source of up-to-date .d.ts files.

Unfortunately, there were some aspects of our types that
were hard to describe statically using JSDoc, such as those
where TypeScript would utilize its typeof type operator.
That resulted in contributions that used the
fact that TSC ignored invalid type definitions to describe
types using those TypeScript features. The result was valid
d.ts files, but invalid JSDoc, meaning our two main points
were unmet. JSDoc simply is not powerful enough to generate
the types expected by the users of the DefinitelyTyped
types. So, in order to get back to what we mainly want, we
stop shipping TypeScript definitions and continue to let this be a
community maintained effort at DT (as it was). This should
result in less friction (as experienced in the last few
months), but will, of course, have the downside of always
lagging a bit behind.
  • Loading branch information
fatso83 committed May 29, 2021
1 parent 50ec300 commit 119615b
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 1,441 deletions.
3 changes: 0 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ jobs:
- run:
name: Test
command: npm run test-node
- run:
name: Test types
command: npm run build && npm run test-types

chromium:
docker:
Expand Down
6 changes: 0 additions & 6 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,3 @@ overrides:
rules:
max-nested-callbacks: off
mocha/no-exclusive-tests: error
- files: "test/**.ts"
parserOptions:
ecmaVersion: 2020
sourceType: 'module'
rules:
no-unused-expressions: off
Loading

0 comments on commit 119615b

Please sign in to comment.