Skip to content

Commit

Permalink
Merge branch 'main' into v6
Browse files Browse the repository at this point in the history
  • Loading branch information
bradzacher committed May 11, 2023
2 parents 832e359 + a6f23a2 commit fb66d33
Show file tree
Hide file tree
Showing 41 changed files with 851 additions and 425 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ jobs:
publish_canary_version:
name: Publish the latest code as a canary version
runs-on: ubuntu-latest
permissions:
id-token: write
needs: [integration_tests, lint_with_build, lint_without_build, unit_tests]
if: github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main'
steps:
Expand All @@ -308,6 +310,8 @@ jobs:
publish_canary_version_v6:
name: Publish the next major version code as a canary version
runs-on: ubuntu-latest
permissions:
id-token: write
needs: [integration_tests, lint_with_build, lint_without_build, unit_tests]
if: github.ref == 'refs/heads/v6'
steps:
Expand Down
3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
package-lock=false
package-lock=false
provenance=true
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,38 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [5.59.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.4...v5.59.5) (2023-05-08)

**Note:** Version bump only for package @typescript-eslint/typescript-eslint





## [5.59.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.3...v5.59.4) (2023-05-08)

**Note:** Version bump only for package @typescript-eslint/typescript-eslint





## [5.59.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.2...v5.59.3) (2023-05-08)

**Note:** Version bump only for package @typescript-eslint/typescript-eslint





## [5.59.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.1...v5.59.2) (2023-05-01)

**Note:** Version bump only for package @typescript-eslint/typescript-eslint





## [5.59.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.0...v5.59.1) (2023-04-24)


Expand Down
20 changes: 2 additions & 18 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Thanks goes to these wonderful people:
<td align="center"><a href="https://github.com/bradzacher"><img src="https://avatars.githubusercontent.com/u/7462525?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Brad Zacher</b></sub></a></td>
<td align="center"><a href="https://github.com/JamesHenry"><img src="https://avatars.githubusercontent.com/u/900523?v=4&size=100" width="100px;" alt=""/><br /><sub><b>James Henry</b></sub></a></td>
<td align="center"><a href="https://github.com/armano2"><img src="https://avatars.githubusercontent.com/u/625469?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Armano</b></sub></a></td>
<td align="center"><a href="https://github.com/JoshuaKGoldberg"><img src="https://avatars.githubusercontent.com/u/3335181?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Josh Goldberg</b></sub></a></td>
<td align="center"><a href="https://github.com/JoshuaKGoldberg"><img src="https://avatars.githubusercontent.com/u/3335181?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Josh Goldberg</b></sub></a></td>
<td align="center"><a href="https://github.com/a-tarasyuk"><img src="https://avatars.githubusercontent.com/u/509265?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Oleksandr T.</b></sub></a></td>
</tr>
<tr>
Expand Down Expand Up @@ -58,36 +58,20 @@ Thanks goes to these wonderful people:
</tr>
<tr>
<td align="center"><a href="https://github.com/ikatyang"><img src="https://avatars.githubusercontent.com/u/8341033?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Ika</b></sub></a></td>
<td align="center"><a href="https://github.com/cherryblossom000"><img src="https://avatars.githubusercontent.com/u/31467609?v=4&size=100" width="100px;" alt=""/><br /><sub><b>cherryblossom</b></sub></a></td>
<td align="center"><a href="https://github.com/cherryblossom000"><img src="https://avatars.githubusercontent.com/u/31467609?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Lauren Yim</b></sub></a></td>
<td align="center"><a href="https://github.com/macklinu"><img src="https://avatars.githubusercontent.com/u/2344137?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Mackie Underdown</b></sub></a></td>
<td align="center"><a href="https://github.com/sviat9440"><img src="https://avatars.githubusercontent.com/u/13107421?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Sviatoslav Zaytsev</b></sub></a></td>
<td align="center"><a href="https://github.com/bmish"><img src="https://avatars.githubusercontent.com/u/698306?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Bryan Mishkin</b></sub></a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/lukyth"><img src="https://avatars.githubusercontent.com/u/7040242?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Kanitkorn Sujautra</b></sub></a></td>
<td align="center"><a href="https://github.com/islandryu"><img src="https://avatars.githubusercontent.com/u/65934663?v=4&size=100" width="100px;" alt=""/><br /><sub><b>SHIMA RYUHEI</b></sub></a></td>
<td align="center"><a href="https://github.com/Zzzen"><img src="https://avatars.githubusercontent.com/u/6630042?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Zzzen</b></sub></a></td>
<td align="center"><a href="https://github.com/anikethsaha"><img src="https://avatars.githubusercontent.com/u/26347874?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Anix</b></sub></a></td>
<td align="center"><a href="https://github.com/cparros"><img src="https://avatars.githubusercontent.com/u/65684072?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Cparros</b></sub></a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/ddubrava"><img src="https://avatars.githubusercontent.com/u/22116465?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Daniil Dubrava</b></sub></a></td>
<td align="center"><a href="https://github.com/octogonz"><img src="https://avatars.githubusercontent.com/u/4673363?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Pete Gonzalez</b></sub></a></td>
<td align="center"><a href="https://github.com/ldrick"><img src="https://avatars.githubusercontent.com/u/3674067?v=4&size=100" width="100px;" alt=""/><br /><sub><b>ldrick</b></sub></a></td>
<td align="center"><a href="https://github.com/susisu"><img src="https://avatars.githubusercontent.com/u/2443491?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Susisu</b></sub></a></td>
<td align="center"><a href="https://github.com/kmin-jeong"><img src="https://avatars.githubusercontent.com/u/53456037?v=4&size=100" width="100px;" alt=""/><br /><sub><b>kmin-jeong</b></sub></a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/gavinbarron"><img src="https://avatars.githubusercontent.com/u/7122716?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Gavin Barron</b></sub></a></td>
<td align="center"><a href="https://github.com/platinumazure"><img src="https://avatars.githubusercontent.com/u/284282?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Kevin Partington</b></sub></a></td>
<td align="center"><a href="https://github.com/duailibe"><img src="https://avatars.githubusercontent.com/u/1574588?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Lucas Duailibe</b></sub></a></td>
<td align="center"><a href="https://github.com/Validark"><img src="https://avatars.githubusercontent.com/u/15217173?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Niles Salter</b></sub></a></td>
<td align="center"><a href="https://github.com/pablobirukov"><img src="https://avatars.githubusercontent.com/u/1861546?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Pavel Birukov </b></sub></a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/mightyiam"><img src="https://avatars.githubusercontent.com/u/635591?v=4&size=100" width="100px;" alt=""/><br /><sub><b>Shahar "Dawn" Or</b></sub></a></td>
<td align="center"><a href="https://github.com/koooge"><img src="https://avatars.githubusercontent.com/u/7419215?v=4&size=100" width="100px;" alt=""/><br /><sub><b>koooge</b></sub></a></td>
<td align="center"><a href="https://github.com/thomasmichaelwallace"><img src="https://avatars.githubusercontent.com/u/1954845?v=4&size=100" width="100px;" alt=""/><br /><sub><b>thomas michael wallace</b></sub></a></td>
</tr>
</table>

Expand Down
54 changes: 50 additions & 4 deletions docs/linting/Troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,67 @@ If you don't find an existing extension rule, or the extension rule doesn't work
## I get errors telling me "ESLint was configured to run ... However, that TSConfig does not / none of those TSConfigs include this file"

These errors are caused by an ESLint config requesting type information be generated for a file that isn't included in the TypeScript configuration.

### Fixing the Error

<!-- prettier-ignore-start -->

- If you **do not** want to lint the file:
- Use [one of the options ESLint offers](https://eslint.org/docs/latest/user-guide/configuring/ignoring-code) to ignore files, namely a `.eslintignore` file, or `ignorePatterns` config.
- If you **do** want to lint the file:
- If you **do not** want to lint the file with [type-aware linting](./Typed_Linting.mdx):
- Use [ESLint's `overrides` configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#configuration-based-on-glob-patterns) to configure the file to not be parsed with type information.
- A popular setup is to omit the above additions from top-level configuration and only apply them to TypeScript files via an override.
- Alternatively, you can add `parserOptions: { project: null }` to an override for the files you wish to exclude. Note that `{ project: undefined }` will not work.
- Use [ESLint's `overrides` configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#configuration-based-on-glob-patterns) to configure the file to not be parsed with type information:
<details>
<summary>
A popular setup is to remove all rules requiring type information from the top-level configuration
and only apply them to TypeScript files via an override.
</summary>

```js title=".eslintrc.cjs"
module.exports = {
// ... the rest of your config ...
overrides: [
{
extends: [
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
files: ['./**/*.{ts,tsx}'],
},
],
};
```

</details>
<details>
<summary>
Alternatively, in our <a href="/blog/announcing-typescript-eslint-v6-beta">version v6</a>, you can use our{' '}
<a href="https://v6--typescript-eslint.netlify.app/linting/configs#disable-type-checked"><code>disable-type-checked</code> config</a> to disable type checking for just that type of file.
</summary>

```js title=".eslintrc.cjs"
module.exports = {
// ... the rest of your config ...
overrides: [
{
extends: ['plugin:@typescript-eslint/disable-type-checked'],
files: ['./**/*.js'],
},
],
};
```
To disable type checking for files manually, set `parserOptions: { project: null }` to an override for the files you wish to exclude. Note that `{ project: undefined }` will not work, and you'll also need to disable any rules or rule options that require type checking.
</details>

- If you **do** want to lint the file with [type-aware linting](./Typed_Linting.mdx):
- Check the `include` option of each of the tsconfigs that you provide to `parserOptions.project` - you must ensure that all files match an `include` glob, or else our tooling will not be able to find it.
- Check the `include` option of each of the TSConfigs that you provide to `parserOptions.project` - you must ensure that all files match an `include` glob, or else our tooling will not be able to find it.
- If the file is a `.cjs`, `.js`, or `.mjs` file, make sure [`allowJs`](https://www.typescriptlang.org/tsconfig#allowJs) is enabled.
- If your file shouldn't be a part of one of your existing tsconfigs (for example, it is a script/tool local to the repo), then consider creating a new tsconfig (we advise calling it `tsconfig.eslint.json`) in your project root which lists this file in its `include`. For an example of this, you can check out the configuration we use in this repo:
- [`tsconfig.eslint.json`](https://github.com/typescript-eslint/typescript-eslint/blob/main/tsconfig.eslint.json)
- [`.eslintrc.js`](https://github.com/typescript-eslint/typescript-eslint/blob/main/.eslintrc.js)

<!-- prettier-ignore-end -->

### More Details

This error may appear from the combination of two things:
Expand Down
11 changes: 8 additions & 3 deletions docs/linting/Typed_Linting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: Linting with Type Information
Some typescript-eslint rules utilize the awesome power of TypeScript's type checking APIs to provide much deeper insights into your code.
To tap into TypeScript's additional powers, there are two small changes you need to make to your config file:

```js title=".eslintrc.js"
```js title=".eslintrc.cjs"
/* eslint-env node */
module.exports = {
extends: [
Expand All @@ -27,10 +27,15 @@ module.exports = {
};
```

:::caution
Your `.eslintrc.cjs` file may start receiving a parsing error about type information.
See [our TSConfig inclusion FAQ](./Troubleshooting.mdx#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file).
:::

In more detail:

- `plugin:@typescript-eslint/recommended-type-checked` is another [recommended configuration](./Configurations.mdx) we provide. This one contains recommended rules that additionally require type information.
- `parserOptions.project` tells our parser the relative path where your project's `tsconfig.json` is.
- `plugin:@typescript-eslint/recommended-type-checked` is another [recommended configuration](./CONFIGURATIONS.mdx) we provide. This one contains recommended rules that additionally require type information.
- `parserOptions.project` tells our parser how to find the TSConfig for each source file (`true` indicates to find the closest `tsconfig.json` for each source file)
- If your project is a multi-package monorepo, see [our docs on configuring a monorepo](./typed-linting/Monorepos.mdx).
- `parserOptions.tsconfigRootDir` tells our parser the absolute path of your project's root directory (see [Parser#tsconfigRootDir](../architecture/Parser.mdx#tsconfigRootDir)).

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "5.59.1",
"version": "5.59.5",
"npmClient": "yarn",
"useWorkspaces": true,
"stream": true
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"@types/prettier": "^2.7.2",
"@types/semver": "^7.3.13",
"@types/tmp": "^0.2.3",
"console-fail-test": "^0.1.8",
"console-fail-test": "^0.2.3",
"cross-fetch": "^3.1.5",
"cspell": "^6.31.1",
"downlevel-dts": ">=0.11.0",
Expand All @@ -99,7 +99,7 @@
"jest-diff": "^29.5.0",
"jest-snapshot": "^29.5.0",
"jest-specific-snapshot": "^8.0.0",
"lerna": "6.6.1",
"lerna": "6.6.2",
"lint-staged": "^13.2.2",
"make-dir": "^3.1.0",
"markdownlint-cli": "^0.33.0",
Expand Down
32 changes: 32 additions & 0 deletions packages/ast-spec/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,38 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [5.59.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.4...v5.59.5) (2023-05-08)

**Note:** Version bump only for package @typescript-eslint/ast-spec





## [5.59.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.3...v5.59.4) (2023-05-08)

**Note:** Version bump only for package @typescript-eslint/ast-spec





## [5.59.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.2...v5.59.3) (2023-05-08)

**Note:** Version bump only for package @typescript-eslint/ast-spec





## [5.59.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.1...v5.59.2) (2023-05-01)

**Note:** Version bump only for package @typescript-eslint/ast-spec





## [5.59.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.0...v5.59.1) (2023-04-24)

**Note:** Version bump only for package @typescript-eslint/ast-spec
Expand Down
2 changes: 1 addition & 1 deletion packages/ast-spec/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/ast-spec",
"version": "5.59.1",
"version": "5.59.5",
"description": "Complete specification for the TypeScript-ESTree AST",
"private": true,
"keywords": [
Expand Down
32 changes: 32 additions & 0 deletions packages/eslint-plugin-internal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,38 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [5.59.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.4...v5.59.5) (2023-05-08)

**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal





## [5.59.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.3...v5.59.4) (2023-05-08)

**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal





## [5.59.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.2...v5.59.3) (2023-05-08)

**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal





## [5.59.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.1...v5.59.2) (2023-05-01)

**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal





## [5.59.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.0...v5.59.1) (2023-04-24)

**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
Expand Down
10 changes: 5 additions & 5 deletions packages/eslint-plugin-internal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin-internal",
"version": "5.59.1",
"version": "5.59.5",
"private": true,
"main": "dist/index.js",
"scripts": {
Expand All @@ -13,10 +13,10 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
"@typescript-eslint/rule-tester": "5.59.1",
"@typescript-eslint/scope-manager": "5.59.1",
"@typescript-eslint/type-utils": "5.59.1",
"@typescript-eslint/utils": "5.59.1",
"@typescript-eslint/rule-tester": "5.59.5",
"@typescript-eslint/scope-manager": "5.59.5",
"@typescript-eslint/type-utils": "5.59.5",
"@typescript-eslint/utils": "5.59.5",
"prettier": "*"
}
}
32 changes: 32 additions & 0 deletions packages/eslint-plugin-tslint/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,38 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [5.59.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.4...v5.59.5) (2023-05-08)

**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint





## [5.59.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.3...v5.59.4) (2023-05-08)

**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint





## [5.59.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.2...v5.59.3) (2023-05-08)

**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint





## [5.59.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.1...v5.59.2) (2023-05-01)

**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint





## [5.59.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.0...v5.59.1) (2023-04-24)

**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
Expand Down

0 comments on commit fb66d33

Please sign in to comment.