Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…yTyped into eslint-enhance-rule-rule-listener
  • Loading branch information
acid-chicken committed Aug 22, 2020
2 parents 0909c3e + 0dc5a70 commit 3c01315
Show file tree
Hide file tree
Showing 2,860 changed files with 154,156 additions and 64,234 deletions.
38 changes: 20 additions & 18 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,28 @@ name: CI
on: pull_request

jobs:
test:
runs-on: ubuntu-latest
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "12"

# Get local dependencies
- run: npm install
# Get local dependencies
- run: npm install

# Run tests
- run: npm run test
# Run tests
- run: npm run test

- name: "Run Danger"
env:
# See https://github.com/danger/danger-js/issues/1042
DANGER_GITHUB_API_BASE_URL: "https://api.github.com"
- name: "Run Danger"
env:
# See https://github.com/danger/danger-js/issues/1042
DANGER_GITHUB_API_BASE_URL: "https://api.github.com"

# Danger failing (for example through rate-limiting) shouldn't fail the build
run: |
TOKEN='7469b4e94ce21b43e3ab7a'
TOKEN+='79960c12a1e067f2ec'
DANGER_GITHUB_API_TOKEN=$TOKEN yarn danger ci || $( exit 0 )
# Danger failing (for example through rate-limiting) shouldn't fail the build
run: |
TOKEN='7469b4e94ce21b43e3ab7a'
TOKEN+='79960c12a1e067f2ec'
DANGER_GITHUB_API_TOKEN=$TOKEN yarn danger ci || $( exit 0 )
1 change: 1 addition & 0 deletions .github/workflows/UpdateCodeowners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
jobs:
update:
runs-on: ubuntu-latest
if: github.repository == 'DefinitelyTyped/DefinitelyTyped'

steps:
- uses: actions/checkout@v2
Expand Down
5 changes: 3 additions & 2 deletions README.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ npm install --save-dev @types/node
这通常会在 `package.json` 文件中的 `"types"``"typings"` 字段中提供,
或者可以只查找包中的任何 ".d.ts" 文件并手动将它们包含在 `/// <reference path="" />`.

#### 旧版本的 TypeScript(2.9 和更早版本)
#### 旧版本的 TypeScript(3.0 和更早版本)

Definitely Typed 仅在小于 2 年的 TypeScript 版本上测试软件包。当前已测试 3.0 及更高版本。如果您使用的是 TypeScript 2.0 到 2.9,仍然可以尝试安装 @types 软件包,大多数软件包都不使用 TypeScript 的新特性。但是不能保证它们会起作用,这是支持窗口:
Definitely Typed 仅在小于 2 年的 TypeScript 版本上测试软件包。当前已测试 3.1 及更高版本。如果您使用的是 TypeScript 2.0 到 3.0,仍然可以尝试安装 @types 软件包,大多数软件包都不使用 TypeScript 的新特性。但是不能保证它们会起作用,这是支持窗口:

Version | Released | End of Support
-- | -- | --
Expand All @@ -77,6 +77,7 @@ Version | Released | End of Support
3.7 | November 2019 | November 2021
3.8 | February 2020 | February 2022
3.9 | May 2020 | May 2022
4.0 | August 2020 | August 2022

`@types` 软件包具有它们明确支持的 TypeScript 版本的标记,因此通常可以获取早于 2 年窗口的较早版本的软件包。例如,如果运行 `npm dist-tags @types/react`,您将看到 TypeScript 2.5 可以将类型用于 react@16.0,而 TypeScript 2.6 和 2.7 可以将类型用于 react@16.4:

Expand Down
5 changes: 3 additions & 2 deletions README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ Si aún no puedes encontrarlo, comprueba si el paquete ya [incluye](http://www.t
Esto es provisto usualmente en el campo `"types"` o `"typings"` en el `package.json`,
o solo busca por cualquier archivo ".d.ts" en el paquete e inclúyelo manualmente con un `/// <reference path="" />`.

#### Versiones más viejas de Typescript (2.9 y anteriores)
#### Versiones más viejas de Typescript (3.0 y anteriores)

Definitely Typed solamente prueba paquetes en versiones de TypeScript que son menores a 2 años.
Actualmente, las versiones 3.0 y posteriores están siendo probadas. Si estas usando TypeScript 2.0 a 2.9, puedes intentar instalando paquetes `@types` &mdash; la mayoría de los paquetes no usan los beneficios de Typescript más nuevos. No hay garantía de que funcionen.
Actualmente, las versiones 3.1 y posteriores están siendo probadas. Si estas usando TypeScript 2.0 a 3.0, puedes intentar instalando paquetes `@types` &mdash; la mayoría de los paquetes no usan los beneficios de Typescript más nuevos. No hay garantía de que funcionen.
Versiones soportadas:

Versión | Liberado | Fin de soporte
Expand All @@ -52,6 +52,7 @@ Versión | Liberado | Fin de soporte
3.7 | Noviembre 2019 | Noviembre 2021
3.8 | Febrero 2020 | Febrero 2022
3.9 | Mayo 2020 | Mayo 2022
4.0 | Agosto 2020 | Agosto 2022

Los paquetes `@types` tienen etiquetas para las versiones de Typescript que explícitamente soportan, usualmente puedes obtener versiones más viejas de los paquetes anteriores a 2 años.
Por ejemplo, si ejecutas `npm dist-tags @types/react`, observaras que Typescript 2.5 puede usar types para react@16.0, a su vez, Typescript 2.6 y 2.7 pueden usar types para react@16.4.
Expand Down
7 changes: 4 additions & 3 deletions README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ NPM 의 "foo" 패키지에 대응되는 자료형 패키지는 "@types/foo" 입
이 경우 주로 `package.json` 파일의 `"types"``"typings"` 필드(Field)를 통해 제공되지만,
`/// <reference path="" />` 같은 주석을 사용하여 패키지 안의 ".d.ts" 파일들을 직접 가져와야 할 수도 있습니다.

#### 이전 버전 TypeScript (2.9 또는 그 이전)
#### 이전 버전 TypeScript (3.0 또는 그 이전)

Definitely Typed는 2년이 지나지 않은 TypeScript 버전만을 대상으로 패키지를 테스트합니다.
현재 버전 3.0 및 그 이상만을 테스트하고 있습니다.
TypeScript 2.0에서 2.9 버전을 사용하는 경우, 그래도 `@types` 패키지를 한번 설치해 보셔도 무방합니다. 최신 TypeScript 기능을 사용하는 패키지는 그리 많지 않으니까요.
현재 버전 3.1 및 그 이상만을 테스트하고 있습니다.
TypeScript 2.0에서 3.0 버전을 사용하는 경우, 그래도 `@types` 패키지를 한번 설치해 보셔도 무방합니다. 최신 TypeScript 기능을 사용하는 패키지는 그리 많지 않으니까요.
그러나 작동 여부를 보장하지는 못합니다.
지원 기간은 다음과 같습니다:

Expand All @@ -87,6 +87,7 @@ TypeScript 2.0에서 2.9 버전을 사용하는 경우, 그래도 `@types` 패
3.7 | 2019년 11월 | 2021년 11월
3.8 | 2020년 2월 | 2022년 2월
3.9 | 2020년 5월 | 2022년 5월
4.0 | 2020년 8월 | 2022년 8월

`@types` 패키지 안에는 패키지가 확실하게 지원하는 TypeScript 버전이 태그로 쓰여 있으므로, 2년 지원 기간이 지난 오래된 패키지도 보통 찾아보실 수 있습니다.
예를 들어, `npm dist-tags @types/react` 명령어를 입력하면 TypeScript 2.5는 react@16.0용 타입을, TypeScript 2.6 및 2.7은 react@16.4용 타입을 사용할 수 있는 것을 확인하실 수 있습니다:
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@ If you still can't find it, check if it [bundles](http://www.typescriptlang.org/
This is usually provided in a `"types"` or `"typings"` field in the `package.json`,
or just look for any ".d.ts" files in the package and manually include them with a `/// <reference path="" />`.

#### Older versions of TypeScript (2.9 and earlier)
#### Older versions of TypeScript (3.0 and earlier)

Definitely Typed only tests packages on versions of TypeScript that are less than 2 years old.
Currently versions 3.0 and above are tested.
If you're using TypeScript 2.0 to 2.9, you can still try installing `@types` packages &mdash; the majority of packages don't use fancy new TypeScript features.
Currently versions 3.1 and above are tested.
If you're using TypeScript 2.0 to 3.0, you can still try installing `@types` packages &mdash; the majority of packages don't use fancy new TypeScript features.
But there's no guarantee that they'll work.
Here is the support window:

Version | Released | End of Support
-- | -- | --
2.8 | March 2018 | March 2020
2.9 | May 2018 | May 2020
3.0 | July 2018 | July 2020
3.0 | July 2018 | August 2020
3.1 | September 2018 | September 2020
3.2 | November 2018 | November 2020
3.3 | January 2019 | January 2021
Expand All @@ -87,6 +87,7 @@ Version | Released | End of Support
3.7 | November 2019 | November 2021
3.8 | February 2020 | February 2022
3.9 | May 2020 | May 2022
4.0 | August 2020 | August 2022

`@types` packages have tags for versions of TypeScript that they explicitly support, so you can usually get older versions of packages that predate the 2-year window.
For example, if you run `npm dist-tags @types/react`, you'll see that TypeScript 2.5 can use types for react@16.0, whereas TypeScript 2.6 and 2.7 can use types for react@16.4:
Expand Down
7 changes: 4 additions & 3 deletions README.pt.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ Se você mesmo assim não consegue achar o pacote, verifique se ele [inclui](htt
Isso normalmente é informado nos campos `"types"` ou `"typings"` no `package.json`,
ou apenas procure por qualquer arquivo ".d.ts" no pacote e manualmente inclua-os com `/// <reference path="" />`.

#### Versões antigas do TypeScript (2.9 e anteriores)
#### Versões antigas do TypeScript (3.0 e anteriores)

O Definitely Typed testa apenas pacotes em versões do TypeScript que tenham sido lançadas a menos de 2 anos.
Atualmente, as versões 3.0 e acima são testadas.
Se você está usando as versões 2.0 a 2.9 do TypeScript, você ainda pode tentar instalar os pacotes `@types` &mdash; a maioria dos pacotes não usam as novas funcionalidades chiques do TypeScript.
Atualmente, as versões 3.1 e acima são testadas.
Se você está usando as versões 2.0 a 3.0 do TypeScript, você ainda pode tentar instalar os pacotes `@types` &mdash; a maioria dos pacotes não usam as novas funcionalidades chiques do TypeScript.
Mas não tem nenhuma garantia de que elas funcionarão.
Esta é a tabela de duração de suporte das versões.

Expand All @@ -87,6 +87,7 @@ Versão | Lançada em | Término do suporte
3.7 | Novembro 2019 | Novembro 2021
3.8 | Fevereiro 2020 | Fevereiro 2022
3.9 | Maio 2020 | Maio 2022
4.0 | Agosto 2020 | Agosto 2022

Pacotes `@types` têm tags para versões do TypeScript que elas explicitamente suportam, então normalmente você pode usar versões mais antigas dos pacotes que precedem o período de 2 anos.
Por exemplo, se você executar o comando `npm dist-tags @types/react`, você verá que o TypeScript 2.5 pode usar os tipos para o react@16.0, enquanto o TypeScript 2.6 e 2.7 podem usar os tipos para o react@16.4:
Expand Down
5 changes: 3 additions & 2 deletions README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ npm install --save-dev @types/node
Если вы все еще не можете найти его, проверьте [включает](https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) ли пакет собственную типизацию.
Обычно это отражается в поле `"types"` или `"typings"` файла `package.json`, или просто ищите любые файлы «.d.ts» в пакете и вручную включайте их с помощью `/// <reference path="" />`.

#### Typescript 2.9 и старее
#### Typescript 3.0 и старее

Начиная с ноября 2019 года, Definitely Typed тестирует пакеты только на версиях Typescript, которым меньше двух лет.
Если вы используете Typescript от 2.0 до 2.9, вы все равно можете попробовать установить пакеты `@types` - большинство пакетов не используют новые функции Typescript.
Если вы используете Typescript от 2.0 до 3.0, вы все равно можете попробовать установить пакеты `@types` - большинство пакетов не используют новые функции Typescript.
Но нет гарантии, что они будут работать.

График обновлений:
Expand All @@ -93,6 +93,7 @@ npm install --save-dev @types/node
3.7 | Ноябрь 2019 | Ноябрь 2021
3.8 | Февраль 2020 | Февраль 2022
3.9 | Май 2020 | Май 2022
4.0 | Август 2020 | Август 2022


Пакеты, которые существовали до ноября 2019 года, могут иметь более старые версии, которые явно помечены как совместимые с более старыми версиями Typescript; используйте тег "ts2.6" для Typescript 2.6, например.
Expand Down
52 changes: 39 additions & 13 deletions docs/admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Welcome! This is a resource for the person who is on call for Definitely Typed.
assigned to Definitely Typed duty, where they do a week on-call. You can see the [schedule here](http://aka.ms/DTRotation).

When on-call, your goal is to try keep on top of the many open PRs for Definitely Typed; they are categorized into
different sections inside the [Projects board](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/4) on this repo.
different sections inside the [Projects board](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/5) on this repo.

You should scan from left to right through the boards, and ideally try to start at the oldest PR in a section and work
your way through to the newest. There is a tool: [`focus-dt`](https://github.com/DefinitelyTyped/focus-dt) which can help with this.
Expand All @@ -15,6 +15,7 @@ of how well the changes fit the rest of the type definitions and if it could bre
With the impact understood, your job is to delegate to the people who actually know how to review the code: users
of the library who have agreed to look after the types.


### Looking at a PR

For a [quick TLDR overview, you can read these slides](https://docs.google.com/presentation/d/1Q4xfZSY7d9yHhtxSyb-DE85fTXB38RyF3nnyVyvenwc/edit#slide=id.p).
Expand All @@ -24,6 +25,31 @@ Some key concepts:
- Popular packages can break more installs, and will need more time and focus
- There are a handful of authors who have shipped a lot of high quality contributions who you can happily delegate to


##### "Blessing" a PR

If a PR looks kind of ok, but you don't want to submit an approving review (it can be mistaken as an expert approval),
then move the PR *away* from the `Needs Maintainer Review` and the bot will interpret that as an implicit blessing. (Do
this using the dropdown column in the "Projects" box on the right.) Like reviews, updates to the PR will void such a
blessing.

The column you move it to doesn't make any difference to the bot, it will move it to the right one if needed, but it
works best to move it to `Waiting for Code Reviews`.

> **Disclaimer:** It is currently impossible to get from/to information about column moves, so the bot ignores the
> column it was moved from. This means that it is impossible to cancel a blessing, but you can still submit a review if
> changes are needed.

##### Project board columns

- `Needs Maintainer Action`: PRs that cannot be dismissed with a blessing
- `Needs Maintainer Review`: Main maintainer queue column
- `Other`: Something went wrong, PRs can pop up there for a short time before the test results are in
- `Waiting for Author to Merge`: All good, and the owner can self-merge their PR
- `Needs Author Action`, `Recently Merged`, `Waiting for Code Reviews`: Self describing


##### Amending an existing Definitely Typed Package

An ideal PR to a DT package looks like:
Expand All @@ -32,18 +58,18 @@ An ideal PR to a DT package looks like:
- Only additions to the existing types
- Test code which covers the existing use case

Most of the PRs are like this, in which case then a review for that PR should be pretty quick. Look through the code
Most of the PRs are like this, in which case a review for that PR should be pretty quick. Look through the code
changes, then see if there are comments asking for the merge to be delayed. If not, then you're good to merge. You
can then leave a thanks comment and hit the merge button.

Constraints which you should consider:

- Will the PR break existing code?
- This can sometimes be hard to decipher from the diff, e.g. an additional only PR may break superclasses of a class
- This can sometimes be hard to decipher from the diff, e.g., an addition-only PR may break superclasses of a class
- We try to make sure that types are a semver match on `major.min` for the library they represent
- A build breaking change therefore can be a trade-off where you have to talk with the library maintainer, and get their sign-offs that it is worth it

- Is it popular? (e.g. do you recognise it) if so, it should probably have two sign-offs
- Is it popular? (e.g., do you recognize it) if so, it should probably have two sign-offs
- The PR has merge conflicts, you can try edit the PR using the GitHub UI if it's a trivial change, then come back tomorrow
- The PR has no tests, possibly the package on DT hasn't got tests set up. You can decide if that's a blocker or not depending on how likely the code is going to break existing code
- The `tslint.json` does not have exceptions to the rules in it
Expand All @@ -67,28 +93,28 @@ Constraints which you should consider:
```

`react-*` packages get a pass on this.
- Their `tsconfig.json` should never have `esModuleInterop: true`, which would hide the above issue.
Their `tsconfig.json` should never have `esModuleInterop: true`, which would hide the above issue.


##### New Definitely Typed Package

- Is the author also a maintainer of the library? If so, they could use [`--declaration` and `--allowJs`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#--declaration-and---allowjs) in TypeScript to generate their types.


### Useful Repos and Links

The process of handling PRs:

- [DT projects](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/4) - an automated board saying where open PRs live
- [dt-merge-bot](https://github.com/RyanCavanaugh/dt-mergebot/) - the bot which sets the labels on PRs, and update's project status
- [dt-merge-bot graphql](https://github.com/RyanCavanaugh/dt-mergebot/tree/use-graphql) - the WIP v2 of the bot to automate the labels/projects
- [focus-dt](https://github.com/DefinitelyTyped/focus-dt) - a tool which controls chrome to load up the next PR to review, so you can focus
- [dtslint](https://github.com/microsoft/dtslint) - the CLI tool used to validate PRs on Definitely Typed
- [DT projects](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/5) — an automated board saying where open PRs live
- [dt-merge-bot](https://github.com/DefinitelyTyped/dt-mergebot/) — the bot which sets the labels on PRs, and update's project status
- [focus-dt](https://github.com/DefinitelyTyped/focus-dt) — a tool which controls chrome to load up the next PR to review, so you can focus
- [dtslint](https://github.com/microsoft/dtslint) — the CLI tool used to validate PRs on Definitely Typed

The process of deploying changes:

- [types-publisher](https://github.com/microsoft/types-publisher) - when a PR is merged, types-publisher moves the contents to NPM/GitHub Package Repository
- [CI](https://dev.azure.com/definitelytyped/DefinitelyTyped/_build) - the build pipelines on Azure which does most of the work
- [types-publisher](https://github.com/microsoft/DefinitelyTyped-tools/tree/master/packages/publisher) when a PR is merged, types-publisher moves the contents to NPM/GitHub Package Repository
- [CI](https://dev.azure.com/definitelytyped/DefinitelyTyped/_build) the build pipelines on Azure which does most of the work

Recommendations we make:

- [dts-gen](https://github.com/Microsoft/dts-gen) - a tool for creating a DT folder automatically
- [dts-gen](https://github.com/Microsoft/dts-gen) a tool for creating a DT folder automatically

0 comments on commit 3c01315

Please sign in to comment.