Skip to content

Commit

Permalink
Merge branch 'main'
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Jul 4, 2023
2 parents e35c5c1 + 3e18a31 commit c233652
Show file tree
Hide file tree
Showing 110 changed files with 6,928 additions and 1,009 deletions.
2 changes: 2 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"ambiently",
"Armano",
"astexplorer",
"Astro",
"ASTs",
"autofix",
"autofixers",
Expand Down Expand Up @@ -122,6 +123,7 @@
"transpiles",
"transpiling",
"triaging",
"trpc",
"tsconfigs",
"tseslint",
"tsvfs",
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ jobs:
retention-days: 1

website_tests:
# The NETLIFY_TOKEN secret will not be available on forks
if: github.repository_owner == 'typescript-eslint'
permissions:
contents: read # to fetch code (actions/checkout)

Expand Down
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-v
# prettier doesn't yet support `const` modifiers for type parameters
packages/ast-spec/src/special/TSTypeParameter/fixtures

# prettier doesn't yet support JSX namespaced attributes
packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/fixture.tsx
packages/scope-manager/tests/fixtures/jsx/namespaced-attribute.tsx

# Ignore CHANGELOG.md files to avoid issues with automated release job
CHANGELOG.md

Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,31 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [5.61.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.60.1...v5.61.0) (2023-07-03)


### Features

* **eslint-plugin:** [ban-types] ban types in extends and implements ([#7129](https://github.com/typescript-eslint/typescript-eslint/issues/7129)) ([997783f](https://github.com/typescript-eslint/typescript-eslint/commit/997783ff108ca18af709667ef3fdfa7134a8eefe))
* support TypeScript 5.1 ([#7088](https://github.com/typescript-eslint/typescript-eslint/issues/7088)) ([4bf2d73](https://github.com/typescript-eslint/typescript-eslint/commit/4bf2d7360eaf74c9ef87b196ff4c459b8f50800b))
* use graphemer instead of grapheme-splitter ([#7069](https://github.com/typescript-eslint/typescript-eslint/issues/7069)) ([faea3ff](https://github.com/typescript-eslint/typescript-eslint/commit/faea3ff8b4d750974c41262b44db314f20d0c99c))

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.





## [5.60.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.60.0...v5.60.1) (2023-06-26)

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

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.





# [5.60.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.11...v5.60.0) (2023-06-19)


Expand Down
18 changes: 0 additions & 18 deletions docs/Architecture.mdx

This file was deleted.

10 changes: 10 additions & 0 deletions docs/Developers.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
id: developers
title: Developers
---

These are the developer guides to working with the typescript-eslint tooling.
It's intended for use by third-parties who want to use our tools to build great things.

> If you're reading this as a new developer: welcome to the community!
> We're happy to have you! ❤️‍🔥
4 changes: 2 additions & 2 deletions docs/Getting_Started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ ESLint will lint all TypeScript compatible files within the current folder, and

## Details

- `parser: '@typescript-eslint/parser'` tells ESLint to use the [`@typescript-eslint/parser`](./architecture/Parser.mdx) package you installed to parse your source files.
- `parser: '@typescript-eslint/parser'` tells ESLint to use the [`@typescript-eslint/parser`](./packages/Parser.mdx) package you installed to parse your source files.
- This is required, or else ESLint will throw errors as it tries to parse TypeScript code as if it were regular JavaScript.
- `plugins: ['@typescript-eslint']` tells ESLint to load the [`@typescript-eslint/eslint-plugin`](./architecture/ESLint_Plugin.mdx) package as a plugin.
- `plugins: ['@typescript-eslint']` tells ESLint to load the [`@typescript-eslint/eslint-plugin`](./packages/ESLint_Plugin.mdx) package as a plugin.
- This allows you to use typescript-eslint's rules within your codebase.
- `extends: [ ... ]` tells ESLint that your config extends the given configurations.
- `eslint:recommended` is ESLint's inbuilt "recommended" config - it turns on a small, sensible set of rules which lint for well-known best-practices.
Expand Down
6 changes: 4 additions & 2 deletions docs/Maintenance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ This is the maintainers guide to working on typescript-eslint.
It's intended for use by contributors who have been given access to at least triage issues and pull requests.
We keep it in the open for visibility into our processes.

> If you're reading this as a new maintainer: welcome!
> We're happy to have you! ❤️‍🔥
:::info Welcome!
If you're reading this as a new maintainer: welcome!
We're happy to have you! ❤️‍🔥
:::
18 changes: 18 additions & 0 deletions docs/Packages.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
id: packages
title: Packages
---

The `@typescript-eslint/*` packages are all stored in [our GitHub monorepo](https://github.com/typescript-eslint/typescript-eslint).
The monorepo is built with [Lerna](https://lerna.js.org) and [Nx](https://nx.dev).

Each page in this section corresponds to a package we intentionally expose to users.
They are:

- [`@typescript-eslint/eslint-plugin`](./packages/ESLint_Plugin.mdx): An ESLint plugin which provides lint rules for TypeScript codebases.
- [`@typescript-eslint/eslint-plugin-tslint`](./packages/ESLint_Plugin_TSLint.mdx): An ESLint plugin that allows running TSLint rules within ESLint to help you migrate from TSLint to ESLint.
- [`@typescript-eslint/parser`](./packages/Parser.mdx): An ESLint parser which allows for ESLint to lint TypeScript source code.
- [`@typescript-eslint/rule-tester`](./packages/Rule_Tester.mdx): A utility for testing ESLint rules.
- [`@typescript-eslint/scope-manager`](./packages/Scope_Manager.mdx): A fork of [`eslint-scope`](https://github.com/eslint/eslint-scope), enhanced to support TypeScript functionality.
- [`@typescript-eslint/typescript-estree`](./packages/TypeScript_ESTree.mdx): The underlying code used by [`@typescript-eslint/parser`](./packages/Parser.mdx) that converts TypeScript source code into an [ESTree](https://github.com/estree/estree)-compatible form.
- [`@typescript-eslint/utils`](./packages/Utils.mdx): Utilities for working with TypeScript + ESLint together.
12 changes: 12 additions & 0 deletions docs/Users.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
id: users
title: Users
---

These are the user guides to consuming the typescript-eslint tooling.
It's intended for users who want to consume our tools.

:::info Welcome!
If you're reading this as a new user: welcome to the community!
We're happy to have you! ❤️‍🔥
:::
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ We can always move an issue to a discussion if it becomes unexpectedly deep.

:::caution
Please don't use Discussions as a support forum.
See [Issues > Questions and Support Requests](./Issues.mdx#questions-and-support-requests).
See [Contributing > Issues > Questions and Support Requests](./Issues.mdx#questions-and-support-requests).
:::
2 changes: 1 addition & 1 deletion docs/contributing/Local_Development.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ For example, if you make a change within `scope-manager` and want to use it in `
The following checks are all run on pull requests automatically.
You can also perform them locally.

> See [Contributing > Pull Requests](../Contributing.mdx#raising-a-pr) for more information on pull requests.
> See [Contributing > Pull Requests](./Pull_Requests.mdx) for more information on pull requests.
### Formatting

Expand Down
8 changes: 4 additions & 4 deletions docs/Custom_Rules.mdx → docs/developers/Custom_Rules.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
id: custom-rules
sidebar_label: Custom Rules
sidebar_label: Building Custom Rules
title: Custom Rules
---

:::important
This page describes how to write your own custom ESLint rules using typescript-eslint.
You should be familiar with [ESLint's developer guide](https://eslint.org/docs/developer-guide) and [ASTs](https://typescript-eslint.io/blog/asts-and-typescript-eslint) before writing custom rules.
You should be familiar with [ESLint's developer guide](https://eslint.org/docs/developer-guide) and [ASTs](/blog/asts-and-typescript-eslint) before writing custom rules.
:::

As long as you are using `@typescript-eslint/parser` as the `parser` in your ESLint configuration, custom ESLint rules generally work the same way for JavaScript and TypeScript code.
Expand All @@ -18,7 +18,7 @@ The main three changes to custom rules writing are:

## Utils Package

The [`@typescript-eslint/utils`](./architecture/Utils.mdx) package acts as a replacement package for `eslint` that exports all the same objects and types, but with typescript-eslint support.
The [`@typescript-eslint/utils`](../packages/Utils.mdx) package acts as a replacement package for `eslint` that exports all the same objects and types, but with typescript-eslint support.
It also exports common utility functions and constants most custom typescript-eslint rules tend to use.

:::caution
Expand Down Expand Up @@ -277,7 +277,7 @@ This can be necessary for TypeScript APIs not wrapped by the parser services.
`@typescript-eslint/rule-tester` exports a `RuleTester` with a similar API to the built-in ESLint `RuleTester`.
It should be provided with the same `parser` and `parserOptions` you would use in your ESLint configuration.

Below is a quick-start guide. For more in-depth docs and examples [see the `@typescript-eslint/rule-tester` package documentation](./architecture/Rule_Tester.mdx).
Below is a quick-start guide. For more in-depth docs and examples [see the `@typescript-eslint/rule-tester` package documentation](../packages/Rule_Tester.mdx).

### Testing Untyped Rules

Expand Down
10 changes: 5 additions & 5 deletions docs/linting/Configurations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ module.exports = {
};
```

See [`configs/recommended.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended.ts) for the exact contents of this config.
See [`configs/recommended.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/v6/packages/eslint-plugin/src/configs/recommended.ts) for the exact contents of this config.

### `recommended-type-checked`

Expand All @@ -102,7 +102,7 @@ module.exports = {
};
```

See [`configs/strict.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/strict.ts) for the exact contents of this config.
See [`configs/strict.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/v6/packages/eslint-plugin/src/configs/strict.ts) for the exact contents of this config.

:::caution
We recommend a TypeScript project extend from `plugin:@typescript-eslint/strict` only if a nontrivial percentage of its developers are highly proficient in TypeScript.
Expand Down Expand Up @@ -160,7 +160,7 @@ typescript-eslint includes a few utility configurations.
Enables each the rules provided as a part of typescript-eslint.
Note that many rules are not applicable in all codebases, or are meant to be configured.

See [`configs/all.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/all.ts) for the exact contents of this config.
See [`configs/all.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/v6/packages/eslint-plugin/src/configs/all.ts) for the exact contents of this config.

:::warning
We do not recommend TypeScript projects extend from `plugin:@typescript-eslint/all`.
Expand All @@ -174,7 +174,7 @@ We don't recommend using this directly; instead, extend from an earlier recommen

This config is automatically included if you use any of the recommended configurations.

See [`configs/base.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/base.ts) for the exact contents of this config.
See [`configs/base.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/v6/packages/eslint-plugin/src/configs/base.ts) for the exact contents of this config.

### `disable-type-checked`

Expand Down Expand Up @@ -219,7 +219,7 @@ module.exports = {

This config is automatically included if you use any of the recommended configurations.

See [`configs/eslint-recommended.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended.ts) for the exact contents of this config.
See [`configs/eslint-recommended.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/v6/packages/eslint-plugin/src/configs/eslint-recommended.ts) for the exact contents of this config.

## Suggesting Configuration Changes

Expand Down
12 changes: 6 additions & 6 deletions docs/linting/Troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: Troubleshooting & FAQs

This happens because TypeScript adds new features that ESLint doesn't know about.

The first step is to [check our list of "extension" rules here](https://typescript-eslint.io/rules/#extension-rules).
The first step is to [check our list of "extension" rules here](/rules/#extension-rules).
An extension rule is a rule which extends the base ESLint rules to support TypeScript syntax.
If you find it in there, give it a go to see if it works for you.
You can configure it by disabling the base rule, and turning on the extension rule.
Expand All @@ -23,10 +23,10 @@ Here's an example with the `semi` rule:
```

If you don't find an existing extension rule, or the extension rule doesn't work for your case, then you can go ahead and check our issues.
[The contributing guide outlines the best way to raise an issue](https://github.com/typescript-eslint/typescript-eslint/blob/main/CONTRIBUTING.md#raising-issues).
[The contributing guide outlines the best way to raise an issue](../contributing/Issues.mdx).

> We release a new version our tooling every week.
> _Please_ ensure that you [check our the latest list of "extension" rules](https://typescript-eslint.io/rules/#extension-rules) **_before_** filing an issue.
> _Please_ ensure that you [check our the latest list of "extension" rules](/rules/#extension-rules) **_before_** filing an issue.
## I get errors telling me "ESLint was configured to run ... However, that TSConfig does not / none of those TSConfigs include this file"

Expand Down Expand Up @@ -207,7 +207,7 @@ See [#2041](https://github.com/typescript-eslint/typescript-eslint/issues/2041)
ESLint core contains the rule [`no-restricted-syntax`](https://eslint.org/docs/rules/no-restricted-syntax).
This generic rule allows you to specify a [selector](https://eslint.org/docs/developer-guide/selectors) for the code you want to ban, along with a custom error message.

You can use an AST visualization tool such as [typescript-eslint playground](https://typescript-eslint.io/play#showAST=es) > _Options_ > _AST Explorer_ on its left sidebar by selecting _ESTree_ to help in figuring out the structure of the AST that you want to ban.
You can use an AST visualization tool such as [typescript-eslint playground](/play#showAST=es) > _Options_ > _AST Explorer_ on its left sidebar by selecting _ESTree_ to help in figuring out the structure of the AST that you want to ban.

For example, you can ban enums (or some variation of) using one of the following configs:

Expand Down Expand Up @@ -326,7 +326,7 @@ See [this issue comment](https://github.com/typescript-eslint/typescript-eslint/
### I get `no-unsafe-*` complaints for cross-file changes

See [Changes to one file are not reflected in linting other files in my IDE](#changes-to-one-file-are-not-reflected-when-linting-other-files-in-my-ide).
Rules such as [`no-unsafe-argument`](https://typescript-eslint.io/rules/no-unsafe-argument), [`no-unsafe-assignment`](https://typescript-eslint.io/rules/no-unsafe-assignment), and [`no-unsafe-call`](https://typescript-eslint.io/rules/no-unsafe-call) are often impacted.
Rules such as [`no-unsafe-argument`](/rules/no-unsafe-argument), [`no-unsafe-assignment`](/rules/no-unsafe-assignment), and [`no-unsafe-call`](/rules/no-unsafe-call) are often impacted.

## "The '`<key>`' property is deprecated on '`<type>`' nodes. Use '`<key>`' instead." warnings

Expand All @@ -352,7 +352,7 @@ The [typescript-eslint v6 release post](https://deploy-preview-6515--typescript-

## My linting feels really slow

If you think you're having issues with performance, see our [Performance Troubleshooting documentation](./troubleshooting/Performance.md).
If you think you're having issues with performance, see our [Performance Troubleshooting documentation](./troubleshooting/Performance.mdx).

## Are TypeScript project references supported?

Expand Down
4 changes: 2 additions & 2 deletions docs/linting/Typed_Linting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ 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 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)).
- `parserOptions.tsconfigRootDir` tells our parser the absolute path of your project's root directory (see [Parser#tsconfigRootDir](../packages/Parser.mdx#tsconfigRootDir)).

With that done, run the same lint command you ran before.
You may see new rules reporting errors based on type information!
Expand All @@ -61,7 +61,7 @@ module.exports = {
};
```

See [the `@typescript-eslint/parser` docs for more details](../architecture/Parser.mdx#project).
See [the `@typescript-eslint/parser` docs for more details](../packages/Parser.mdx#project).

:::note
If your project is a multi-package monorepo, see [our docs on configuring a monorepo](./typed-linting/Monorepos.mdx).
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/linting/troubleshooting/TSLint.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You can look at [the alternatives list](https://github.com/typescript-eslint/typ

There is also the ultimate fallback option of using both linters together for a while during your transition if you
absolutely have to by using TSLint _within_ ESLint.
For this option, check out [`@typescript-eslint/eslint-plugin-tslint`](../../architecture/ESLint_Plugin_TSLint.mdx).
For this option, check out [`@typescript-eslint/eslint-plugin-tslint`](../../packages/ESLint_Plugin_TSLint.mdx).

## Why Deprecate TSLint?

Expand Down
Loading

0 comments on commit c233652

Please sign in to comment.