Skip to content

Commit

Permalink
Merge branch 'DefinitelyTyped:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
mohitpubnub authored Jan 9, 2024
2 parents 8cad11b + 17df3f9 commit 06e64c8
Show file tree
Hide file tree
Showing 12,000 changed files with 30,296 additions and 172,423 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 3 additions & 3 deletions .dprint.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
},
// NOTE: if extending this list, also update settings.template.json.
"plugins": [
"https://plugins.dprint.dev/typescript-0.88.3.wasm",
"https://plugins.dprint.dev/json-0.19.0.wasm",
"https://plugins.dprint.dev/prettier-0.27.0.json@3557a62b4507c55a47d8cde0683195b14d13c41dda66d0f0b0e111aed107e2fe"
"https://plugins.dprint.dev/typescript-0.88.8.wasm",
"https://plugins.dprint.dev/json-0.19.1.wasm",
"https://plugins.dprint.dev/prettier-0.32.1.json@19aa403ef0862ba8c41164e3dc6f84c0b7a66c2b11e42726b23dd25e6302ada9"
],
"indentWidth": 4,
"lineWidth": 120,
Expand Down
104 changes: 70 additions & 34 deletions .github/CODEOWNERS

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ If adding a new definition:
- [ ] If this is for an npm package, match the name. If not, do not conflict with the name of an npm package.
- [ ] Create it with `dts-gen --dt`, not by basing it on an existing project.
- [ ] Represents shape of module/library [correctly](https://www.typescriptlang.org/docs/handbook/declaration-files/library-structures.html)
- [ ] `tslint.json` [should contain](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#linter-tslintjson) `{ "extends": "@definitelytyped/dtslint/dt.json" }`, and no additional rules.
- [ ] `tsconfig.json` [should have](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#tsconfigjson) `noImplicitAny`, `noImplicitThis`, `strictNullChecks`, and `strictFunctionTypes` set to `true`.

If changing an existing definition:
- [ ] Provide a URL to documentation or source code which provides context for the suggested changes: <<url here>>
- [ ] If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header.
- [ ] If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the `package.json`.

If removing a declaration:
- [ ] If a package was never on Definitely Typed, you don't need to do anything. (If you wrote a package and provided types, you don't need to register it with us.)
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ jobs:
if: github.repository == 'DefinitelyTyped/DefinitelyTyped'

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
# Need this to be able to inquire about origin/master
filter: blob:none # https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/
fetch-depth: 0 # Default is 1; need to set to 0 to get the benefits of blob:none.
- uses: actions/setup-node@v4
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: '16'
node-version: '20'

# forbid symlinks
- name: 'Pre-run validation'
Expand All @@ -27,15 +27,15 @@ jobs:
printf "Aborting: symlinks found:\n%s" "$symlinks"; exit 1
fi
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0

- name: Get pnpm cache info
id: pnpm-cache
run: |
echo "store=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Restore pnpm cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
path: ${{ steps.pnpm-cache.outputs.store }}
key: ${{ runner.os }}-pnpm-store-cache-
Expand Down Expand Up @@ -67,12 +67,12 @@ jobs:
if: github.repository == 'DefinitelyTyped/DefinitelyTyped'

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: '16'
node-version: '20'

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
with:
run_install: |
- args: [--filter, ., --filter, '{./scripts}...']
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/UpdateCodeowners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ jobs:
if: github.repository == 'DefinitelyTyped/DefinitelyTyped'

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- uses: actions/setup-node@v4
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: '20'
- uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
with:
run_install: |
- args: [--filter, ., --filter, '{./scripts}...']
Expand All @@ -36,7 +38,7 @@ jobs:

- run: pnpm run update-codeowners

- uses: stefanzweifel/git-auto-commit-action@v5.0.0
- uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d # v5.0.0
with:
commit_author: 'TypeScript Bot <typescriptbot@microsoft.com>'
commit_message: '🤖 Update CODEOWNERS'
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/format-and-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'DefinitelyTyped/DefinitelyTyped'
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
# Use the bot token so that CI triggers on pushes; we want to know if formatting broke something.
token: ${{ secrets.GH_DT_MERGEBOT_TOKEN }}
- uses: actions/setup-node@v4
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: '20'

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
with:
run_install: |
- args: [--filter, ., --filter, '{./scripts}...']
Expand All @@ -29,7 +31,7 @@ jobs:
id: date
run: echo "date=$(/bin/date -u "+%Y-%m-%d")" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
- uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
# dprint caches info about the files in the repo to skip formatting them.
# However, since package.json and .dprint.jsonc don't change very often,
Expand All @@ -45,7 +47,7 @@ jobs:
- run: pnpm dprint fmt

- uses: stefanzweifel/git-auto-commit-action@v5.0.0
- uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d # v5.0.0
with:
commit_author: 'TypeScript Bot <typescriptbot@microsoft.com>'
commit_message: '🤖 dprint fmt'
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/ghostbuster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ jobs:
if: github.repository == 'DefinitelyTyped/DefinitelyTyped'

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: actions/setup-node@v4
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: '20'

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
with:
run_install: |
- args: [--filter, ., --filter, '{./scripts}...']
Expand All @@ -49,7 +51,7 @@ jobs:
fi
- if: ${{ inputs.skipPR != 'true' }}
uses: peter-evans/create-pull-request@v5.0.2
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'Remove contributors with deleted accounts #no-publishing-comment'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-md.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'DefinitelyTyped/DefinitelyTyped'
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
with:
run_install: |
- args: [--filter, ., --filter, '{./scripts}...']
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/pnpm-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ jobs:
create-cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: pnpm/action-setup@v2
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: '20'
- uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0

- name: Get pnpm cache info
id: pnpm-cache
Expand All @@ -24,7 +26,7 @@ jobs:
run: pnpm install

- name: Save pnpm cache
uses: actions/cache/save@v3
uses: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
path: ${{ steps.pnpm-cache.outputs.store }}
key: ${{ runner.os }}-pnpm-store-cache-${{ steps.pnpm-cache.outputs.date }}
10 changes: 6 additions & 4 deletions .github/workflows/support-window.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ jobs:
if: github.repository == 'DefinitelyTyped/DefinitelyTyped'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: actions/setup-node@v4
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: '20'
- uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
with:
run_install: |
- args: [--filter, ., --filter, '{./scripts}...']
Expand All @@ -47,7 +49,7 @@ jobs:
- name: Make SVG diagram
run: node --experimental-json-modules scripts/support-window > docs/support-window.svg

- uses: stefanzweifel/git-auto-commit-action@v5.0.0
- uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d # v5.0.0
with:
commit_author: 'TypeScript Bot <typescriptbot@microsoft.com>'
commit_message: '🤖 Update support window'
Expand Down
3 changes: 1 addition & 2 deletions README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ Tu paquete debería tener esta estructura:
| `index.d.ts` | Este contiene los typings del paquete. |
| [`<my-package>-tests.ts`](#my-package-teststs) | Este contiene una muestra del código con el que se realiza la prueba de escritura. Este código *no* es ejecutable, pero sí es type-checked. |
| [`tsconfig.json`](#tsconfigjson) | Este permite ejecutar `tsc` dentro del paquete. |
| [`tslint.json`](#linter-tslintjson) | Permite linting. |

Generalas ejecutando `npm install -g dts-gen` y `dts-gen --dt --name <my-package> --template module`.
Ve todas las opciones en [dts-gen](https://github.com/Microsoft/dts-gen).
Expand Down Expand Up @@ -222,7 +221,7 @@ f("one");
Para más detalles, vea el [dtslint](https://github.com/microsoft/DefinitelyTyped-tools/tree/master/packages/dtslint#write-tests) readme.
#### Linter: `tslint.json`
#### Linter: `.eslintrc.json`
The linter configuration file, `tslint.json` should contain `{ "extends": "@definitelytyped/dtslint/dt.json" }`, and no additional rules.
Expand Down
11 changes: 1 addition & 10 deletions README.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ Votre paquet doit avoir cette structure :
| `index.d.ts` | Il contient les typages du paquet. |
| [`<mon-paquet>-tests.ts`](#mon-paquet-teststs) | Il contient un exemple de code qui teste les typages. Ce code *ne* s'exécute pas, mais il est vérifié. |
| [`tsconfig.json`](#tsconfigjson) | Cela vous permet d'exécuter `tsc` à l'intérieur du paquet. |
| [`tslint.json`](#linter-tslintjson) | Activer le linting |
| [`.eslintrc.json`](#linter-eslintrcjson) | (Rarement) Nécessaire uniquement pour désactiver les règles de lint écrites pour eslint. |
Vous pouvez les générer en lançant `npx dts-gen --dt --name <mon-paquet> --template module` si vous avez npm ≥ 5.2.0, `npm install -g dts-gen` et `dts-gen --dt --name <mon-paquet> --template module` dans le cas contraire.
Expand Down Expand Up @@ -277,17 +276,9 @@ f("one");

Pour plus de détails, voir le readme de [dtslint](https://github.com/Microsoft/DefinitelyTyped-tools/tree/master/packages/dtslint#write-tests).

#### Linter: `tslint.json`

Le fichier de configuration du linter, `tslint.json` doit contenir `{ "extends" : "@definitelytyped/dtslint/dt.json" }`, et aucune règle supplémentaire.

Si, pour une raison quelconque, une règle doit être désactivée, [désactivez-la pour cette ligne spécifique](https://palantir.github.io/tslint/usage/rule-flags/#comment-flags-in-source-code:~:text=%2F%2F%20tslint%3Adisable%2Dnext%2Dline%3Arule1%20rule2%20rule3...%20%2D%20Désactive%20les%20règles%20listées%20pour%20la%20prochaine%20ligne) en utilisant `// tslint:disable-next-line:[nomRègle]` - pas pour tout le paquet, afin que la désactivation puisse être examinée. (Il y a quelques anciennes configurations de lint qui ont des contenus additionnels, mais cela ne devrait pas se produire dans un nouveau travail).

##### Linter: `.eslintrc.json`

Definitely Typed est en train de passer à eslint pour le linting.
Contrairement à tslint, vous n'avez pas besoin d'un fichier de configuration pour activer le linting.
Comme pour tslint, vous devez désactiver des règles spécifiques uniquement sur des lignes spécifiques :
Vous devez désactiver des règles spécifiques uniquement sur des lignes spécifiques :


```ts
Expand Down
11 changes: 1 addition & 10 deletions README.it.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ Il tuo package dovrebbe avere questa struttura:
| `index.d.ts` | Contiene le dichiarazioni dei tipi del package. |
| [`<nome-package>-tests.ts`](#mio-package-teststs) | Contiene codice di esempio con test delle dichiarazioni dei tipi. Se il codice *non* funziona anche se viene traspilato da tsc senza errori.
| [`tsconfig.json`](#tsconfigjson) | Ti permette di eseguire `tsc` all'interno del package. |
| [`tslint.json`](#linter-tslintjson) | Abilita il linting. |
Generali eseguento `npx dts-gen --dt --name <mio-package> --template module` se hai npm ≥ 5.2.0, altrimenti `npm install -g dts-gen` and `dts-gen --dt --name <my-package> --template module`.
Leggi tutte le opzioni su [dts-gen](https://github.com/Microsoft/dts-gen).
Expand Down Expand Up @@ -266,17 +265,9 @@ f("one");

Per maggiori dettagli, leggi il readme di [dtslint](https://github.com/microsoft/DefinitelyTyped-tools/tree/master/packages/dtslint#write-tests).

#### Linter: `tslint.json`

Il file di configurazione del linter, `tslint.json`, dovrebbe contenere `{ "extends": "@definitelytyped/dtslint/dt.json" }` e nessun'altra regola.

Se per qualche ragione qualche regola necessita di essere disabilitata, [disabilitala solo per la riga di codice in cui dovrebbe esserlo](https://palantir.github.io/tslint/usage/rule-flags/#comment-flags-in-source-code:~:text=%2F%2F%20tslint%3Adisable%2Dnext%2Dline%3Arule1%20rule2%20rule3...%20%2D%20Disables%20the%20listed%20rules%20for%20the%20next%20line) usando `// tslint:disable-next-line:[ruleName]` e non disabilitandola per tutto il package, in modo tale che tu possa verificarne l'effetto. (CI sono alcune configurazioni lint legacy che hanno del contenuto aggiuntivo tuttavia non dovrebbe più accadere nei lavori futuri).

##### Linter: `.eslintrc.json`

"Definitely Typed" sta migrando ad eslint per il linting.
Al contrario di tslint qui non è necessario un file di configurazione per il linting.
Proprio come tslint dovresti disabilitare le regole solo per determinate linee:
Dovresti disabilitare le regole solo per determinate linee:

```ts
// eslint-disable-next-line no-const-enum
Expand Down
11 changes: 1 addition & 10 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ npm 上にないパッケージの型定義を追加したい場合は、その
| `index.d.ts` | 型定義が含まれる。 |
| [`<パッケージ名>-tests.ts`](#パッケージ名-teststs) | 型定義をテストするサンプルコードが含まれる。このコードは実行は**されません**が、型チェックはされます。 |
| [`tsconfig.json`](#tsconfigjson) | パッケージ内で `tsc` を実行するのに必要。 |
| [`tslint.json`](#linter-tslintjson) | Lint を有効にする。 |
これらのファイルを生成するには、 npm 5.2.0 以上では `npx dts-gen --dt --name <パッケージ名> --template module` 、それより古い環境では `npm install -g dts-gen``dts-gen --dt --name <パッケージ名> --template module` を実行してください。
dts-gen の全オプションは[こちら](https://github.com/Microsoft/dts-gen)で確認できます。
Expand Down Expand Up @@ -270,17 +269,9 @@ f("one");

詳しくは、 [dtslint](https://github.com/microsoft/DefinitelyTyped-tools/tree/master/packages/dtslint#write-tests) の README を参照してください。

#### Linter: `tslint.json`

リンターの設定ファイルである `tslint.json``{ "extends": "@definitelytyped/dtslint/dt.json" }` を含むべきであり、追加のルールは含まれていてはいけません。

何らかの理由で特定のルールを無効にする必要がある場合は、[その特定の行に対して無効にしてください](https://palantir.github.io/tslint/usage/rule-flags/#comment-flags-in-source-code:~:text=%2F%2F%20tslint%3Adisable%2Dnext%2Dline%3Arule1%20rule2%20rule3...%20%2D%20Disables%20the%20listed%20rules%20for%20the%20next%20line)。ルール全体を無効にしないでください。無効にすることが確認可能であるようにするためです。(いくつかの既存のリント設定には追加の内容が含まれていることがあるが、新しい作業ではこれらは発生しないべきです。)

##### Linter: `.eslintrc.json`

Definitely Typed はリントに eslint を使用するよう切り替えています。
tslint とは異なり、リンティングを有効にするための設定ファイルは不要です。
tslint と同様に、特定のルールは特定の行に対してのみ無効にするべきです:
特定のルールは特定の行に対してのみ無効にするべきです:

```ts
// eslint-disable-next-line no-const-enum
Expand Down
14 changes: 10 additions & 4 deletions README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ npm 에 올라가 있지 않은 패키지를 위한 자료형(Typing) 패키지
| `index.d.ts` | 패키지를 위한 자료형(Typing)을 포함하는 파일입니다. |
| [`<my-package>-tests.ts`](#my-package-teststs) | 자료형(Typing)의 테스트를 위한 파일입니다. 이 파일의 코드는 실행되지는 않지만, 자료형 검사(Type checking)를 통과해야 합니다. |
| [`tsconfig.json`](#tsconfigjson) | `tsc` 명령을 돌릴 수 있게 해주는 파일입니다. |
| [`tslint.json`](#linter-tslintjson) | 린터(Linter)를 사용할 수 있게 해주는 파일입니다. |

이 파일들은, npm5.2.0 에서는 `npx dts-gen --dt --name <my-package> --template module` 명령으로,
그 이하 경우에는 `npm install -g dts-gen``dts-gen --dt --name <my-package> --template module` 명령으로 만들 수 있습니다.
Expand Down Expand Up @@ -243,11 +242,18 @@ f("one");
[dtslint](https://github.com/microsoft/DefinitelyTyped-tools/tree/master/packages/dtslint#write-tests) 저장소의 README 파일에서 더 자세한 내용을 확인하실 수 있습니다.
#### Linter: `tslint.json`
##### Linter: `.eslintrc.json`
The linter configuration file, `tslint.json` should contain `{ "extends": "@definitelytyped/dtslint/dt.json" }`, and no additional rules.
If for some reason a lint rule needs to be disabled, disable it for a specific line:
If for some reason some rule needs to be disabled, [disable it for that specific line](https://palantir.github.io/tslint/usage/rule-flags/#comment-flags-in-source-code:~:text=%2F%2F%20tslint%3Adisable%2Dnext%2Dline%3Arule1%20rule2%20rule3...%20%2D%20Disables%20the%20listed%20rules%20for%20the%20next%20line) using `// tslint:disable-next-line:[ruleName]` — not for the whole package, so that disabling can be reviewed. (There are some legacy lint configs that have additional contents, but these should not happen in new work.)
```ts
// eslint-disable-next-line no-const-enum
const enum Const { One }
const enum Enum { Two } // eslint-disable-line no-const-enum
```
You can still disable rules with an .eslintrc.json, but should not in new packages.
Disabling rules for the entire package makes it harder to review.
#### `tsconfig.json`
Expand Down
Loading

0 comments on commit 06e64c8

Please sign in to comment.