diff --git a/.cspell.json b/.cspell.json
index ffe51471848e..91dc7f910d0f 100644
--- a/.cspell.json
+++ b/.cspell.json
@@ -150,6 +150,7 @@
"oxlint",
"packagespecifier",
"parameterised",
+ "parenthesization",
"performant",
"pluggable",
"postprocess",
diff --git a/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml b/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml
index 69fc7d6ef7d7..d1d8b6fc4225 100644
--- a/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml
+++ b/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml
@@ -41,6 +41,7 @@ body:
- eslint-plugin
- parser
- project-service
+ - rule-schema-to-typescript-types
- rule-tester
- scope-manager
- tsconfig-utils
diff --git a/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml b/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml
index 7250ea66e0f3..de9f9324e4c0 100644
--- a/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml
+++ b/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml
@@ -27,6 +27,7 @@ body:
- eslint-plugin
- parser
- project-service
+ - rule-schema-to-typescript-types
- rule-tester
- scope-manager
- tsconfig-utils
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 91e78e2a606a..38173f35a252 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -117,7 +117,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- lint-task: ['lint', 'typecheck', 'knip']
+ lint-task: ['deduplicate', 'lint', 'typecheck', 'knip']
env:
NX_CI_EXECUTION_ENV: 'ubuntu-latest'
steps:
@@ -195,6 +195,7 @@ jobs:
'eslint-plugin-internal',
'parser',
'project-service',
+ 'rule-schema-to-typescript-types',
'rule-tester',
'scope-manager',
'tsconfig-utils',
diff --git a/.github/workflows/pr-title-validation.yml b/.github/workflows/pr-title-validation.yml
index 175ce9457a5e..a2a5e5e47a8a 100644
--- a/.github/workflows/pr-title-validation.yml
+++ b/.github/workflows/pr-title-validation.yml
@@ -39,6 +39,7 @@ jobs:
eslint-plugin-internal
parser
project-service
+ rule-schema-to-typescript-types
rule-tester
scope-manager
tsconfig-utils
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2b8ab0a05202..428ab6db594b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,39 @@
+## 8.46.0 (2025-10-06)
+
+### 🚀 Features
+
+- **eslint-plugin:** [no-unsafe-member-access] add allowOptionalChaining option ([#11659](https://github.com/typescript-eslint/typescript-eslint/pull/11659))
+- **eslint-plugin-internal:** [no-dynamic-tests] new internal Lint rule to ban dynamic syntax in generating tests ([#11323](https://github.com/typescript-eslint/typescript-eslint/pull/11323))
+- **rule-schema-to-typescript-types:** clean up and make public ([#11633](https://github.com/typescript-eslint/typescript-eslint/pull/11633))
+- **typescript-eslint:** export util types ([#10848](https://github.com/typescript-eslint/typescript-eslint/pull/10848), [#10849](https://github.com/typescript-eslint/typescript-eslint/pull/10849))
+- **typescript-estree:** mention file specifics in project service allowDefaultProject error ([#11635](https://github.com/typescript-eslint/typescript-eslint/pull/11635))
+- **typescript-estree:** private identifiers can only appear on LHS of in expressions ([#9232](https://github.com/typescript-eslint/typescript-eslint/pull/9232))
+
+### 🩹 Fixes
+
+- **eslint-plugin:** [no-floating-promises] remove excess parentheses in suggestions ([#11487](https://github.com/typescript-eslint/typescript-eslint/pull/11487))
+- **eslint-plugin:** [unbound-method] improve wording around `this: void` and binding ([#11634](https://github.com/typescript-eslint/typescript-eslint/pull/11634))
+- **eslint-plugin:** [no-deprecated] ignore deprecated `export import`s ([#11603](https://github.com/typescript-eslint/typescript-eslint/pull/11603))
+- **eslint-plugin:** removed error type previously deprecated ([#11674](https://github.com/typescript-eslint/typescript-eslint/pull/11674))
+- **eslint-plugin:** [prefer-readonly-parameter-types] ignore tagged primitives ([#11660](https://github.com/typescript-eslint/typescript-eslint/pull/11660))
+- **rule-tester:** deprecate TestCaseError#type and LintMessage#nodeType ([#11628](https://github.com/typescript-eslint/typescript-eslint/pull/11628))
+- **typescript-estree:** forbid `abstract` modifier in object methods ([#11656](https://github.com/typescript-eslint/typescript-eslint/pull/11656))
+- **typescript-estree:** forbid abstract method and accessor to have implementation ([#11657](https://github.com/typescript-eslint/typescript-eslint/pull/11657))
+
+### ❤️ Thank You
+
+- fisker Cheung @fisker
+- Josh Goldberg ✨
+- Joshua Chen
+- Kirk Waiblinger @kirkwaiblinger
+- Mark de Dios @peanutenthusiast
+- Mister-Hope @Mister-Hope
+- Richard Torres @richardtorres314
+- Victor Genaev @mainframev
+- Younsang Na @nayounsang
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
## 8.45.0 (2025-09-29)
### 🚀 Features
diff --git a/docs/contributing/Issues.mdx b/docs/contributing/Issues.mdx
index 5a1945127d0f..9735fccbfd94 100644
--- a/docs/contributing/Issues.mdx
+++ b/docs/contributing/Issues.mdx
@@ -41,6 +41,24 @@ Consider searching through:
1. [Unassigned user-facing marked as `accepting prs` and `good first issue`](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22+label%3A%22accepting+prs%22+-label%3A%22repo+maintenance%22+no%3Aassignee): to find issues marked as good for a first-timer
2. [Unassigned user-facing marked as `accepting prs` without `good first issue`](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aopen+is%3Aissue+label%3A%22accepting+prs%22+-label%3A%22good+first+issue%22+-label%3A%22repo+maintenance%22+no%3Aassignee): once you've finished a few issues, to find more intermediate-level issues
+## "Evaluating Community Engagement"
+
+The typescript-eslint project has limited maintenance bandwidth and cannot commit to every potentially valid issue.
+It can be difficult to tell if some issues' impacts would be worth taking bandwidth away from other, higher-impact issues.
+For those issues, we will:
+
+1. Add an `evaluating community engagement` label to indicate the issue is under review
+2. Wait at least 3-6 months
+3. Either accept or decline the issue, depending on how much engagement the issue receives
+
+If your issue is marked as `evaluating community engagement`, we encourage you to:
+
+- Socialize the issue online to find other users who are in favor of it
+- Try out the proposed changes in your own projects
+ - If the issue is for a new lint rule, consider using our [Building ESLint Plugins documentation](https://typescript-eslint.io/developers/eslint-plugins) to create a standalone plugin users can try
+
+See [Maintenance > Issues > Community Engagement Evaluation](https://typescript-eslint.io/maintenance/issues/#community-engagement-evaluation) for documentation on our corresponding maintenance practices.
+
## Questions and Support Requests
The issue tracker is not an appropriate place for questions or support requests.
diff --git a/docs/getting-started/Typed_Linting.mdx b/docs/getting-started/Typed_Linting.mdx
index bc36f5589735..066774382586 100644
--- a/docs/getting-started/Typed_Linting.mdx
+++ b/docs/getting-started/Typed_Linting.mdx
@@ -33,7 +33,6 @@ export default defineConfig(
languageOptions: {
parserOptions: {
projectService: true,
- tsconfigRootDir: import.meta.dirname,
},
},
},
diff --git a/docs/maintenance/Contributor_Tiers.mdx b/docs/maintenance/Contributor_Tiers.mdx
index 769d523b8e18..ada16278379b 100644
--- a/docs/maintenance/Contributor_Tiers.mdx
+++ b/docs/maintenance/Contributor_Tiers.mdx
@@ -76,6 +76,21 @@ We treat everything here as approximate numbers.
We're a small enough team to informally discuss changes ad hoc and allow off-by-one-or-two months.
:::
+## Advancement
+
+Are you looking to graduate from _contributor_ to _committer_?
+Great!
+
+Roughly speaking, we're looking for folks who are interested in growing towards:
+
+- Being able to contribute to docs & ideation discussions, not just chores + rule fixes & features
+- Being able to empathetically understand the needs of lint rule users (i.e. not just their own personal preferences)
+- Consistently sending high-quality issues and PRs
+ - It's expected that some will have long rounds of discussion; we're more looking to avoid making "common" mistakes repeatedly (requesting review with failing builds, clear large gaps in logic, etc.)
+
+If you've been sending issues and pull requests to typescript-eslint for a few months and want to get more involved, please reach out to one of the maintainers over Discord or email.
+We'd love to support you in joining the team.
+
## Pointing
Although it's impossible to accurately estimate software projects, we want to roughly establish expectations of effort+time spent on the tiers.
diff --git a/docs/packages/ESLint_Plugin.mdx b/docs/packages/ESLint_Plugin.mdx
index 263d7e4123a5..d02afc4be7b0 100644
--- a/docs/packages/ESLint_Plugin.mdx
+++ b/docs/packages/ESLint_Plugin.mdx
@@ -11,6 +11,7 @@ sidebar_label: eslint-plugin
:::info
See [Getting Started](../getting-started/Quickstart.mdx) for documentation on how to lint your TypeScript code with ESLint.
+If you're using ESLint's flat config (`eslint.config.*`), you don't need to install this package or `@typescript-eslint/parser` explicitly.
:::
`@typescript-eslint/eslint-plugin` is an ESLint plugin used to load in custom rules and rule configurations lists from typescript-eslint.
diff --git a/docs/packages/Parser.mdx b/docs/packages/Parser.mdx
index 52a294e67e41..28f5c7bee463 100644
--- a/docs/packages/Parser.mdx
+++ b/docs/packages/Parser.mdx
@@ -63,7 +63,7 @@ interface ParserOptions {
### `disallowAutomaticSingleRunInference`
-> Default `process.env.TSESTREE_SINGLE_RUN` or `true`.
+> Default: `process.env.TSESTREE_SINGLE_RUN` or `true`.
Whether to stop using common heuristics to infer whether ESLint is being used as part of a single run (as opposed to `--fix` mode or in a persistent session such as an editor extension).
In other words, typescript-eslint is faster by default, and this option disables an automatic performance optimization.
@@ -94,7 +94,7 @@ Optional additional options to describe how to parse the raw syntax.
#### `jsx`
-> Default `false`.
+> Default: `false`.
Enable parsing JSX when `true`.
More details can be found in the [TypeScript handbook's JSX docs](https://www.typescriptlang.org/docs/handbook/jsx.html).
@@ -115,13 +115,13 @@ The exact behavior is as follows:
#### `globalReturn`
-> Default `false`.
+> Default: `false`.
This options allows you to tell the parser if you want to allow global `return` statements in your codebase.
### `ecmaVersion`
-> Default `2018`.
+> Default: `2018`.
Accepts any valid ECMAScript version number or `'latest'`:
@@ -135,19 +135,19 @@ Specifies the version of ECMAScript syntax you want to use. This is used by the
### `emitDecoratorMetadata`
-> Default `undefined`.
+> Default: `undefined`.
This option allow you to tell parser to act as if `emitDecoratorMetadata: true` is set in `tsconfig.json`, but without [type-aware linting](../getting-started/Typed_Linting.mdx). In other words, you don't have to specify `parserOptions.project` in this case, making the linting process faster.
### `experimentalDecorators`
-> Default `undefined`.
+> Default: `undefined`.
This option allow you to tell parser to act as if `experimentalDecorators: true` is set in `tsconfig.json`, but without [type-aware linting](../getting-started/Typed_Linting.mdx). In other words, you don't have to specify `parserOptions.project` in this case, making the linting process faster.
### `extraFileExtensions`
-> Default `undefined`.
+> Default: `undefined`.
This option allows you to provide one or more additional file extensions which should be considered in the TypeScript Program compilation.
The default extensions are `['.js', '.mjs', '.cjs', '.jsx', '.ts', '.mts', '.cts', '.tsx']`.
@@ -159,7 +159,7 @@ See [Changes to `extraFileExtensions` with `projectService`](../troubleshooting/
### `isolatedDeclarations`
-> Default `undefined`.
+> Default: `undefined`.
This option allow you to tell parser to act as if `isolatedDeclarations: true` is set in `tsconfig.json`, but without [type-aware linting](../getting-started/Typed_Linting.mdx).
In other words, you don't have to specify `parserOptions.project` in this case, making the linting process faster.
@@ -181,7 +181,7 @@ If you do not use lint rules like `eslint-plugin-deprecation` that rely on TS's
### `jsxFragmentName`
-> Default `null`
+> Default: `null`
The identifier that's used for JSX fragment elements (after transpilation).
If `null`, assumes transpilation will always use a member of the configured `jsxPragma`.
@@ -191,7 +191,7 @@ If you provide `parserOptions.project`, you do not need to set this, as it will
### `jsxPragma`
-> Default `'React'`
+> Default: `'React'`
The identifier that's used for JSX Elements creation (after transpilation).
If you're using a library other than React (like `preact`), then you should change this value. If you are using the [new JSX transform](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) you can set this to `null`.
@@ -202,7 +202,7 @@ If you provide `parserOptions.project`, you do not need to set this, as it will
### `lib`
-> Default `['es2018']`
+> Default: `['es2018']`
For valid options, see the [TypeScript compiler options](https://www.typescriptlang.org/tsconfig#lib).
@@ -212,7 +212,7 @@ If you provide `parserOptions.project`, you do not need to set this, as it will
### `programs`
-> Default `undefined`.
+> Default: `undefined`.
This option allows you to programmatically provide an instance of a TypeScript Program object that will provide type information to rules.
This will override any programs that would have been computed from `parserOptions.project`.
@@ -226,7 +226,7 @@ All linted files must be part of the provided program(s).
We now recommend using [`projectService`](#projectservice) instead of `project` for easier configuration and faster linting.
:::
-> Default `undefined`.
+> Default: `undefined`.
A path to your project's TSConfig. **This setting or [`projectService`](#projectservice) are required to use [rules which require type information](../getting-started/Typed_Linting.mdx)**.
@@ -287,7 +287,7 @@ For an option that allows linting files outside of your TSConfig file(s), see [`
### `projectService`
-> Default `false`.
+> Default: `false`.
Specifies using TypeScript APIs to generate type information for rules.
It will automatically use the nearest `tsconfig.json` for each file (like `project: true`).
@@ -355,7 +355,7 @@ See [Troubleshooting & FAQs > Typed Linting > Project Service Issues](../trouble
##### `allowDefaultProject`
-> Default `[]` _(none)_
+> Default: `[]` _(none)_
Globs of files to allow running with the default project compiler options despite not being matched by the project service.
It takes in an array of string paths that will be resolved relative to the [`tsconfigRootDir`](#tsconfigrootdir).
@@ -371,7 +371,7 @@ There are several restrictions on this option to prevent it from being overused:
##### `defaultProject`
-> Default `'tsconfig.json'`
+> Default: `'tsconfig.json'`
Path to a TSConfig to use instead of TypeScript's default project configuration.
It takes in a string path that will be resolved relative to the [`tsconfigRootDir`](#tsconfigrootdir).
@@ -380,7 +380,7 @@ It takes in a string path that will be resolved relative to the [`tsconfigRootDi
##### `loadTypeScriptPlugins`
-> Default `false`
+> Default: `false`
Whether the project service should be allowed to load [TypeScript plugins](https://www.typescriptlang.org/tsconfig/plugins.html).
This is `false` by default to prevent plugins from registering persistent file watchers or other operations that might prevent ESLint processes from exiting when run on the command-line.
@@ -405,7 +405,7 @@ Each file match slows down linting, so if you do need to use this, please file a
### `projectFolderIgnoreList`
-> Default `["**/node_modules/**"]`.
+> Default: `["**/node_modules/**"]`.
This option allows you to ignore folders from being included in your provided list of `project`s.
This is useful if you have configured glob patterns, but want to make sure you ignore certain folders.
@@ -416,14 +416,25 @@ For example, by default it will ensure that a glob like `./**/tsconfig.json` wil
### `tsconfigRootDir`
-> Default `undefined`.
+> Default: the directory of the ESLint config file.
This option allows you to provide the root directory for relative TSConfig paths specified in the `project` option above.
Doing so ensures running ESLint from a directory other than the root will still be able to find your TSConfig.
+`tsconfigRootDir` uses the call stack to determine the closest `eslint.config.*` ESLint config file.
+In rare edge cases, that detection logic may be tricked by unusual paths and resolve to an incorrect value.
+Manually specifying `tsconfigRootDir` to the directory of your ESLint config file will work around those issues:
+
+```js
+parserOptions: {
+ tsconfigRootDir: import.meta.dirname,
+ // or, in CommonJS, __dirname
+}
+```
+
### `warnOnUnsupportedTypeScriptVersion`
-> Default `true`.
+> Default: `true`.
This option allows you to toggle the warning that the parser will give you if you use a version of TypeScript which is not explicitly supported. The warning message would look like this:
diff --git a/docs/packages/RuleSchemaToTypeScriptTypes.mdx b/docs/packages/RuleSchemaToTypeScriptTypes.mdx
new file mode 100644
index 000000000000..c684c357c5f6
--- /dev/null
+++ b/docs/packages/RuleSchemaToTypeScriptTypes.mdx
@@ -0,0 +1,36 @@
+---
+id: rule-schema-to-typescript-types
+sidebar_label: rule-schema-to-typescript-types
+toc_max_heading_level: 3
+---
+
+import GeneratedDocs from './rule-schema-to-typescript-types/generated/index.md';
+
+# `@typescript-eslint/rule-schema-to-typescript-types`
+
+
+
+> Converts ESLint rule schemas to equivalent TypeScript type strings ✨
+
+```ts
+import { schemaToTypes } from '@typescript-eslint/rule-schema-to-typescript-types';
+
+// "
+// type Options = [
+// /** My great option! */
+// string[]
+// ];
+// "
+schemaToTypes({
+ description: 'My great option!',
+ items: { type: 'string' },
+ type: 'array',
+});
+```
+
+The following documentation is auto-generated from source code.
+
+
diff --git a/docs/packages/TypeScript_ESLint.mdx b/docs/packages/TypeScript_ESLint.mdx
index e2c283adf146..c1e5966d80fd 100644
--- a/docs/packages/TypeScript_ESLint.mdx
+++ b/docs/packages/TypeScript_ESLint.mdx
@@ -22,6 +22,7 @@ This package exports the following:
| `configs` | [Shared ESLint (flat) configs](../users/Shared_Configurations.mdx) |
| `parser` | A re-export of [`@typescript-eslint/parser`](./Parser.mdx) |
| `plugin` | A re-export of [`@typescript-eslint/eslint-plugin`](./ESLint_Plugin.mdx) |
+| `FlatConfig` | A re-export of the type from [`@typescript-eslint/utils`](./Utils.mdx) |
## Installation
@@ -269,7 +270,6 @@ export default defineConfig({
parser: tseslint.parser,
parserOptions: {
projectService: true,
- tsconfigRootDir: import.meta.dirname,
},
},
rules: {
diff --git a/docs/packages/type-utils/TypeOrValueSpecifier.mdx b/docs/packages/type-utils/TypeOrValueSpecifier.mdx
index 7a21d16cf26d..fd04f70cb3bc 100644
--- a/docs/packages/type-utils/TypeOrValueSpecifier.mdx
+++ b/docs/packages/type-utils/TypeOrValueSpecifier.mdx
@@ -76,6 +76,12 @@ Lib types include `lib.dom.d.ts` globals such as `Window` and `lib.es*.ts` globa
### LibSpecifier Examples
+Matching all strings:
+
+```json
+{ "from": "lib", "name": "string" }
+```
+
Matching all array-typed values:
```json
diff --git a/docs/troubleshooting/faqs/Frameworks.mdx b/docs/troubleshooting/faqs/Frameworks.mdx
index f80be6a84296..15de567c5533 100644
--- a/docs/troubleshooting/faqs/Frameworks.mdx
+++ b/docs/troubleshooting/faqs/Frameworks.mdx
@@ -27,7 +27,6 @@ export default defineConfig(
// Add this line
extraFileExtensions: ['.vue'],
projectService: true,
- tsconfigRootDir: import.meta.dirname,
},
},
},
diff --git a/docs/troubleshooting/faqs/General.mdx b/docs/troubleshooting/faqs/General.mdx
index aa04254f59b9..bf42e64c3ce9 100644
--- a/docs/troubleshooting/faqs/General.mdx
+++ b/docs/troubleshooting/faqs/General.mdx
@@ -251,7 +251,6 @@ export default defineConfig(
languageOptions: {
parserOptions: {
projectService: true,
- tsconfigRootDir: import.meta.dirname,
},
},
},
diff --git a/docs/troubleshooting/typed-linting/Monorepos.mdx b/docs/troubleshooting/typed-linting/Monorepos.mdx
index 2364b9defe24..49e118408adb 100644
--- a/docs/troubleshooting/typed-linting/Monorepos.mdx
+++ b/docs/troubleshooting/typed-linting/Monorepos.mdx
@@ -66,7 +66,6 @@ export default defineConfig(
project: true,
// Add this line
project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'],
- tsconfigRootDir: import.meta.dirname,
},
},
},
@@ -89,7 +88,6 @@ module.exports = {
project: true,
// Add this line
project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'],
- tsconfigRootDir: import.meta.dirname,
},
plugins: ['@typescript-eslint'],
root: true,
@@ -118,7 +116,6 @@ export default defineConfig(
project: ['./tsconfig.eslint.json', './**/tsconfig.json'],
// Add this line
project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'],
- tsconfigRootDir: import.meta.dirname,
},
},
},
diff --git a/docs/troubleshooting/typed-linting/Performance.mdx b/docs/troubleshooting/typed-linting/Performance.mdx
index 66b9e2bfbe13..9a3e0a3fbcc4 100644
--- a/docs/troubleshooting/typed-linting/Performance.mdx
+++ b/docs/troubleshooting/typed-linting/Performance.mdx
@@ -186,7 +186,6 @@ export default defineConfig(
{
languageOptions: {
parserOptions: {
- tsconfigRootDir: import.meta.dirname,
// Remove this line
project: ['./**/tsconfig.json'],
// Add this line
diff --git a/docs/troubleshooting/typed-linting/index.mdx b/docs/troubleshooting/typed-linting/index.mdx
index 5b76f5c53ad3..c43b96d118a4 100644
--- a/docs/troubleshooting/typed-linting/index.mdx
+++ b/docs/troubleshooting/typed-linting/index.mdx
@@ -78,7 +78,6 @@ export default defineConfig(
languageOptions: {
parserOptions: {
projectService: true,
- tsconfigRootDir: import.meta.dirname,
},
},
},
@@ -303,7 +302,6 @@ export default defineConfig({
languageOptions: {
parserOptions: {
project: './tsconfig.eslint.json',
- tsconfigRootDir: import.meta.dirname,
},
},
// ...
diff --git a/docs/users/Releases.mdx b/docs/users/Releases.mdx
index 81c6b504dddc..58a4e5c6175d 100644
--- a/docs/users/Releases.mdx
+++ b/docs/users/Releases.mdx
@@ -8,13 +8,44 @@ import useIsBrowser from '@docusaurus/useIsBrowser';
export function LocalTimeOfRelease() {
const isBrowser = useIsBrowser();
- // An arbitrary Monday at 17:00 UTC.
- const date = new Date('1970-01-05T17:00Z');
- const formatted = date.toLocaleTimeString('en-US', {
+ if (!isBrowser) {
+ // An arbitrary Monday at 17:00 UTC.
+ const arbitraryMonday = new Date('1970-01-05T17:00Z');
+ return arbitraryMonday.toLocaleTimeString('en-US', {
+ hour: 'numeric',
+ minute: '2-digit',
+ timeZoneName: 'short',
+ timeZone: 'UTC',
+ });
+ }
+ const now = new Date();
+ const daysAgoToMonday = (now.getUTCDay() + 6) % 7;
+ // Calculate the previous Monday at 17:00 UTC.
+ const previousReleaseDate = new Date(
+ Date.UTC(
+ now.getUTCFullYear(),
+ now.getUTCMonth(),
+ now.getUTCDate() - daysAgoToMonday,
+ 17,
+ ),
+ );
+ // This will happen if the current time is before 17:00 UTC on Monday.
+ if (previousReleaseDate > now) {
+ previousReleaseDate.setUTCDate(previousReleaseDate.getUTCDate() - 7);
+ }
+ // Next release is 7 days later.
+ const nextReleaseDate = new Date(previousReleaseDate.getTime());
+ nextReleaseDate.setUTCDate(previousReleaseDate.getUTCDate() + 7);
+ // If we're near a DST time change, we want to display the time of the release that has the same UTC offset as now.
+ // If, for some reason, neither does, just display the local time of the next release.
+ const releaseWithSameUtcOffset =
+ [nextReleaseDate, previousReleaseDate].find(
+ date => date.getTimezoneOffset() === now.getTimezoneOffset(),
+ ) ?? nextReleaseDate;
+ const formatted = releaseWithSameUtcOffset.toLocaleTimeString('en-US', {
hour: 'numeric',
minute: '2-digit',
timeZoneName: 'short',
- timeZone: isBrowser ? undefined : 'UTC',
});
// Specify the day of week if it's not a Monday.
const dayNames = [
@@ -26,8 +57,10 @@ export function LocalTimeOfRelease() {
'Friday',
'Saturday',
];
- if (date.getDay() !== date.getUTCDay()) {
- return `${dayNames[date.getDay()]}s at ${formatted}`;
+ if (
+ releaseWithSameUtcOffset.getDay() !== releaseWithSameUtcOffset.getUTCDay()
+ ) {
+ return `${dayNames[releaseWithSameUtcOffset.getDay()]}s at ${formatted}`;
}
return formatted;
}
diff --git a/docs/users/Shared_Configurations.mdx b/docs/users/Shared_Configurations.mdx
index ae59cd7c360b..5d8cd232cc1a 100644
--- a/docs/users/Shared_Configurations.mdx
+++ b/docs/users/Shared_Configurations.mdx
@@ -380,7 +380,6 @@ export default defineConfig(
languageOptions: {
parserOptions: {
projectService: true,
- tsconfigRootDir: import.meta.dirname,
},
},
},
diff --git a/eslint-suppressions.json b/eslint-suppressions.json
new file mode 100644
index 000000000000..eddbd9cba3f6
--- /dev/null
+++ b/eslint-suppressions.json
@@ -0,0 +1,97 @@
+{
+ "packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 26
+ }
+ },
+ "packages/eslint-plugin/tests/rules/dot-notation.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 1
+ }
+ },
+ "packages/eslint-plugin/tests/rules/member-ordering/member-ordering-alphabetically-case-insensitive-order.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 4
+ }
+ },
+ "packages/eslint-plugin/tests/rules/member-ordering/member-ordering-alphabetically-order.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 4
+ }
+ },
+ "packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 12
+ }
+ },
+ "packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 12
+ }
+ },
+ "packages/eslint-plugin/tests/rules/no-invalid-this.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 43
+ }
+ },
+ "packages/eslint-plugin/tests/rules/no-loop-func.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 2
+ }
+ },
+ "packages/eslint-plugin/tests/rules/no-this-alias.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 14
+ }
+ },
+ "packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 44
+ }
+ },
+ "packages/eslint-plugin/tests/rules/no-unnecessary-template-expression.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 1
+ }
+ },
+ "packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 2
+ }
+ },
+ "packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 154
+ }
+ },
+ "packages/eslint-plugin/tests/rules/no-useless-empty-export.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 9
+ }
+ },
+ "packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 42
+ }
+ },
+ "packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 17
+ }
+ },
+ "packages/eslint-plugin/tests/rules/return-await.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 1
+ }
+ },
+ "packages/eslint-plugin/tests/rules/sort-type-constituents.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 4
+ }
+ },
+ "packages/eslint-plugin/tests/rules/unbound-method.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 3
+ }
+ }
+}
diff --git a/eslint.config.mjs b/eslint.config.mjs
index 433085ceae89..1c27183e58f5 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -428,6 +428,7 @@ export default defineConfig(
],
name: 'eslint-plugin-and-eslint-plugin-internal/test-files/rules',
rules: {
+ '@typescript-eslint/internal/no-dynamic-tests': 'error',
'@typescript-eslint/internal/plugin-test-formatting': 'error',
},
},
@@ -479,7 +480,6 @@ export default defineConfig(
// TODO (43081j): maybe enable these one day?
'eslint-plugin/no-meta-replaced-by': 'off',
'eslint-plugin/require-meta-default-options': 'off',
- 'eslint-plugin/require-meta-schema-description': 'off',
},
},
{
diff --git a/package.json b/package.json
index 7ab91774e311..fc18c47878f6 100644
--- a/package.json
+++ b/package.json
@@ -27,6 +27,7 @@
"check-format": "prettier --check .",
"check-spelling": "cspell --config=.cspell.json \"**/*.{md,mdx,ts,mts,cts,js,cjs,mjs,tsx,jsx}\" --no-progress --show-context --show-suggestions",
"clean": "nx run-many -t clean --parallel=20",
+ "deduplicate": "yarn-berry-deduplicate",
"format": "prettier --ignore-path=$PROJECT_CWD/.prettierignore --config=$PROJECT_CWD/.prettierrc.json --write $INIT_CWD",
"generate-breaking-changes": "nx run eslint-plugin:generate-breaking-changes",
"generate-configs": "tsx tools/scripts/generate-configs.mts",
@@ -37,6 +38,7 @@
"lint-markdown-fix": "yarn lint-markdown --fix",
"lint-markdown": "markdownlint \"**/*.md\" --config=.markdownlint.json --ignore-path=.markdownlintignore",
"lint-stylelint": "nx lint website stylelint",
+ "lint-prune-suppressions": "nx run-many -t lint --projects=eslint-plugin-internal,eslint-plugin --prune-suppressions",
"lint": "nx run-many -t lint",
"postinstall": "tsx tools/scripts/postinstall.mts",
"pre-commit": "lint-staged",
@@ -102,7 +104,8 @@
"typescript-eslint": "workspace:^",
"vite": "^6.3.5",
"vitest": "^3.1.3",
- "yargs": "17.7.2"
+ "yargs": "17.7.2",
+ "yarn-berry-deduplicate": "^6.1.3"
},
"resolutions": {
"@types/eslint-scope": "link:./tools/dummypkg",
diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md
index bc0e07c46d14..c6cd653d3a17 100644
--- a/packages/ast-spec/CHANGELOG.md
+++ b/packages/ast-spec/CHANGELOG.md
@@ -1,3 +1,21 @@
+## 8.46.0 (2025-10-06)
+
+### 🚀 Features
+
+- **typescript-estree:** private identifiers can only appear on LHS of in expressions ([#9232](https://github.com/typescript-eslint/typescript-eslint/pull/9232))
+
+### 🩹 Fixes
+
+- **typescript-estree:** forbid abstract method and accessor to have implementation ([#11657](https://github.com/typescript-eslint/typescript-eslint/pull/11657))
+- **typescript-estree:** forbid `abstract` modifier in object methods ([#11656](https://github.com/typescript-eslint/typescript-eslint/pull/11656))
+
+### ❤️ Thank You
+
+- fisker Cheung @fisker
+- Joshua Chen
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
## 8.45.0 (2025-09-29)
### 🩹 Fixes
diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json
index c043b77b4dbb..bdd7c564bf29 100644
--- a/packages/ast-spec/package.json
+++ b/packages/ast-spec/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/ast-spec",
- "version": "8.45.0",
+ "version": "8.46.0",
"description": "Complete specification for the TypeScript-ESTree AST",
"private": true,
"keywords": [
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/fixture.ts
new file mode 100644
index 000000000000..bd45e0a8a625
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/fixture.ts
@@ -0,0 +1,3 @@
+abstract class Foo {
+ abstract constructor() { }
+}
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..8a67121b79c1
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-constructor > TSESTree - Error`]
+TSError
+ 1 | abstract class Foo {
+> 2 | abstract constructor() { }
+ | ^^^^^^^^ 'abstract' modifier can only appear on a class, method, or property declaration.
+ 3 | }
+ 4 |
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..b78e289f0c55
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-constructor > Babel - Error`]
+BabelError
+ 1 | abstract class Foo {
+> 2 | abstract constructor() { }
+ | ^ Method 'constructor' cannot have an implementation because it is marked abstract. (2:2)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..dbd705849820
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-constructor > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/fixture.ts
new file mode 100644
index 000000000000..0ac2bfca1dfd
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/fixture.ts
@@ -0,0 +1,3 @@
+abstract class Foo {
+ abstract get getter() { }
+}
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..d7c0c1bcc98a
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-getter-with-implementation > TSESTree - Error`]
+TSError
+ 1 | abstract class Foo {
+> 2 | abstract get getter() { }
+ | ^^^^^^ An abstract accessor cannot have an implementation.
+ 3 | }
+ 4 |
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..fe0fe6660cf0
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-getter-with-implementation > Babel - Error`]
+BabelError
+ 1 | abstract class Foo {
+> 2 | abstract get getter() { }
+ | ^ Method 'getter' cannot have an implementation because it is marked abstract. (2:2)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..748024e02a80
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-getter-with-implementation > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/fixture.ts
new file mode 100644
index 000000000000..80fe821c5d29
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/fixture.ts
@@ -0,0 +1,3 @@
+abstract class Foo {
+ abstract method() { }
+}
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..a65c609416d4
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-method-with-implementation > TSESTree - Error`]
+TSError
+ 1 | abstract class Foo {
+> 2 | abstract method() { }
+ | ^^^^^^ Method 'method' cannot have an implementation because it is marked abstract.
+ 3 | }
+ 4 |
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..c345ce0399ec
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-method-with-implementation > Babel - Error`]
+BabelError
+ 1 | abstract class Foo {
+> 2 | abstract method() { }
+ | ^ Method 'method' cannot have an implementation because it is marked abstract. (2:2)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..fff6cbc7c6ce
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-method-with-implementation > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/fixture.ts
new file mode 100644
index 000000000000..fa7888c34cc9
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/fixture.ts
@@ -0,0 +1,3 @@
+abstract class Foo {
+ abstract set setter(v) { }
+}
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..febb4fe5dcde
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-setter-with-implementation > TSESTree - Error`]
+TSError
+ 1 | abstract class Foo {
+> 2 | abstract set setter(v) { }
+ | ^^^^^^ An abstract accessor cannot have an implementation.
+ 3 | }
+ 4 |
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..c45ee034b7c3
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-setter-with-implementation > Babel - Error`]
+BabelError
+ 1 | abstract class Foo {
+> 2 | abstract set setter(v) { }
+ | ^ Method 'setter' cannot have an implementation because it is marked abstract. (2:2)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..1e222f7febc0
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-setter-with-implementation > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/fixture.ts b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/fixture.ts
new file mode 100644
index 000000000000..daafa9ccb62f
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/fixture.ts
@@ -0,0 +1,4 @@
+class A {
+ #a;
+ b = #a + 1;
+}
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..ec75deb33cff
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > BinaryExpression > _error_ > private-lhs-not-in > TSESTree - Error`]
+TSError
+ 1 | class A {
+ 2 | #a;
+> 3 | b = #a + 1;
+ | ^^ Private identifiers cannot appear on the right-hand-side of an 'in' expression.
+ 4 | }
+ 5 |
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..453c15f5a66d
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/2-Babel-Error.shot
@@ -0,0 +1,11 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > BinaryExpression > _error_ > private-lhs-not-in > Babel - Error`]
+BabelError
+ 1 | class A {
+ 2 | #a;
+> 3 | b = #a + 1;
+ | ^ Private names are only allowed in property accesses (`obj.#a`) or in `in` expressions (`#a in obj`). (3:6)
+ 4 | }
+ 5 |
+
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..c95813948827
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > BinaryExpression > _error_ > private-lhs-not-in > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/fixture.ts b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/fixture.ts
new file mode 100644
index 000000000000..ce0e507a49fd
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/fixture.ts
@@ -0,0 +1,4 @@
+class A {
+ #a;
+ b = 1 in #a;
+}
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..67636f0e09ec
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > BinaryExpression > _error_ > private-rhs > TSESTree - Error`]
+TSError
+ 1 | class A {
+ 2 | #a;
+> 3 | b = 1 in #a;
+ | ^^ Private identifiers are only allowed on the left-hand-side of an 'in' expression.
+ 4 | }
+ 5 |
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..2014af3eb868
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/2-Babel-Error.shot
@@ -0,0 +1,11 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > BinaryExpression > _error_ > private-rhs > Babel - Error`]
+BabelError
+ 1 | class A {
+ 2 | #a;
+> 3 | b = 1 in #a;
+ | ^ Private names are only allowed in property accesses (`obj.#a`) or in `in` expressions (`#a in obj`). (3:11)
+ 4 | }
+ 5 |
+
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..802be146cc95
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > BinaryExpression > _error_ > private-rhs > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/fixture.ts b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/fixture.ts
new file mode 100644
index 000000000000..f17ec7e20d07
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/fixture.ts
@@ -0,0 +1,4 @@
+class A {
+ #a;
+ b = #a in A;
+}
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/1-TSESTree-AST.shot
new file mode 100644
index 000000000000..83deb39f58c9
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/1-TSESTree-AST.shot
@@ -0,0 +1,138 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: false,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ PropertyDefinition {
+ type: "PropertyDefinition",
+ computed: false,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: PrivateIdentifier {
+ type: "PrivateIdentifier",
+ name: "a",
+
+ range: [12, 14],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 4, line: 2 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: null,
+
+ range: [12, 15],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 5, line: 2 },
+ },
+ },
+ PropertyDefinition {
+ type: "PropertyDefinition",
+ computed: false,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "b",
+ optional: false,
+
+ range: [18, 19],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 3, line: 3 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: BinaryExpression {
+ type: "BinaryExpression",
+ left: PrivateIdentifier {
+ type: "PrivateIdentifier",
+ name: "a",
+
+ range: [22, 24],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ operator: "in",
+ right: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "A",
+ optional: false,
+
+ range: [28, 29],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+
+ range: [22, 29],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+
+ range: [18, 30],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ ],
+
+ range: [8, 32],
+ loc: {
+ start: { column: 8, line: 1 },
+ end: { column: 1, line: 4 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "A",
+ optional: false,
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 32],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 4 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 33],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 5 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/2-TSESTree-Tokens.shot
new file mode 100644
index 000000000000..b599e3a8bb83
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/2-TSESTree-Tokens.shot
@@ -0,0 +1,122 @@
+[
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "A",
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [8, 9],
+ loc: {
+ start: { column: 8, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ PrivateIdentifier {
+ type: "PrivateIdentifier",
+ value: "a",
+
+ range: [12, 14],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 4, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [14, 15],
+ loc: {
+ start: { column: 4, line: 2 },
+ end: { column: 5, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "b",
+
+ range: [18, 19],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 3, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [20, 21],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 5, line: 3 },
+ },
+ },
+ PrivateIdentifier {
+ type: "PrivateIdentifier",
+ value: "a",
+
+ range: [22, 24],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "in",
+
+ range: [25, 27],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 11, line: 3 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "A",
+
+ range: [28, 29],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [29, 30],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [31, 32],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 1, line: 4 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/3-Babel-AST.shot
new file mode 100644
index 000000000000..83deb39f58c9
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/3-Babel-AST.shot
@@ -0,0 +1,138 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: false,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ PropertyDefinition {
+ type: "PropertyDefinition",
+ computed: false,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: PrivateIdentifier {
+ type: "PrivateIdentifier",
+ name: "a",
+
+ range: [12, 14],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 4, line: 2 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: null,
+
+ range: [12, 15],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 5, line: 2 },
+ },
+ },
+ PropertyDefinition {
+ type: "PropertyDefinition",
+ computed: false,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "b",
+ optional: false,
+
+ range: [18, 19],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 3, line: 3 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: BinaryExpression {
+ type: "BinaryExpression",
+ left: PrivateIdentifier {
+ type: "PrivateIdentifier",
+ name: "a",
+
+ range: [22, 24],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ operator: "in",
+ right: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "A",
+ optional: false,
+
+ range: [28, 29],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+
+ range: [22, 29],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+
+ range: [18, 30],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ ],
+
+ range: [8, 32],
+ loc: {
+ start: { column: 8, line: 1 },
+ end: { column: 1, line: 4 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "A",
+ optional: false,
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 32],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 4 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 33],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 5 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/4-Babel-Tokens.shot
new file mode 100644
index 000000000000..b599e3a8bb83
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/4-Babel-Tokens.shot
@@ -0,0 +1,122 @@
+[
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "A",
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [8, 9],
+ loc: {
+ start: { column: 8, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ PrivateIdentifier {
+ type: "PrivateIdentifier",
+ value: "a",
+
+ range: [12, 14],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 4, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [14, 15],
+ loc: {
+ start: { column: 4, line: 2 },
+ end: { column: 5, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "b",
+
+ range: [18, 19],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 3, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [20, 21],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 5, line: 3 },
+ },
+ },
+ PrivateIdentifier {
+ type: "PrivateIdentifier",
+ value: "a",
+
+ range: [22, 24],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "in",
+
+ range: [25, 27],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 11, line: 3 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "A",
+
+ range: [28, 29],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [29, 30],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [31, 32],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 1, line: 4 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/5-AST-Alignment-AST.shot
new file mode 100644
index 000000000000..be95b85d8e44
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/5-AST-Alignment-AST.shot
@@ -0,0 +1,146 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression BinaryExpression private-lhs-in AST Alignment - AST 1`] = `
+"Snapshot Diff:
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ClassDeclaration {
+ type: 'ClassDeclaration',
+- abstract: false,
+ body: ClassBody {
+ type: 'ClassBody',
+ body: Array [
+ PropertyDefinition {
+ type: 'PropertyDefinition',
+ computed: false,
+- declare: false,
+- decorators: Array [],
+- definite: false,
+ key: PrivateIdentifier {
+ type: 'PrivateIdentifier',
+ name: 'a',
+
+ range: [12, 14],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 4, line: 2 },
+ },
+ },
+- optional: false,
+- override: false,
+- readonly: false,
+ static: false,
+ value: null,
+
+ range: [12, 15],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 5, line: 2 },
+ },
+ },
+ PropertyDefinition {
+ type: 'PropertyDefinition',
+ computed: false,
+- declare: false,
+- decorators: Array [],
+- definite: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'b',
+- optional: false,
+
+ range: [18, 19],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 3, line: 3 },
+ },
+ },
+- optional: false,
+- override: false,
+- readonly: false,
+ static: false,
+ value: BinaryExpression {
+ type: 'BinaryExpression',
+ left: PrivateIdentifier {
+ type: 'PrivateIdentifier',
+ name: 'a',
+
+ range: [22, 24],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ operator: 'in',
+ right: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'A',
+- optional: false,
+
+ range: [28, 29],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+
+ range: [22, 29],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+
+ range: [18, 30],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ ],
+
+ range: [8, 32],
+ loc: {
+ start: { column: 8, line: 1 },
+ end: { column: 1, line: 4 },
+ },
+ },
+- declare: false,
+- decorators: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'A',
+- optional: false,
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+- implements: Array [],
+ superClass: null,
+
+ range: [0, 32],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 4 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 33],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 5 },
+ },
+ }"
+`;
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/6-AST-Alignment-Tokens.shot
new file mode 100644
index 000000000000..31764d700643
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/6-AST-Alignment-Tokens.shot
@@ -0,0 +1,136 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression BinaryExpression private-lhs-in AST Alignment - Token 1`] = `
+"Snapshot Diff:
+- TSESTree
++ Babel
+
+ Array [
+ Keyword {
+ type: 'Keyword',
+ value: 'class',
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'A',
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '{',
+
+ range: [8, 9],
+ loc: {
+ start: { column: 8, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+- Identifier {
+- type: 'Identifier',
+- value: '#a',
++ PrivateIdentifier {
++ type: 'PrivateIdentifier',
++ value: 'a',
+
+ range: [12, 14],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 4, line: 2 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ';',
+
+ range: [14, 15],
+ loc: {
+ start: { column: 4, line: 2 },
+ end: { column: 5, line: 2 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'b',
+
+ range: [18, 19],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 3, line: 3 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '=',
+
+ range: [20, 21],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 5, line: 3 },
+ },
+ },
+- Identifier {
+- type: 'Identifier',
+- value: '#a',
++ PrivateIdentifier {
++ type: 'PrivateIdentifier',
++ value: 'a',
+
+ range: [22, 24],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ Keyword {
+ type: 'Keyword',
+ value: 'in',
+
+ range: [25, 27],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 11, line: 3 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'A',
+
+ range: [28, 29],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ';',
+
+ range: [29, 30],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '}',
+
+ range: [31, 32],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 1, line: 4 },
+ },
+ },
+ ]"
+`;
diff --git a/packages/ast-spec/src/expression/BinaryExpression/spec.ts b/packages/ast-spec/src/expression/BinaryExpression/spec.ts
index 6c262d443064..874df2c6d586 100644
--- a/packages/ast-spec/src/expression/BinaryExpression/spec.ts
+++ b/packages/ast-spec/src/expression/BinaryExpression/spec.ts
@@ -7,9 +7,18 @@ import type { BinaryOperatorToText } from './BinaryOperatorToText';
export * from './BinaryOperatorToText';
-export interface BinaryExpression extends BaseNode {
+export interface PrivateInExpression extends BaseNode {
type: AST_NODE_TYPES.BinaryExpression;
- left: Expression | PrivateIdentifier;
+ left: PrivateIdentifier;
+ operator: 'in';
+ right: Expression;
+}
+
+export interface SymmetricBinaryExpression extends BaseNode {
+ type: AST_NODE_TYPES.BinaryExpression;
+ left: Expression;
operator: ValueOf;
right: Expression;
}
+
+export type BinaryExpression = PrivateInExpression | SymmetricBinaryExpression;
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/fixture.ts
new file mode 100644
index 000000000000..8d7ba0694b01
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/fixture.ts
@@ -0,0 +1 @@
+({abstract method(){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..dc431453e57a
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,7 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > abstract-method > TSESTree - Error`]
+TSError
+> 1 | ({abstract method(){}})
+ | ^^^^^^^^ 'abstract' modifier cannot be used here.
+ 2 |
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..b186e7ceed16
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > abstract-method > Babel - Error`]
+BabelError
+> 1 | ({abstract method(){}})
+ | ^ Unexpected token, expected "," (1:11)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..2285aeb1e136
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > abstract-method > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/fixture.ts b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/fixture.ts
new file mode 100644
index 000000000000..402329cc285f
--- /dev/null
+++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/fixture.ts
@@ -0,0 +1,4 @@
+class A {
+ #a;
+ c = (#a, 1);
+}
diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..ba6e5a7a7e5f
--- /dev/null
+++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > SequenceExpression > _error_ > private-id-lhs > TSESTree - Error`]
+TSError
+ 1 | class A {
+ 2 | #a;
+> 3 | c = (#a, 1);
+ | ^^ Private identifiers cannot appear on the right-hand-side of an 'in' expression.
+ 4 | }
+ 5 |
diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..9006b349152b
--- /dev/null
+++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/2-Babel-Error.shot
@@ -0,0 +1,11 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > SequenceExpression > _error_ > private-id-lhs > Babel - Error`]
+BabelError
+ 1 | class A {
+ 2 | #a;
+> 3 | c = (#a, 1);
+ | ^ Private names are only allowed in property accesses (`obj.#a`) or in `in` expressions (`#a in obj`). (3:7)
+ 4 | }
+ 5 |
+
diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..15de730f25f8
--- /dev/null
+++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > SequenceExpression > _error_ > private-id-lhs > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/fixture.ts b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/fixture.ts
new file mode 100644
index 000000000000..9f1df9d73fa4
--- /dev/null
+++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/fixture.ts
@@ -0,0 +1,4 @@
+class A {
+ #a;
+ c = (1, #a);
+}
diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..da508ef53ff0
--- /dev/null
+++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > SequenceExpression > _error_ > private-id-rhs > TSESTree - Error`]
+TSError
+ 1 | class A {
+ 2 | #a;
+> 3 | c = (1, #a);
+ | ^^ Private identifiers are only allowed on the left-hand-side of an 'in' expression.
+ 4 | }
+ 5 |
diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..4a6a0b8baf68
--- /dev/null
+++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/2-Babel-Error.shot
@@ -0,0 +1,11 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > SequenceExpression > _error_ > private-id-rhs > Babel - Error`]
+BabelError
+ 1 | class A {
+ 2 | #a;
+> 3 | c = (1, #a);
+ | ^ Private names are only allowed in property accesses (`obj.#a`) or in `in` expressions (`#a in obj`). (3:10)
+ 4 | }
+ 5 |
+
diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..aeb556b36b22
--- /dev/null
+++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > SequenceExpression > _error_ > private-id-rhs > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/fixture.ts
index add9711e2f79..0367dc4b8cad 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/fixture.ts
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/fixture.ts
@@ -1,3 +1 @@
-// TODO: This fixture might be too large, and if so should be split up.
-
-function f1<>() {}
+const arrowFunction = < /* empty */ >() => {};
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-TSESTree-Error.shot
index 4f12d12b51de..5c7d9964c1b8 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-TSESTree-Error.shot
@@ -2,8 +2,6 @@
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-arrow-function > TSESTree - Error`]
TSError
- 1 | // TODO: This fixture might be too large, and if so should be split up.
+> 1 | const arrowFunction = < /* empty */ >() => {};
+ | ^ Type expected.
2 |
-> 3 | function f1<>() {}
- | ^^ Type parameter list cannot be empty.
- 4 |
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot
index bc141a4b2018..536bb927ec57 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot
@@ -2,9 +2,7 @@
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-arrow-function > Babel - Error`]
BabelError
- 1 | // TODO: This fixture might be too large, and if so should be split up.
+> 1 | const arrowFunction = < /* empty */ >() => {};
+ | ^ Type parameter list cannot be empty. (1:22)
2 |
-> 3 | function f1<>() {}
- | ^ Type parameter list cannot be empty. (3:11)
- 4 |
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/fixture.ts
new file mode 100644
index 000000000000..1dbabedb798c
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/fixture.ts
@@ -0,0 +1 @@
+function f1<>() {}
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..12440d8874fa
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-arrow-function Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (3:11)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/1-TSESTree-Error.shot
similarity index 55%
rename from packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-TSESTree-Error.shot
rename to packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/1-TSESTree-Error.shot
index 5bf4050773dc..57bcc54e2635 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/1-TSESTree-Error.shot
@@ -1,9 +1,7 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
-exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters > TSESTree - Error`]
+exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-function-declaration > TSESTree - Error`]
TSError
- 1 | // TODO: This fixture might be too large, and if so should be split up.
- 2 |
-> 3 | function f1<>() {}
+> 1 | function f1<>() {}
| ^^ Type parameter list cannot be empty.
- 4 |
+ 2 |
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/2-Alignment-Error.shot
similarity index 52%
rename from packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Alignment-Error.shot
rename to packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/2-Alignment-Error.shot
index 14e18802b751..04350071ad74 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/2-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-arrow-function Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..e9932497ceaa
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-function-declaration > Babel - Error`]
+BabelError
+> 1 | function f1<>() {}
+ | ^ Type parameter list cannot be empty. (1:11)
+ 2 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/3-Alignment-Error.shot
similarity index 66%
rename from packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/3-Alignment-Error.shot
rename to packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/3-Alignment-Error.shot
index a525062b1e95..8c7aff64046a 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
-exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters > Error Alignment`]
+exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-function-declaration > Error Alignment`]
Both errored
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/fixture.ts
index 43d8a0629438..97b3b1bd5b97 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/fixture.ts
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/fixture.ts
@@ -1,3 +1 @@
-// TODO: This fixture might be too large, and if so should be split up.
-
const foo = function<>() {}
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-TSESTree-Error.shot
index fa912f209747..baeead551b4b 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-TSESTree-Error.shot
@@ -2,8 +2,6 @@
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-function-expression > TSESTree - Error`]
TSError
- 1 | // TODO: This fixture might be too large, and if so should be split up.
- 2 |
-> 3 | const foo = function<>() {}
+> 1 | const foo = function<>() {}
| ^^ Type parameter list cannot be empty.
- 4 |
+ 2 |
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot
index 0338cc8a0dd9..3dff8a44c1db 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot
@@ -2,9 +2,7 @@
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-function-expression > Babel - Error`]
BabelError
- 1 | // TODO: This fixture might be too large, and if so should be split up.
+> 1 | const foo = function<>() {}
+ | ^ Type parameter list cannot be empty. (1:20)
2 |
-> 3 | const foo = function<>() {}
- | ^ Type parameter list cannot be empty. (3:20)
- 4 |
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/fixture.ts
deleted file mode 100644
index add9711e2f79..000000000000
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/fixture.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-// TODO: This fixture might be too large, and if so should be split up.
-
-function f1<>() {}
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-Babel-Error.shot
deleted file mode 100644
index ae64111c78c0..000000000000
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-Babel-Error.shot
+++ /dev/null
@@ -1,3 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (3:11)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Babel-Error.shot
deleted file mode 100644
index 8a54317d1574..000000000000
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Babel-Error.shot
+++ /dev/null
@@ -1,10 +0,0 @@
-// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
-
-exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters > Babel - Error`]
-BabelError
- 1 | // TODO: This fixture might be too large, and if so should be split up.
- 2 |
-> 3 | function f1<>() {}
- | ^ Type parameter list cannot be empty. (3:11)
- 4 |
-
diff --git a/packages/eslint-plugin-internal/index.d.ts b/packages/eslint-plugin-internal/index.d.ts
index 8c2962c75da3..68fc87c70ca0 100644
--- a/packages/eslint-plugin-internal/index.d.ts
+++ b/packages/eslint-plugin-internal/index.d.ts
@@ -2,8 +2,8 @@ import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
import type rules from './rules';
-declare const cjsExport: {
+declare const defaultExport: {
meta: FlatConfig.PluginMeta;
rules: typeof rules;
};
-export = cjsExport;
+export default defaultExport;
diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json
index 9b105586f76a..a6e86293d069 100644
--- a/packages/eslint-plugin-internal/package.json
+++ b/packages/eslint-plugin-internal/package.json
@@ -3,6 +3,7 @@
"private": true,
"main": "dist/index.js",
"types": "index.d.ts",
+ "type": "module",
"repository": {
"type": "git",
"url": "https://github.com/typescript-eslint/typescript-eslint.git",
diff --git a/packages/eslint-plugin-internal/src/index.ts b/packages/eslint-plugin-internal/src/index.ts
index 68991268506a..a299b00ec525 100644
--- a/packages/eslint-plugin-internal/src/index.ts
+++ b/packages/eslint-plugin-internal/src/index.ts
@@ -1,17 +1,12 @@
import type { Linter } from '@typescript-eslint/utils/ts-eslint';
-import rules from './rules';
+import rules from './rules/index.js';
+import packageJson from './util/packagejson.js';
-// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder
-const { name, version } = require('../package.json') as {
- name: string;
- version: string;
-};
-
-export = {
+export default {
meta: {
- name,
- version,
+ name: packageJson.name,
+ version: packageJson.version,
},
rules,
} satisfies Linter.Plugin;
diff --git a/packages/eslint-plugin-internal/src/rules/debug-namespace.ts b/packages/eslint-plugin-internal/src/rules/debug-namespace.ts
index ca76f5e1870f..9852edbb961f 100755
--- a/packages/eslint-plugin-internal/src/rules/debug-namespace.ts
+++ b/packages/eslint-plugin-internal/src/rules/debug-namespace.ts
@@ -2,7 +2,7 @@ import type { TSESTree } from '@typescript-eslint/utils';
import { getStaticValue } from '@typescript-eslint/utils/ast-utils';
-import { createRule } from '../util';
+import { createRule } from '../util/index.js';
function filePathToNamespace(filePath: string) {
const relativePath = filePath
@@ -20,7 +20,7 @@ function filePathToNamespace(filePath: string) {
}
export default createRule({
- name: __filename,
+ name: 'debug-namespace',
meta: {
type: 'problem',
docs: {
diff --git a/packages/eslint-plugin-internal/src/rules/eqeq-nullish.ts b/packages/eslint-plugin-internal/src/rules/eqeq-nullish.ts
index f118b1c10cfc..0680b631102c 100644
--- a/packages/eslint-plugin-internal/src/rules/eqeq-nullish.ts
+++ b/packages/eslint-plugin-internal/src/rules/eqeq-nullish.ts
@@ -4,10 +4,10 @@ import {
NullThrowsReasons,
} from '@typescript-eslint/utils/eslint-utils';
-import { createRule } from '../util';
+import { createRule } from '../util/index.js';
export default createRule({
- name: __filename,
+ name: 'eqeq-nullish',
meta: {
type: 'suggestion',
docs: {
diff --git a/packages/eslint-plugin-internal/src/rules/index.ts b/packages/eslint-plugin-internal/src/rules/index.ts
index 806618f909e4..7381fa1f11af 100644
--- a/packages/eslint-plugin-internal/src/rules/index.ts
+++ b/packages/eslint-plugin-internal/src/rules/index.ts
@@ -1,17 +1,19 @@
import type { Linter } from '@typescript-eslint/utils/ts-eslint';
-import debugNamespace from './debug-namespace';
-import eqeqNullish from './eqeq-nullish';
-import noPoorlyTypedTsProps from './no-poorly-typed-ts-props';
-import noRelativePathsToInternalPackages from './no-relative-paths-to-internal-packages';
-import noTypescriptDefaultImport from './no-typescript-default-import';
-import noTypescriptEstreeImport from './no-typescript-estree-import';
-import pluginTestFormatting from './plugin-test-formatting';
-import preferASTTypesEnum from './prefer-ast-types-enum';
+import debugNamespace from './debug-namespace.js';
+import eqeqNullish from './eqeq-nullish.js';
+import noDynamicTests from './no-dynamic-tests.js';
+import noPoorlyTypedTsProps from './no-poorly-typed-ts-props.js';
+import noRelativePathsToInternalPackages from './no-relative-paths-to-internal-packages.js';
+import noTypescriptDefaultImport from './no-typescript-default-import.js';
+import noTypescriptEstreeImport from './no-typescript-estree-import.js';
+import pluginTestFormatting from './plugin-test-formatting.js';
+import preferASTTypesEnum from './prefer-ast-types-enum.js';
export default {
'debug-namespace': debugNamespace,
'eqeq-nullish': eqeqNullish,
+ 'no-dynamic-tests': noDynamicTests,
'no-poorly-typed-ts-props': noPoorlyTypedTsProps,
'no-relative-paths-to-internal-packages': noRelativePathsToInternalPackages,
'no-typescript-default-import': noTypescriptDefaultImport,
diff --git a/packages/eslint-plugin-internal/src/rules/no-dynamic-tests.ts b/packages/eslint-plugin-internal/src/rules/no-dynamic-tests.ts
new file mode 100644
index 000000000000..bee236413868
--- /dev/null
+++ b/packages/eslint-plugin-internal/src/rules/no-dynamic-tests.ts
@@ -0,0 +1,140 @@
+import type { InvalidTestCase } from '@typescript-eslint/rule-tester';
+import type { TSESTree } from '@typescript-eslint/utils';
+
+import { AST_NODE_TYPES } from '@typescript-eslint/utils';
+
+import { createRule } from '../util/index.js';
+
+export default createRule({
+ name: 'no-dynamic-tests',
+ meta: {
+ type: 'problem',
+ docs: {
+ description: 'Disallow dynamic syntax in RuleTester test arrays',
+ },
+ messages: {
+ noDynamicTests:
+ 'Dynamic syntax is not allowed in RuleTester test arrays. Use static values only.',
+ },
+ schema: [],
+ },
+ defaultOptions: [],
+ create(context) {
+ function isRuleTesterCall(node: TSESTree.Node): boolean {
+ return (
+ node.type === AST_NODE_TYPES.CallExpression &&
+ node.callee.type === AST_NODE_TYPES.MemberExpression &&
+ node.callee.object.type === AST_NODE_TYPES.Identifier &&
+ node.callee.object.name === 'ruleTester' &&
+ node.callee.property.type === AST_NODE_TYPES.Identifier &&
+ node.callee.property.name === 'run'
+ );
+ }
+
+ function reportDynamicElements(node: TSESTree.Node): void {
+ switch (node.type) {
+ case AST_NODE_TYPES.CallExpression:
+ case AST_NODE_TYPES.SpreadElement:
+ case AST_NODE_TYPES.Identifier:
+ case AST_NODE_TYPES.BinaryExpression:
+ case AST_NODE_TYPES.ConditionalExpression:
+ case AST_NODE_TYPES.MemberExpression:
+ context.report({
+ node,
+ messageId: 'noDynamicTests',
+ });
+ break;
+ case AST_NODE_TYPES.TemplateLiteral:
+ node.expressions.forEach(expr => {
+ reportDynamicElements(expr);
+ });
+ break;
+ case AST_NODE_TYPES.ArrayExpression:
+ node.elements.forEach(element => {
+ if (element) {
+ reportDynamicElements(element);
+ }
+ });
+ break;
+ case AST_NODE_TYPES.ObjectExpression:
+ node.properties.forEach(prop => {
+ if (prop.type === AST_NODE_TYPES.SpreadElement) {
+ context.report({
+ node: prop,
+ messageId: 'noDynamicTests',
+ });
+ } else {
+ // InvalidTestCase extends ValidTestCase
+ type TestCaseKey = keyof InvalidTestCase;
+ const keyToValidate: TestCaseKey[] = ['code', 'errors'];
+
+ if (
+ prop.key.type === AST_NODE_TYPES.Identifier &&
+ keyToValidate.includes(prop.key.name as TestCaseKey)
+ ) {
+ reportDynamicElements(prop.value);
+ } else if (
+ prop.key.type === AST_NODE_TYPES.Literal &&
+ keyToValidate.includes(prop.key.value as TestCaseKey)
+ ) {
+ reportDynamicElements(prop.value);
+ }
+ }
+ });
+ break;
+ case AST_NODE_TYPES.TaggedTemplateExpression:
+ if (
+ !(
+ node.tag.type === AST_NODE_TYPES.Identifier &&
+ node.tag.name === 'noFormat'
+ )
+ ) {
+ context.report({
+ node: node.tag,
+ messageId: 'noDynamicTests',
+ });
+ }
+ break;
+ case AST_NODE_TYPES.Literal:
+ default:
+ break;
+ }
+ }
+
+ return {
+ CallExpression(node) {
+ if (isRuleTesterCall(node)) {
+ // If valid code, arg length is always 3 but we need to avoid conflict while dev
+ if (node.arguments.length < 3) {
+ return;
+ }
+ const testObject = node.arguments[2];
+
+ if (testObject.type === AST_NODE_TYPES.ObjectExpression) {
+ for (const prop of testObject.properties) {
+ const isTestCases =
+ prop.type === AST_NODE_TYPES.Property &&
+ prop.key.type === AST_NODE_TYPES.Identifier &&
+ (prop.key.name === 'valid' || prop.key.name === 'invalid');
+
+ if (isTestCases) {
+ if (prop.value.type === AST_NODE_TYPES.ArrayExpression) {
+ prop.value.elements.forEach(element => {
+ if (element) {
+ reportDynamicElements(element);
+ }
+ });
+ } else {
+ context.report({
+ node: prop.value,
+ messageId: 'noDynamicTests',
+ });
+ }
+ }
+ }
+ }
+ }
+ },
+ };
+ },
+});
diff --git a/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts b/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts
index 2da006d07bd9..ac537777b070 100644
--- a/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts
+++ b/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts
@@ -2,7 +2,7 @@ import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
import { ESLintUtils } from '@typescript-eslint/utils';
-import { createRule } from '../util';
+import { createRule } from '../util/index.js';
/*
TypeScript declares some bad types for certain properties.
diff --git a/packages/eslint-plugin-internal/src/rules/no-relative-paths-to-internal-packages.ts b/packages/eslint-plugin-internal/src/rules/no-relative-paths-to-internal-packages.ts
index b366ee764fcb..b2eaa1d0d2f4 100644
--- a/packages/eslint-plugin-internal/src/rules/no-relative-paths-to-internal-packages.ts
+++ b/packages/eslint-plugin-internal/src/rules/no-relative-paths-to-internal-packages.ts
@@ -1,12 +1,17 @@
import path from 'node:path';
+import { fileURLToPath } from 'node:url';
-import { createRule } from '../util';
+import { createRule } from '../util/index.js';
+
+// Replace with import.meta.dirname when minimum node version supports it
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = path.dirname(__filename);
export const REPO_ROOT = path.resolve(__dirname, '../../../..');
export const PACKAGES_DIR = path.join(REPO_ROOT, 'packages');
export default createRule({
- name: __filename,
+ name: 'no-relative-paths-to-internal-packages',
meta: {
type: 'problem',
docs: {
diff --git a/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts b/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts
index bddfbe1f7955..c5937ac0c7d3 100644
--- a/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts
+++ b/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts
@@ -1,6 +1,6 @@
import type { TSESTree } from '@typescript-eslint/utils';
-import { createRule } from '../util';
+import { createRule } from '../util/index.js';
/*
We have `allowSyntheticDefaultImports` turned on in this project, so there are two problems that arise:
diff --git a/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts b/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts
index 27d0ce54852d..e598a6faf9d0 100644
--- a/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts
+++ b/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts
@@ -1,4 +1,4 @@
-import { createRule } from '../util';
+import { createRule } from '../util/index.js';
const TSESTREE_NAME = '@typescript-eslint/typescript-estree';
const TYPES_NAME = '@typescript-eslint/types';
diff --git a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
index 26fcc60d8d2b..9ca6bd0b6311 100644
--- a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
+++ b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
@@ -3,8 +3,14 @@ import type { TSESTree } from '@typescript-eslint/utils';
import prettier from '@prettier/sync';
import { getContextualType } from '@typescript-eslint/type-utils';
import { AST_NODE_TYPES, ESLintUtils } from '@typescript-eslint/utils';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
-import { createRule } from '../util';
+import { createRule } from '../util/index.js';
+
+// Replace with import.meta.dirname when minimum node version supports it
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = path.dirname(__filename);
/*
The strings that are used for eslint plugins will not be checked for formatting.
@@ -145,6 +151,8 @@ export default createRule({
properties: {
formatWithPrettier: {
type: 'boolean',
+ description:
+ 'Whether to enforce formatting of code snippets using Prettier.',
},
},
},
@@ -553,10 +561,6 @@ export default createRule({
AST_NODE_TYPES.ArrayExpression,
AST_NODE_TYPES.ObjectExpression,
].join(' > ')]: checkInvalidTest,
- // special case for our batchedSingleLineTests utility
- 'CallExpression[callee.name = "batchedSingleLineTests"] > ObjectExpression':
- checkInvalidTest,
-
/**
* generic, type-aware handling for any old object
* this is a fallback to handle random variables people declare or object
diff --git a/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts b/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts
index d6005443a50e..edf2bbf842f3 100755
--- a/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts
+++ b/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts
@@ -3,14 +3,14 @@ import type { TSESTree } from '@typescript-eslint/utils';
import { DefinitionType } from '@typescript-eslint/scope-manager';
import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils';
-import { createRule } from '../util';
+import { createRule } from '../util/index.js';
const isStringLiteral = (
node: TSESTree.Literal,
): node is TSESTree.StringLiteral => typeof node.value === 'string';
export default createRule({
- name: __filename,
+ name: 'prefer-ast-types-enum',
meta: {
type: 'problem',
docs: {
diff --git a/packages/eslint-plugin-internal/src/util/createRule.ts b/packages/eslint-plugin-internal/src/util/createRule.ts
index 628498d08dad..ed6bcbca5198 100644
--- a/packages/eslint-plugin-internal/src/util/createRule.ts
+++ b/packages/eslint-plugin-internal/src/util/createRule.ts
@@ -1,8 +1,8 @@
import { ESLintUtils } from '@typescript-eslint/utils';
-// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder
-// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
-const { version }: { version: string } = require('../../package.json');
+import packageJson from './packagejson.js';
+
+const { version } = packageJson;
export interface ESLintPluginInternalDocs {
requiresTypeChecking?: true;
diff --git a/packages/eslint-plugin-internal/src/util/index.ts b/packages/eslint-plugin-internal/src/util/index.ts
index cd13da0f5cd3..71f5bf4fab22 100644
--- a/packages/eslint-plugin-internal/src/util/index.ts
+++ b/packages/eslint-plugin-internal/src/util/index.ts
@@ -1 +1 @@
-export * from './createRule';
+export * from './createRule.js';
diff --git a/packages/eslint-plugin-internal/src/util/packagejson.ts b/packages/eslint-plugin-internal/src/util/packagejson.ts
new file mode 100644
index 000000000000..2b2aa40efceb
--- /dev/null
+++ b/packages/eslint-plugin-internal/src/util/packagejson.ts
@@ -0,0 +1,17 @@
+import fs from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+// Replace with import.meta.dirname when minimum node version supports it
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = path.dirname(__filename);
+
+const packageJsonPath = path.join(__dirname, '../../package.json');
+const packageJsonContents = fs.readFileSync(packageJsonPath, 'utf-8');
+const packageJsonValue = JSON.parse(packageJsonContents) as {
+ name: string;
+ version: string;
+};
+
+// eslint-disable-next-line import/no-default-export
+export default packageJsonValue;
diff --git a/packages/eslint-plugin-internal/tests/RuleTester.ts b/packages/eslint-plugin-internal/tests/RuleTester.ts
index 1c7e60f12d4b..15d182f0310d 100644
--- a/packages/eslint-plugin-internal/tests/RuleTester.ts
+++ b/packages/eslint-plugin-internal/tests/RuleTester.ts
@@ -1,4 +1,9 @@
import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+// Replace with import.meta.dirname when minimum node version supports it
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = path.dirname(__filename);
export function getFixturesRootDir(): string {
return path.join(__dirname, 'fixtures');
diff --git a/packages/eslint-plugin-internal/tests/rules/debug-namespace.test.ts b/packages/eslint-plugin-internal/tests/rules/debug-namespace.test.ts
index 53e7ea81da15..8482087448ac 100644
--- a/packages/eslint-plugin-internal/tests/rules/debug-namespace.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/debug-namespace.test.ts
@@ -1,6 +1,6 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import rule from '../../src/rules/debug-namespace';
+import rule from '../../src/rules/debug-namespace.js';
const ruleTester = new RuleTester();
diff --git a/packages/eslint-plugin-internal/tests/rules/eqeq-nullish.test.ts b/packages/eslint-plugin-internal/tests/rules/eqeq-nullish.test.ts
index 663270002e45..10aca8c45955 100644
--- a/packages/eslint-plugin-internal/tests/rules/eqeq-nullish.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/eqeq-nullish.test.ts
@@ -1,6 +1,6 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import rule from '../../src/rules/eqeq-nullish';
+import rule from '../../src/rules/eqeq-nullish.js';
const ruleTester = new RuleTester();
diff --git a/packages/eslint-plugin-internal/tests/rules/no-dynamic-tests.test.ts b/packages/eslint-plugin-internal/tests/rules/no-dynamic-tests.test.ts
new file mode 100644
index 000000000000..dcb2ddbd007c
--- /dev/null
+++ b/packages/eslint-plugin-internal/tests/rules/no-dynamic-tests.test.ts
@@ -0,0 +1,289 @@
+import { RuleTester } from '@typescript-eslint/rule-tester';
+
+import rule from '../../src/rules/no-dynamic-tests.js';
+
+const ruleTester = new RuleTester({
+ languageOptions: {
+ parserOptions: {
+ ecmaFeatures: {},
+ ecmaVersion: 6,
+ sourceType: 'module',
+ },
+ },
+});
+
+ruleTester.run('no-dynamic-tests', rule, {
+ invalid: [
+ // Function calls in test arrays
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [generateTestCases()],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 11,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [],
+ invalid: [...getInvalidCases()],
+});
+ `,
+ errors: [
+ {
+ column: 13,
+ line: 4,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ // Spread operator in test arrays
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [...validTestCases],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 11,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [...validTestCases.map(t => t.code)],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 11,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ // Simple identifiers in test arrays
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [testCase],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 11,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ // Template literals in test arrays
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [\`\${getTest()}\`],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 14,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ // Binary expressions in test arrays
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: ['test' + getSuffix()],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 11,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ // Conditional expressions in test arrays
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [shouldTest ? 'test1' : 'test2'],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 11,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ // Member expressions in test arrays
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [testConfig.cases],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 11,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ // Object spread
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [{ ...testConfig }],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 13,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ // Tag
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [foo\`const x = 1;\`],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 11,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ // Object Value
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [{ code: foo }],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 19,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [{ errors: [...getErrors()] }],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 22,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ // assign directly
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: foo,
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 10,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ ],
+ valid: [
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: ['const x = 1;'],
+ invalid: [],
+});
+ `,
+ },
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: ['const x = 1;', 'let y = 2;'],
+ invalid: [
+ {
+ code: 'var z = 3;',
+ errors: [{ messageId: 'error' }],
+ },
+ ],
+});
+ `,
+ },
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [{ code: 'const x = 1;' }, { code: 'let y = 2;' }],
+ invalid: [],
+});
+ `,
+ },
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [noFormat\`const x = 1;\`],
+ invalid: [],
+});
+ `,
+ },
+ {
+ code: `
+ruleTester.run('test', rule, {
+ code: "import type { ValueOf } from './utils';",
+ filename: path.resolve(
+ PACKAGES_DIR,
+ 'ast-spec/src/expression/AssignmentExpression/spec.ts',
+ ),
+});
+ `,
+ },
+ ],
+});
diff --git a/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts b/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts
index cee60c1a8675..cd43599c85b6 100644
--- a/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts
@@ -1,8 +1,8 @@
/* eslint-disable @typescript-eslint/internal/prefer-ast-types-enum */
import { RuleTester } from '@typescript-eslint/rule-tester';
-import rule from '../../src/rules/no-poorly-typed-ts-props';
-import { getFixturesRootDir } from '../RuleTester';
+import rule from '../../src/rules/no-poorly-typed-ts-props.js';
+import { getFixturesRootDir } from '../RuleTester.js';
const ruleTester = new RuleTester({
languageOptions: {
diff --git a/packages/eslint-plugin-internal/tests/rules/no-relative-paths-to-internal-packages.test.ts b/packages/eslint-plugin-internal/tests/rules/no-relative-paths-to-internal-packages.test.ts
index b67fc8b64224..36b966725f79 100644
--- a/packages/eslint-plugin-internal/tests/rules/no-relative-paths-to-internal-packages.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/no-relative-paths-to-internal-packages.test.ts
@@ -3,7 +3,7 @@ import path from 'node:path';
import rule, {
PACKAGES_DIR,
-} from '../../src/rules/no-relative-paths-to-internal-packages';
+} from '../../src/rules/no-relative-paths-to-internal-packages.js';
const ruleTester = new RuleTester({
languageOptions: {
diff --git a/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts b/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts
index 7284c154e458..83c1f7349a8e 100644
--- a/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts
@@ -1,6 +1,6 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import rule from '../../src/rules/no-typescript-default-import';
+import rule from '../../src/rules/no-typescript-default-import.js';
const ruleTester = new RuleTester();
diff --git a/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts b/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts
index a727f98d0d61..077169eb7dde 100644
--- a/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts
@@ -1,6 +1,6 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import rule from '../../src/rules/no-typescript-estree-import';
+import rule from '../../src/rules/no-typescript-estree-import.js';
const ruleTester = new RuleTester();
diff --git a/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts b/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts
index 29ee7dde5168..6ec2ce42a6a3 100644
--- a/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts
@@ -1,7 +1,7 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import rule from '../../src/rules/plugin-test-formatting';
-import { getFixturesRootDir } from '../RuleTester';
+import rule from '../../src/rules/plugin-test-formatting.js';
+import { getFixturesRootDir } from '../RuleTester.js';
const ruleTester = new RuleTester({
languageOptions: {
diff --git a/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts b/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts
index c9273578ef0e..0c3ca98fbaad 100644
--- a/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts
@@ -2,7 +2,7 @@ import { RuleTester } from '@typescript-eslint/rule-tester';
import { DefinitionType } from '@typescript-eslint/scope-manager';
import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils';
-import rule from '../../src/rules/prefer-ast-types-enum';
+import rule from '../../src/rules/prefer-ast-types-enum.js';
const ruleTester = new RuleTester();
diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md
index 1b53ed8e8843..7be59f6e0e40 100644
--- a/packages/eslint-plugin/CHANGELOG.md
+++ b/packages/eslint-plugin/CHANGELOG.md
@@ -1,3 +1,31 @@
+## 8.46.0 (2025-10-06)
+
+### 🚀 Features
+
+- **eslint-plugin:** [no-unsafe-member-access] add allowOptionalChaining option ([#11659](https://github.com/typescript-eslint/typescript-eslint/pull/11659))
+- **rule-schema-to-typescript-types:** clean up and make public ([#11633](https://github.com/typescript-eslint/typescript-eslint/pull/11633))
+
+### 🩹 Fixes
+
+- **eslint-plugin:** [prefer-readonly-parameter-types] ignore tagged primitives ([#11660](https://github.com/typescript-eslint/typescript-eslint/pull/11660))
+- **typescript-estree:** forbid abstract method and accessor to have implementation ([#11657](https://github.com/typescript-eslint/typescript-eslint/pull/11657))
+- **eslint-plugin:** removed error type previously deprecated ([#11674](https://github.com/typescript-eslint/typescript-eslint/pull/11674))
+- **eslint-plugin:** [no-deprecated] ignore deprecated `export import`s ([#11603](https://github.com/typescript-eslint/typescript-eslint/pull/11603))
+- **eslint-plugin:** [unbound-method] improve wording around `this: void` and binding ([#11634](https://github.com/typescript-eslint/typescript-eslint/pull/11634))
+- **rule-tester:** deprecate TestCaseError#type and LintMessage#nodeType ([#11628](https://github.com/typescript-eslint/typescript-eslint/pull/11628))
+- **eslint-plugin:** [no-floating-promises] remove excess parentheses in suggestions ([#11487](https://github.com/typescript-eslint/typescript-eslint/pull/11487))
+
+### ❤️ Thank You
+
+- fisker Cheung @fisker
+- Josh Goldberg ✨
+- Kirk Waiblinger @kirkwaiblinger
+- Mark de Dios @peanutenthusiast
+- Richard Torres @richardtorres314
+- Victor Genaev @mainframev
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
## 8.45.0 (2025-09-29)
### 🚀 Features
diff --git a/packages/eslint-plugin/docs/rules/no-explicit-any.mdx b/packages/eslint-plugin/docs/rules/no-explicit-any.mdx
index f0c8c20c6dec..6b9a06f7538e 100644
--- a/packages/eslint-plugin/docs/rules/no-explicit-any.mdx
+++ b/packages/eslint-plugin/docs/rules/no-explicit-any.mdx
@@ -145,6 +145,86 @@ interface Garply {
}
```
+## Alternatives to `any`
+
+If you do know the properties that exist on an object value, it's generally best to use an `interface` or `type` to describe those properties.
+If a straightforward object type isn't sufficient, then you can choose between several strategies instead of `any`.
+The following headings describe some of the more common strategies.
+
+### `unknown`
+
+If you don't know the data shape of a value, the `unknown` type is safer than `any`.
+Like `any`, `unknown` indicates the value might be any kind of data with any properties.
+Unlike `any`, `unknown` doesn't allow arbitrary property accesses: it requires the value be narrowed to a more specific type before being used.
+See [The `unknown` type in TypeScript](https://mariusschulz.com/blog/the-unknown-type-in-typescript) for more information on `unknown`.
+
+### Index Signatures
+
+Some objects are used with arbitrary keys, especially in code that predates [`Map`s](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Set`s](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set).
+TypeScript interfaces may be given an _"index signature"_ to indicate arbitrary keys are allowed on objects.
+
+For example, this type defines an object that must have an `apple` property with a `number` value, and may have any other string keys with `number | undefined` values:
+
+```ts
+interface AllowsAnyStrings {
+ apple: number;
+ [i: string]: number | undefined;
+}
+
+let fruits: AllowsAnyStrings;
+
+fruits = { apple: 0 }; // Ok
+fruits.banana = 1; // Ok
+fruits.cherry = undefined; // Ok
+```
+
+See [What does a TypeScript index signature actually mean?](https://stackoverflow.com/questions/58458308/what-does-a-typescript-index-signature-actually-mean) for more information on index signatures.
+
+### Union Types
+
+Some values can be one of multiple types.
+TypeScript allows representing these with _"union"_ types: types that include a list of possible shapes for data.
+
+Union types are often used to describe "nullable" values: those that can either be a data type or `null` and/or `undefined`.
+For example, the following `StringLike` type describes data that is either a `string` or `undefined`:
+
+```ts
+type StringLike = string | undefined;
+
+let fruit: StringLike;
+
+fruit = 'apple'; // Ok
+fruit = undefined; // Ok
+```
+
+See [TypeScript Handbook: Everyday Types > Union Types](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) for more information on union types.
+
+### Type Parameter Constraints
+
+"Generic" type parameters are often used to represent a value of an unknown type.
+It can be tempting to use `any` as a type parameter constraint, but this is not recommended.
+
+First, `extends any` on its own does nothing: `` is equivalent to ``.
+See [`@typescript-eslint/no-unnecessary-type-constraint`](./no-unnecessary-type-constraint.mdx) for more information.
+
+Within type parameters, `never` and `unknown` otherwise can generally be used instead.
+For example, the following code uses those two types in `AnyFunction` instead of `any`s to constrain `Callback` to any function type:
+
+```ts
+type AnyFunction = (...args: never[]) => unknown;
+
+function curry(greeter: Greeter, prefix: string) {
+ return (...args: Parameters) => `${prefix}: ${greeter(...args)}`;
+}
+
+const greet = (name: string) => `Hello, ${name}!`;
+const greetWithDate = curry(greet, 'Logged: ');
+
+greetWithDate('linter'); // => "Logged: Hello, linter!"
+```
+
+See [When to use `never` and `unknown` in TypeScript](https://blog.logrocket.com/when-to-use-never-unknown-typescript) for more information on those types.
+
## When Not To Use It
`any` is always a dangerous escape hatch.
diff --git a/packages/eslint-plugin/docs/rules/no-misused-spread.mdx b/packages/eslint-plugin/docs/rules/no-misused-spread.mdx
index 5b3320e1e314..2748d7cce73f 100644
--- a/packages/eslint-plugin/docs/rules/no-misused-spread.mdx
+++ b/packages/eslint-plugin/docs/rules/no-misused-spread.mdx
@@ -37,7 +37,7 @@ That includes the following cases:
declare const promise: Promise;
const spreadPromise = { ...promise };
-declare function getObject(): Record;
+declare function getObject(): Record;
const getObjectSpread = { ...getObject };
declare const map: Map;
@@ -64,7 +64,7 @@ const instanceSpread = { ...instance };
declare const promise: Promise;
const spreadPromise = { ...(await promise) };
-declare function getObject(): Record;
+declare function getObject(): Record;
const getObjectSpread = { ...getObject() };
declare const map: Map;
@@ -121,6 +121,19 @@ const spreadBrandedString = [...brandedString];
+#### Examples
+
+If you intentionally spread over strings, you can use `allow` to explicitly allowlist them:
+
+```ts option='{"allow":[{ "from": "lib", "name": "string" }]}'
+/* eslint @typescript-eslint/no-misused-spread: {"allow":[{ "from": "lib", "name": "string" }]} */
+declare const unbrandedString: string;
+
+const spreadUnbrandedString = [...unbrandedString];
+```
+
+See the shared [`TypeOrValueSpecifier` format](/packages/type-utils/type-or-value-specifier) for more information.
+
## When Not To Use It
If your application intentionally works with raw data in unusual ways, such as directly manipulating class prototype chains, you might not want this rule.
diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-member-access.mdx b/packages/eslint-plugin/docs/rules/no-unsafe-member-access.mdx
index 2f1eb0edbf0f..f96138fc93eb 100644
--- a/packages/eslint-plugin/docs/rules/no-unsafe-member-access.mdx
+++ b/packages/eslint-plugin/docs/rules/no-unsafe-member-access.mdx
@@ -65,6 +65,43 @@ arr[idx++];
+## Options
+
+### `allowOptionalChaining`
+
+{/* insert option description */}
+
+Examples of code for this rule with `{ allowOptionalChaining: true }`:
+
+
+
+
+```ts
+declare const outer: any;
+
+outer.inner;
+outer.middle.inner;
+```
+
+
+
+
+```ts option='{ "allowOptionalChaining": true }'
+declare const outer: any;
+
+outer?.inner;
+outer?.middle?.inner;
+```
+
+
+
+
+:::caution
+We only recommend using `allowOptionalChaining` to help transition an existing project towards fully enabling `no-unsafe-member-access`.
+Optional chaining makes it safer than normal property accesses in that you won't get a runtime error if the parent value is `null` or `undefined`.
+However, it still results in an `any`-typed value, which is unsafe.
+:::
+
## When Not To Use It
If your codebase has many existing `any`s or areas of unsafe code, it may be difficult to enable this rule.
diff --git a/packages/eslint-plugin/docs/rules/prefer-for-of.mdx b/packages/eslint-plugin/docs/rules/prefer-for-of.mdx
index 0399c781ddd7..668023249c9c 100644
--- a/packages/eslint-plugin/docs/rules/prefer-for-of.mdx
+++ b/packages/eslint-plugin/docs/rules/prefer-for-of.mdx
@@ -47,4 +47,24 @@ for (let i = 0; i < array.length; i++) {
-{/* Intentionally Omitted: When Not To Use It */}
+## DOM Elements
+
+By default, TypeScript's type checking only allows `for-of` loops over DOM iterables such as `HTMLCollectionOf` when the `dom.iterable` `lib` option is enabled.
+If you are using this rule in a project that works with DOM elements, be sure to enable `dom.iterable` in your TSConfig `lib`.
+See [aka.ms/tsconfig#lib](http://aka.ms/tsconfig#lib) for more information.
+
+```json
+{
+ "compilerOptions": {
+ "strict": true,
+ "lib": ["esnext", "dom", "dom.iterable"]
+ }
+}
+```
+
+## When Not To Use It
+
+Note that this rule does not use type information to determine whether iterated elements are arrays.
+It only checks if a `.length` property is used in a loop.
+If your project loops over objects that happen to have `.length`, this rule may report false positives.
+You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule.
diff --git a/packages/eslint-plugin/docs/rules/prefer-optional-chain.mdx b/packages/eslint-plugin/docs/rules/prefer-optional-chain.mdx
index 777c80068e69..e63c2d819939 100644
--- a/packages/eslint-plugin/docs/rules/prefer-optional-chain.mdx
+++ b/packages/eslint-plugin/docs/rules/prefer-optional-chain.mdx
@@ -35,12 +35,7 @@ foo && foo.a && foo.a.b && foo.a.b.method && foo.a.b.method();
!foo || !foo.bar || !foo.bar.baz || !foo.bar.baz();
// this rule also supports converting chained strict nullish checks:
-foo &&
- foo.a != null &&
- foo.a.b !== null &&
- foo.a.b.c != undefined &&
- foo.a.b.c.d !== undefined &&
- foo.a.b.c.d.e;
+foo.a !== null && foo.a !== undefined && foo.a.b;
```
@@ -56,6 +51,8 @@ foo?.a?.b?.c?.d?.e;
!foo?.bar;
!foo?.[bar];
!foo?.bar?.baz?.();
+
+foo?.a != null;
```
diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json
index 84bce94a40c2..d4e233309acd 100644
--- a/packages/eslint-plugin/package.json
+++ b/packages/eslint-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin",
- "version": "8.45.0",
+ "version": "8.46.0",
"description": "TypeScript plugin for ESLint",
"files": [
"dist",
@@ -59,10 +59,10 @@
},
"dependencies": {
"@eslint-community/regexpp": "^4.10.0",
- "@typescript-eslint/scope-manager": "8.45.0",
- "@typescript-eslint/type-utils": "8.45.0",
- "@typescript-eslint/utils": "8.45.0",
- "@typescript-eslint/visitor-keys": "8.45.0",
+ "@typescript-eslint/scope-manager": "8.46.0",
+ "@typescript-eslint/type-utils": "8.46.0",
+ "@typescript-eslint/utils": "8.46.0",
+ "@typescript-eslint/visitor-keys": "8.46.0",
"graphemer": "^1.4.0",
"ignore": "^7.0.0",
"natural-compare": "^1.4.0",
@@ -71,8 +71,8 @@
"devDependencies": {
"@types/mdast": "^4.0.3",
"@types/natural-compare": "*",
- "@typescript-eslint/rule-schema-to-typescript-types": "8.45.0",
- "@typescript-eslint/rule-tester": "8.45.0",
+ "@typescript-eslint/rule-schema-to-typescript-types": "8.46.0",
+ "@typescript-eslint/rule-tester": "8.46.0",
"@vitest/coverage-v8": "^3.1.3",
"ajv": "^6.12.6",
"cross-fetch": "*",
@@ -92,7 +92,7 @@
"vitest": "^3.1.3"
},
"peerDependencies": {
- "@typescript-eslint/parser": "^8.45.0",
+ "@typescript-eslint/parser": "^8.46.0",
"eslint": "^8.57.0 || ^9.0.0",
"typescript": ">=4.8.4 <6.0.0"
},
diff --git a/packages/eslint-plugin/src/rules/ban-ts-comment.ts b/packages/eslint-plugin/src/rules/ban-ts-comment.ts
index e5ce60193628..7cd707ed742b 100644
--- a/packages/eslint-plugin/src/rules/ban-ts-comment.ts
+++ b/packages/eslint-plugin/src/rules/ban-ts-comment.ts
@@ -89,10 +89,26 @@ export default createRule({
description:
'A minimum character length for descriptions when `allow-with-description` is enabled.',
},
- 'ts-check': { $ref: '#/items/0/$defs/directiveConfigSchema' },
- 'ts-expect-error': { $ref: '#/items/0/$defs/directiveConfigSchema' },
- 'ts-ignore': { $ref: '#/items/0/$defs/directiveConfigSchema' },
- 'ts-nocheck': { $ref: '#/items/0/$defs/directiveConfigSchema' },
+ 'ts-check': {
+ $ref: '#/items/0/$defs/directiveConfigSchema',
+ description:
+ 'Whether allow ts-check directives, and with which restrictions.',
+ },
+ 'ts-expect-error': {
+ $ref: '#/items/0/$defs/directiveConfigSchema',
+ description:
+ 'Whether and when expect-error directives, and with which restrictions.',
+ },
+ 'ts-ignore': {
+ $ref: '#/items/0/$defs/directiveConfigSchema',
+ description:
+ 'Whether allow ts-ignore directives, and with which restrictions.',
+ },
+ 'ts-nocheck': {
+ $ref: '#/items/0/$defs/directiveConfigSchema',
+ description:
+ 'Whether allow ts-nocheck directives, and with which restrictions.',
+ },
},
},
],
diff --git a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts
index a7c8b991ed53..7fc724bb1e25 100644
--- a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts
+++ b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts
@@ -100,13 +100,31 @@ export default createRule({
description:
'Changes to required accessibility modifiers for specific kinds of class members.',
properties: {
- accessors: { $ref: '#/items/0/$defs/accessibilityLevel' },
- constructors: { $ref: '#/items/0/$defs/accessibilityLevel' },
- methods: { $ref: '#/items/0/$defs/accessibilityLevel' },
+ accessors: {
+ $ref: '#/items/0/$defs/accessibilityLevel',
+ description:
+ 'Which member accessibility modifier requirements to apply for accessors.',
+ },
+ constructors: {
+ $ref: '#/items/0/$defs/accessibilityLevel',
+ description:
+ 'Which member accessibility modifier requirements to apply for constructors.',
+ },
+ methods: {
+ $ref: '#/items/0/$defs/accessibilityLevel',
+ description:
+ 'Which member accessibility modifier requirements to apply for methods.',
+ },
parameterProperties: {
$ref: '#/items/0/$defs/accessibilityLevel',
+ description:
+ 'Which member accessibility modifier requirements to apply for parameterProperties.',
+ },
+ properties: {
+ $ref: '#/items/0/$defs/accessibilityLevel',
+ description:
+ 'Which member accessibility modifier requirements to apply for properties.',
},
- properties: { $ref: '#/items/0/$defs/accessibilityLevel' },
},
},
},
diff --git a/packages/eslint-plugin/src/rules/member-ordering.ts b/packages/eslint-plugin/src/rules/member-ordering.ts
index f930292bf3f2..e0d1d387baed 100644
--- a/packages/eslint-plugin/src/rules/member-ordering.ts
+++ b/packages/eslint-plugin/src/rules/member-ordering.ts
@@ -790,18 +790,23 @@ export default createRule({
properties: {
classes: {
$ref: '#/items/0/$defs/baseConfig',
+ description: 'Which ordering to enforce for classes.',
},
classExpressions: {
$ref: '#/items/0/$defs/baseConfig',
+ description: 'Which ordering to enforce for classExpressions.',
},
default: {
$ref: '#/items/0/$defs/baseConfig',
+ description: 'Which ordering to enforce for default.',
},
interfaces: {
$ref: '#/items/0/$defs/typesConfig',
+ description: 'Which ordering to enforce for interfaces.',
},
typeLiterals: {
$ref: '#/items/0/$defs/typesConfig',
+ description: 'Which ordering to enforce for typeLiterals.',
},
},
},
diff --git a/packages/eslint-plugin/src/rules/method-signature-style.ts b/packages/eslint-plugin/src/rules/method-signature-style.ts
index 1d7826402d3f..c4e76b0593a4 100644
--- a/packages/eslint-plugin/src/rules/method-signature-style.ts
+++ b/packages/eslint-plugin/src/rules/method-signature-style.ts
@@ -31,6 +31,7 @@ export default createRule({
schema: [
{
type: 'string',
+ description: 'The method signature style to enforce using.',
enum: ['property', 'method'],
},
],
diff --git a/packages/eslint-plugin/src/rules/no-base-to-string.ts b/packages/eslint-plugin/src/rules/no-base-to-string.ts
index 3612dc3da1ce..0dbcfd2825ef 100644
--- a/packages/eslint-plugin/src/rules/no-base-to-string.ts
+++ b/packages/eslint-plugin/src/rules/no-base-to-string.ts
@@ -60,8 +60,7 @@ export default createRule({
},
ignoredTypeNames: {
type: 'array',
- description:
- 'Stringified regular expressions of type names to ignore.',
+ description: 'Stringified type names to ignore.',
items: {
type: 'string',
},
diff --git a/packages/eslint-plugin/src/rules/no-deprecated.ts b/packages/eslint-plugin/src/rules/no-deprecated.ts
index 71b333488b55..f186feec02ae 100644
--- a/packages/eslint-plugin/src/rules/no-deprecated.ts
+++ b/packages/eslint-plugin/src/rules/no-deprecated.ts
@@ -157,6 +157,10 @@ export default createRule({
case AST_NODE_TYPES.TSTypeParameter:
return true;
+ // treat `export import Bar = Foo;` (and `import Foo = require('...')`) as declarations
+ case AST_NODE_TYPES.TSImportEqualsDeclaration:
+ return parent.id === node;
+
default:
return false;
}
diff --git a/packages/eslint-plugin/src/rules/no-floating-promises.ts b/packages/eslint-plugin/src/rules/no-floating-promises.ts
index 32ecbe741681..b040d1c82122 100644
--- a/packages/eslint-plugin/src/rules/no-floating-promises.ts
+++ b/packages/eslint-plugin/src/rules/no-floating-promises.ts
@@ -1,16 +1,17 @@
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
+import type * as ts from 'typescript';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as tsutils from 'ts-api-utils';
-import * as ts from 'typescript';
import type { TypeOrValueSpecifier } from '../util';
import {
createRule,
- getOperatorPrecedence,
+ getOperatorPrecedenceForNode,
getParserServices,
isBuiltinSymbolLike,
+ isParenthesized,
OperatorPrecedence,
readonlynessOptionsDefaults,
readonlynessOptionsSchema,
@@ -168,10 +169,11 @@ export default createRule({
{
messageId: 'floatingFixVoid',
fix(fixer): TSESLint.RuleFix | TSESLint.RuleFix[] {
- const tsNode = services.esTreeNodeToTSNodeMap.get(
- node.expression,
- );
- if (isHigherPrecedenceThanUnary(tsNode)) {
+ if (
+ isParenthesized(expression, context.sourceCode) ||
+ getOperatorPrecedenceForNode(expression) >
+ OperatorPrecedence.Unary
+ ) {
return fixer.insertTextBefore(node, 'void ');
}
return [
@@ -223,8 +225,10 @@ export default createRule({
'await',
);
}
- const tsNode = services.esTreeNodeToTSNodeMap.get(node.expression);
- if (isHigherPrecedenceThanUnary(tsNode)) {
+ if (
+ isParenthesized(expression, context.sourceCode) ||
+ getOperatorPrecedenceForNode(expression) > OperatorPrecedence.Unary
+ ) {
return fixer.insertTextBefore(node, 'await ');
}
return [
@@ -261,14 +265,6 @@ export default createRule({
);
}
- function isHigherPrecedenceThanUnary(node: ts.Node): boolean {
- const operator = ts.isBinaryExpression(node)
- ? node.operatorToken.kind
- : ts.SyntaxKind.Unknown;
- const nodePrecedence = getOperatorPrecedence(node.kind, operator);
- return nodePrecedence > OperatorPrecedence.Unary;
- }
-
function isAsyncIife(node: TSESTree.ExpressionStatement): boolean {
if (node.expression.type !== AST_NODE_TYPES.CallExpression) {
return false;
diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
index 387bf5f2da33..b9a1ebb9a4bf 100644
--- a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
+++ b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
@@ -200,9 +200,12 @@ export default createRule({
oneOf: [
{
type: 'boolean',
+ description: 'Always ignore or not ignore the loop conditions',
},
{
type: 'string',
+ description:
+ 'Which situations to ignore constant conditions in.',
enum: ['always', 'never', 'only-allowed-literals'],
},
],
diff --git a/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts b/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts
index 6cf16d5211e4..510d53c5e3e3 100644
--- a/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts
+++ b/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts
@@ -15,6 +15,7 @@ import {
const enum State {
Unsafe = 1,
Safe = 2,
+ Chained = 3,
}
function createDataType(type: ts.Type): '`any`' | '`error` typed' {
@@ -22,7 +23,18 @@ function createDataType(type: ts.Type): '`any`' | '`error` typed' {
return isErrorType ? '`error` typed' : '`any`';
}
-export default createRule({
+export type Options = [
+ {
+ allowOptionalChaining?: boolean;
+ },
+];
+
+export type MessageIds =
+ | 'unsafeComputedMemberAccess'
+ | 'unsafeMemberExpression'
+ | 'unsafeThisMemberExpression';
+
+export default createRule({
name: 'no-unsafe-member-access',
meta: {
type: 'problem',
@@ -41,10 +53,26 @@ export default createRule({
'You can try to fix this by turning on the `noImplicitThis` compiler option, or adding a `this` parameter to the function.',
].join('\n'),
},
- schema: [],
+ schema: [
+ {
+ type: 'object',
+ additionalProperties: false,
+ properties: {
+ allowOptionalChaining: {
+ type: 'boolean',
+ description:
+ 'Whether to allow `?.` optional chains on `any` values.',
+ },
+ },
+ },
+ ],
},
- defaultOptions: [],
- create(context) {
+ defaultOptions: [
+ {
+ allowOptionalChaining: false,
+ },
+ ],
+ create(context, [{ allowOptionalChaining }]) {
const services = getParserServices(context);
const compilerOptions = services.program.getCompilerOptions();
const isNoImplicitThis = tsutils.isStrictCompilerOptionEnabled(
@@ -54,7 +82,20 @@ export default createRule({
const stateCache = new Map();
+ // Case notes:
+ // value?.outer.middle.inner
+ // The ChainExpression is a child of the root expression, and a parent of all the MemberExpressions.
+ // But the left-most expression is what we want to report on: the inner-most expressions.
+ // In fact, this is true even if the chain is on the inside!
+ // value.outer.middle?.inner;
+ // It was already true that every `object` (MemberExpression) has optional: boolean
+
function checkMemberExpression(node: TSESTree.MemberExpression): State {
+ if (allowOptionalChaining && node.optional) {
+ stateCache.set(node, State.Chained);
+ return State.Chained;
+ }
+
const cachedState = stateCache.get(node);
if (cachedState) {
return cachedState;
@@ -77,8 +118,7 @@ export default createRule({
if (state === State.Unsafe) {
const propertyName = context.sourceCode.getText(node.property);
- let messageId: 'unsafeMemberExpression' | 'unsafeThisMemberExpression' =
- 'unsafeMemberExpression';
+ let messageId: MessageIds = 'unsafeMemberExpression';
if (!isNoImplicitThis) {
// `this.foo` or `this.foo[bar]`
@@ -114,6 +154,13 @@ export default createRule({
'MemberExpression[computed = true] > *.property'(
node: TSESTree.Expression,
): void {
+ if (
+ allowOptionalChaining &&
+ (node.parent as TSESTree.MemberExpression).optional
+ ) {
+ return;
+ }
+
if (
// x[1]
node.type === AST_NODE_TYPES.Literal ||
diff --git a/packages/eslint-plugin/src/rules/no-unused-vars.ts b/packages/eslint-plugin/src/rules/no-unused-vars.ts
index f2bfa26bb1a8..ce8e0abc3340 100644
--- a/packages/eslint-plugin/src/rules/no-unused-vars.ts
+++ b/packages/eslint-plugin/src/rules/no-unused-vars.ts
@@ -35,6 +35,7 @@ export type Options = [
destructuredArrayIgnorePattern?: string;
ignoreClassWithStaticInitBlock?: boolean;
ignoreRestSiblings?: boolean;
+ ignoreUsingDeclarations?: boolean;
reportUsedIgnorePattern?: boolean;
vars?: 'all' | 'local';
varsIgnorePattern?: string;
@@ -49,6 +50,7 @@ interface TranslatedOptions {
destructuredArrayIgnorePattern?: RegExp;
ignoreClassWithStaticInitBlock: boolean;
ignoreRestSiblings: boolean;
+ ignoreUsingDeclarations: boolean;
reportUsedIgnorePattern: boolean;
vars: 'all' | 'local';
varsIgnorePattern?: RegExp;
@@ -86,6 +88,7 @@ export default createRule({
oneOf: [
{
type: 'string',
+ description: 'Broad setting for unused variables to target.',
enum: ['all', 'local'],
},
{
@@ -127,6 +130,11 @@ export default createRule({
description:
'Whether to ignore sibling properties in `...` destructurings.',
},
+ ignoreUsingDeclarations: {
+ type: 'boolean',
+ description:
+ 'Whether to ignore using or await using declarations.',
+ },
reportUsedIgnorePattern: {
type: 'boolean',
description:
@@ -162,6 +170,7 @@ export default createRule({
caughtErrors: 'all',
ignoreClassWithStaticInitBlock: false,
ignoreRestSiblings: false,
+ ignoreUsingDeclarations: false,
reportUsedIgnorePattern: false,
vars: 'all',
};
@@ -173,6 +182,9 @@ export default createRule({
options.args = firstOption.args ?? options.args;
options.ignoreRestSiblings =
firstOption.ignoreRestSiblings ?? options.ignoreRestSiblings;
+ options.ignoreUsingDeclarations =
+ firstOption.ignoreUsingDeclarations ??
+ options.ignoreUsingDeclarations;
options.caughtErrors = firstOption.caughtErrors ?? options.caughtErrors;
options.ignoreClassWithStaticInitBlock =
firstOption.ignoreClassWithStaticInitBlock ??
@@ -548,6 +560,14 @@ export default createRule({
continue;
}
+ if (
+ def.type === TSESLint.Scope.DefinitionType.Variable &&
+ options.ignoreUsingDeclarations &&
+ (def.parent.kind === 'await using' || def.parent.kind === 'using')
+ ) {
+ continue;
+ }
+
if (hasRestSpreadSibling(variable)) {
continue;
}
diff --git a/packages/eslint-plugin/src/rules/no-use-before-define.ts b/packages/eslint-plugin/src/rules/no-use-before-define.ts
index e0dcef814cc7..11e51f0d5ee5 100644
--- a/packages/eslint-plugin/src/rules/no-use-before-define.ts
+++ b/packages/eslint-plugin/src/rules/no-use-before-define.ts
@@ -231,6 +231,8 @@ export default createRule({
oneOf: [
{
type: 'string',
+ description:
+ 'Broadly set functions and allowNamedExports to false.',
enum: ['nofunc'],
},
{
diff --git a/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts b/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts
index 71e5efe2f74d..47c4dfaa023b 100644
--- a/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts
+++ b/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts
@@ -7,6 +7,7 @@ import type { TypeOrValueSpecifier } from '../util';
import {
createRule,
getParserServices,
+ isTypeBrandedLiteralLike,
isTypeReadonly,
readonlynessOptionsDefaults,
readonlynessOptionsSchema,
@@ -129,7 +130,7 @@ export default createRule({
treatMethodsAsReadonly: !!treatMethodsAsReadonly,
});
- if (!isReadOnly) {
+ if (!isReadOnly && !isTypeBrandedLiteralLike(type)) {
context.report({
node: actualParam,
messageId: 'shouldBeReadonly',
diff --git a/packages/eslint-plugin/src/rules/unbound-method.ts b/packages/eslint-plugin/src/rules/unbound-method.ts
index f92061f148d4..49f8dbe23802 100644
--- a/packages/eslint-plugin/src/rules/unbound-method.ts
+++ b/packages/eslint-plugin/src/rules/unbound-method.ts
@@ -100,8 +100,10 @@ const isNotImported = (
);
};
-const BASE_MESSAGE =
- 'Avoid referencing unbound methods which may cause unintentional scoping of `this`.';
+const BASE_MESSAGE = [
+ `A method that is not declared with \`this: void\` may cause unintentional scoping of \`this\` when separated from its object.`,
+ `Consider using an arrow function or explicitly \`.bind()\`ing the method to avoid calling the method with an unintended \`this\` value. `,
+].join('\n');
export default createRule({
name: 'unbound-method',
@@ -115,7 +117,7 @@ export default createRule({
},
messages: {
unbound: BASE_MESSAGE,
- unboundWithoutThisAnnotation: `${BASE_MESSAGE}\nIf your function does not access \`this\`, you can annotate it with \`this: void\`, or consider using an arrow function instead.`,
+ unboundWithoutThisAnnotation: `${BASE_MESSAGE}\nIf a function does not access \`this\`, it can be annotated with \`this: void\`.`,
},
schema: [
{
diff --git a/packages/eslint-plugin/src/util/getOperatorPrecedence.ts b/packages/eslint-plugin/src/util/getOperatorPrecedence.ts
index 950708015d89..54b40af26e28 100644
--- a/packages/eslint-plugin/src/util/getOperatorPrecedence.ts
+++ b/packages/eslint-plugin/src/util/getOperatorPrecedence.ts
@@ -198,6 +198,10 @@ export enum OperatorPrecedence {
Invalid = -1,
}
+/**
+ * Note that this does not take into account parenthesization. You should check
+ * for parenthesization separately if it's relevant to your usage.
+ */
export function getOperatorPrecedenceForNode(
node: TSESTree.Node,
): OperatorPrecedence {
diff --git a/packages/eslint-plugin/tests/RuleTester.ts b/packages/eslint-plugin/tests/RuleTester.ts
index 7e003e7fa5f1..4cb13dad0dcb 100644
--- a/packages/eslint-plugin/tests/RuleTester.ts
+++ b/packages/eslint-plugin/tests/RuleTester.ts
@@ -1,85 +1,5 @@
-import type {
- InvalidTestCase,
- ValidTestCase,
-} from '@typescript-eslint/rule-tester';
-
import * as path from 'node:path';
export function getFixturesRootDir(): string {
return path.join(__dirname, 'fixtures');
}
-
-/**
- * Converts a batch of single line tests into a number of separate test cases.
- * This makes it easier to write tests which use the same options.
- *
- * Why wouldn't you just leave them as one test?
- * Because it makes the test error messages harder to decipher.
- * This way each line will fail separately, instead of them all failing together.
- *
- * @deprecated - DO NOT USE THIS FOR NEW RULES
- */
-export function batchedSingleLineTests(
- test: ValidTestCase,
-): ValidTestCase[];
-/**
- * Converts a batch of single line tests into a number of separate test cases.
- * This makes it easier to write tests which use the same options.
- *
- * Why wouldn't you just leave them as one test?
- * Because it makes the test error messages harder to decipher.
- * This way each line will fail separately, instead of them all failing together.
- *
- * Make sure you have your line numbers correct for error reporting, as it will match
- * the line numbers up with the split tests!
- *
- * @deprecated - DO NOT USE THIS FOR NEW RULES
- */
-export function batchedSingleLineTests<
- MessageIds extends string,
- Options extends readonly unknown[],
->(
- test: InvalidTestCase,
-): InvalidTestCase[];
-export function batchedSingleLineTests<
- MessageIds extends string,
- Options extends readonly unknown[],
->(
- options:
- | ValidTestCase
- | ({
- output?: string | null;
- } & Omit, 'output'>),
-): (InvalidTestCase | ValidTestCase)[] {
- // -- eslint counts lines from 1
- const lineOffset = options.code.startsWith('\n') ? 2 : 1;
- const output =
- 'output' in options && options.output
- ? options.output.trim().split('\n')
- : null;
- return options.code
- .trim()
- .split('\n')
- .map((code, i) => {
- const lineNum = i + lineOffset;
- const errors =
- 'errors' in options
- ? options.errors.filter(e => e.line === lineNum)
- : [];
- const returnVal = {
- ...options,
- code,
- errors: errors.map(e => ({
- ...e,
- line: 1,
- })),
- };
- if (output?.[i]) {
- return {
- ...returnVal,
- output: output[i],
- };
- }
- return returnVal;
- });
-}
diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-spread.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-spread.shot
index 591c08061e87..78c83f38a361 100644
--- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-spread.shot
+++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-spread.shot
@@ -4,7 +4,7 @@ declare const promise: Promise;
const spreadPromise = { ...promise };
~~~~~~~~~~ Using the spread operator on Promise in an object can cause unexpected behavior. Did you forget to await the promise?
-declare function getObject(): Record;
+declare function getObject(): Record;
const getObjectSpread = { ...getObject };
~~~~~~~~~~~~ Using the spread operator on a function without additional properties can cause unexpected behavior. Did you forget to call the function?
@@ -37,7 +37,7 @@ Correct
declare const promise: Promise;
const spreadPromise = { ...(await promise) };
-declare function getObject(): Record;
+declare function getObject(): Record;
const getObjectSpread = { ...getObject() };
declare const map: Map;
diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-unsafe-member-access.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-unsafe-member-access.shot
index fee1bc00f418..91a7260593f1 100644
--- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-unsafe-member-access.shot
+++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-unsafe-member-access.shot
@@ -43,3 +43,20 @@ arr[1];
let idx = 1;
arr[idx];
arr[idx++];
+
+Incorrect
+
+declare const outer: any;
+
+outer.inner;
+ ~~~~~ Unsafe member access .inner on an `any` value.
+outer.middle.inner;
+ ~~~~~~ Unsafe member access .middle on an `any` value.
+
+Correct
+Options: { "allowOptionalChaining": true }
+
+declare const outer: any;
+
+outer?.inner;
+outer?.middle?.inner;
diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/prefer-optional-chain.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/prefer-optional-chain.shot
index 8607ddca5bca..657b431aa542 100644
--- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/prefer-optional-chain.shot
+++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/prefer-optional-chain.shot
@@ -26,14 +26,8 @@ foo && foo.a && foo.a.b && foo.a.b.method && foo.a.b.method();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Prefer using an optional chain expression instead, as it's more concise and easier to read.
// this rule also supports converting chained strict nullish checks:
-foo &&
-~~~~~~ Prefer using an optional chain expression instead, as it's more concise and easier to read.
- foo.a != null &&
-~~~~~~~~~~~~~~~
- foo.a.b !== null &&
- foo.a.b.c != undefined &&
- foo.a.b.c.d !== undefined &&
- foo.a.b.c.d.e;
+foo.a !== null && foo.a !== undefined && foo.a.b;
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Prefer using an optional chain expression instead, as it's more concise and easier to read.
Correct
@@ -47,6 +41,8 @@ foo?.a?.b?.c?.d?.e;
!foo?.[bar];
!foo?.bar?.baz?.();
+foo?.a != null;
+
Options: { "allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing": true }
declare const foo: { bar: boolean } | null | undefined;
diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/unbound-method.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/unbound-method.shot
index 13afc36a6e62..54db9a5b5cb7 100644
--- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/unbound-method.shot
+++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/unbound-method.shot
@@ -10,14 +10,16 @@ const instance = new MyClass();
// This logs the global scope (`window`/`global`), not the class instance
const myLog = instance.log;
- ~~~~~~~~~~~~ Avoid referencing unbound methods which may cause unintentional scoping of `this`.
- If your function does not access `this`, you can annotate it with `this: void`, or consider using an arrow function instead.
+ ~~~~~~~~~~~~ A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object.
+ Consider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value.
+ If a function does not access `this`, it can be annotated with `this: void`.
myLog();
// This log might later be called with an incorrect scope
const { log } = instance;
- ~~~ Avoid referencing unbound methods which may cause unintentional scoping of `this`.
- If your function does not access `this`, you can annotate it with `this: void`, or consider using an arrow function instead.
+ ~~~ A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object.
+ Consider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value.
+ If a function does not access `this`, it can be annotated with `this: void`.
// arith.double may refer to `this` internally
const arith = {
@@ -26,8 +28,9 @@ const arith = {
},
};
const { double } = arith;
- ~~~~~~ Avoid referencing unbound methods which may cause unintentional scoping of `this`.
- If your function does not access `this`, you can annotate it with `this: void`, or consider using an arrow function instead.
+ ~~~~~~ A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object.
+ Consider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value.
+ If a function does not access `this`, it can be annotated with `this: void`.
Correct
diff --git a/packages/eslint-plugin/tests/rules/class-methods-use-this/class-methods-use-this-core.test.ts b/packages/eslint-plugin/tests/rules/class-methods-use-this/class-methods-use-this-core.test.ts
index d0193efdc99d..e07263df6e98 100644
--- a/packages/eslint-plugin/tests/rules/class-methods-use-this/class-methods-use-this-core.test.ts
+++ b/packages/eslint-plugin/tests/rules/class-methods-use-this/class-methods-use-this-core.test.ts
@@ -1,7 +1,6 @@
/* eslint-disable @typescript-eslint/internal/plugin-test-formatting --
keeping eslint core formatting on purpose to make upstream diffing easier and so we don't need to edit line/cols */
import { RuleTester } from '@typescript-eslint/rule-tester';
-import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../../src/rules/class-methods-use-this';
@@ -17,7 +16,6 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: "method 'foo'" },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -30,7 +28,6 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: "method 'foo'" },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -43,7 +40,6 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: "method 'foo'" },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -56,7 +52,6 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: "method 'foo'" },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -69,7 +64,6 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: "method 'foo'" },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -82,7 +76,6 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: "method 'foo'" },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -95,7 +88,6 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: "method 'foo'" },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -108,7 +100,6 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: "method 'foo'" },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -122,7 +113,6 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: "method 'hasOwnProperty'" },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -136,7 +126,6 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: 'method' },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -150,14 +139,12 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: "method 'foo'" },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
{
column: 31,
data: { name: 'private method #bar' },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 2022 } },
@@ -170,55 +157,46 @@ ruleTester.run('class-methods-use-this', rule, {
column: 11,
data: { name: "method 'foo'" },
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
{
column: 19,
data: { name: "method 'bar'" },
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
{
column: 29,
data: { name: "method '123'" },
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
{
column: 37,
data: { name: "method 'baz'" },
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
{
column: 49,
data: { name: 'method' },
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
{
column: 57,
data: { name: 'method' },
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
{
column: 68,
data: { name: "getter 'quux'" },
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
{
column: 81,
data: { name: 'setter' },
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
{
column: 93,
data: { name: "generator method 'quuux'" },
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
diff --git a/packages/eslint-plugin/tests/rules/consistent-return.test.ts b/packages/eslint-plugin/tests/rules/consistent-return.test.ts
index e62345932396..89574197c9fd 100644
--- a/packages/eslint-plugin/tests/rules/consistent-return.test.ts
+++ b/packages/eslint-plugin/tests/rules/consistent-return.test.ts
@@ -1,5 +1,4 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/consistent-return';
import { getFixturesRootDir } from '../RuleTester';
@@ -226,7 +225,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 4,
line: 4,
messageId: 'missingReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
},
@@ -246,7 +244,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 5,
line: 5,
messageId: 'missingReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
},
@@ -270,7 +267,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 6,
line: 6,
messageId: 'unexpectedReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
{
column: 11,
@@ -279,7 +275,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 9,
line: 9,
messageId: 'missingReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
},
@@ -298,7 +293,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 4,
line: 4,
messageId: 'missingReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
},
@@ -317,7 +311,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 4,
line: 4,
messageId: 'unexpectedReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
},
@@ -336,7 +329,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 4,
line: 4,
messageId: 'missingReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
},
@@ -355,7 +347,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 4,
line: 4,
messageId: 'unexpectedReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
},
@@ -374,7 +365,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 4,
line: 4,
messageId: 'unexpectedReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
},
@@ -396,7 +386,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 7,
line: 7,
messageId: 'missingReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
},
@@ -417,7 +406,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 6,
line: 6,
messageId: 'unexpectedReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
options: [
@@ -444,7 +432,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 7,
line: 7,
messageId: 'unexpectedReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
options: [
diff --git a/packages/eslint-plugin/tests/rules/member-ordering.test.ts b/packages/eslint-plugin/tests/rules/member-ordering.test.ts
index d53fe04d6d22..f885b156163c 100644
--- a/packages/eslint-plugin/tests/rules/member-ordering.test.ts
+++ b/packages/eslint-plugin/tests/rules/member-ordering.test.ts
@@ -4465,7 +4465,7 @@ abstract class Foo {
B: string;
public C() {}
private D() {}
- abstract E() {}
+ E() {}
}
`,
errors: [
@@ -4478,6 +4478,15 @@ abstract class Foo {
line: 4,
messageId: 'incorrectGroupOrder',
},
+ {
+ column: 3,
+ data: {
+ name: 'E',
+ rank: 'private instance method',
+ },
+ line: 7,
+ messageId: 'incorrectGroupOrder',
+ },
],
},
{
diff --git a/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts b/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts
index c43b293c686e..076534645409 100644
--- a/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts
+++ b/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts
@@ -632,7 +632,7 @@ ruleTester.run('naming-convention', rule, {
{
code: `
class Ignored {
- private static abstract some_name() {}
+ private static some_name() {}
IgnoredDueToModifiers() {}
}
`,
@@ -644,7 +644,7 @@ ruleTester.run('naming-convention', rule, {
},
{
format: ['UPPER_CASE'],
- modifiers: ['abstract', 'static'],
+ modifiers: ['static'],
selector: 'classMethod',
},
],
@@ -1875,7 +1875,7 @@ ruleTester.run('naming-convention', rule, {
{
code: `
class Ignored {
- private static abstract some_name() {}
+ private static some_name() {}
IgnoredDueToModifiers() {}
}
`,
@@ -1886,7 +1886,7 @@ ruleTester.run('naming-convention', rule, {
},
{
format: ['snake_case'],
- modifiers: ['abstract', 'static'],
+ modifiers: ['static'],
selector: 'classMethod',
},
],
@@ -2118,10 +2118,10 @@ ruleTester.run('naming-convention', rule, {
}
}
abstract class foo {
- public abstract Bar() {
+ public Bar() {
return 42;
}
- public abstract async async_bar() {
+ public async async_bar() {
return 42;
}
}
diff --git a/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts b/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts
index ce97e7e6a8a2..8ddff69ff3ab 100644
--- a/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts
@@ -1,5 +1,4 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/no-array-constructor';
@@ -39,7 +38,6 @@ ruleTester.run('no-array-constructor', rule, {
errors: [
{
messageId: 'useLiteral',
- type: AST_NODE_TYPES.NewExpression,
},
],
output: '[];',
@@ -49,7 +47,6 @@ ruleTester.run('no-array-constructor', rule, {
errors: [
{
messageId: 'useLiteral',
- type: AST_NODE_TYPES.CallExpression,
},
],
output: '[];',
@@ -59,7 +56,6 @@ ruleTester.run('no-array-constructor', rule, {
errors: [
{
messageId: 'useLiteral',
- type: AST_NODE_TYPES.CallExpression,
},
],
output: '[];',
@@ -69,7 +65,6 @@ ruleTester.run('no-array-constructor', rule, {
errors: [
{
messageId: 'useLiteral',
- type: AST_NODE_TYPES.CallExpression,
},
],
output: '/* a */ /* b */ []; /* g */ /* h */',
@@ -79,7 +74,6 @@ ruleTester.run('no-array-constructor', rule, {
errors: [
{
messageId: 'useLiteral',
- type: AST_NODE_TYPES.NewExpression,
},
],
output: '[x, y];',
@@ -89,7 +83,6 @@ ruleTester.run('no-array-constructor', rule, {
errors: [
{
messageId: 'useLiteral',
- type: AST_NODE_TYPES.CallExpression,
},
],
output: '[x, y];',
@@ -99,7 +92,6 @@ ruleTester.run('no-array-constructor', rule, {
errors: [
{
messageId: 'useLiteral',
- type: AST_NODE_TYPES.CallExpression,
},
],
output: '[x, y];',
@@ -109,7 +101,6 @@ ruleTester.run('no-array-constructor', rule, {
errors: [
{
messageId: 'useLiteral',
- type: AST_NODE_TYPES.CallExpression,
},
],
output: '/* a */ /* b */ [x, y]; /* g */ /* h */',
@@ -119,7 +110,6 @@ ruleTester.run('no-array-constructor', rule, {
errors: [
{
messageId: 'useLiteral',
- type: AST_NODE_TYPES.NewExpression,
},
],
output: '[0, 1, 2];',
@@ -129,7 +119,6 @@ ruleTester.run('no-array-constructor', rule, {
errors: [
{
messageId: 'useLiteral',
- type: AST_NODE_TYPES.CallExpression,
},
],
output: '[0, 1, 2];',
@@ -139,7 +128,6 @@ ruleTester.run('no-array-constructor', rule, {
errors: [
{
messageId: 'useLiteral',
- type: AST_NODE_TYPES.CallExpression,
},
],
output: '[0, 1, 2];',
@@ -155,7 +143,6 @@ ruleTester.run('no-array-constructor', rule, {
errors: [
{
messageId: 'useLiteral',
- type: AST_NODE_TYPES.CallExpression,
},
],
output: `
@@ -173,7 +160,6 @@ new Array(0, 1, 2);
errors: [
{
messageId: 'useLiteral',
- type: AST_NODE_TYPES.NewExpression,
},
],
output: `
diff --git a/packages/eslint-plugin/tests/rules/no-deprecated.test.ts b/packages/eslint-plugin/tests/rules/no-deprecated.test.ts
index e5a0937f4264..6a643ab704c8 100644
--- a/packages/eslint-plugin/tests/rules/no-deprecated.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-deprecated.test.ts
@@ -245,6 +245,21 @@ ruleTester.run('no-deprecated', rule, {
declare const x: Props;
const { anchor = '' } = x;
`,
+ `
+ namespace Foo {}
+
+ /**
+ * @deprecated
+ */
+ export import Bar = Foo;
+ `,
+ `
+ /**
+ * @deprecated
+ */
+ export import Bar = require('./deprecated');
+ `,
+
`
interface Props {
anchor: 'foo';
diff --git a/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts b/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts
index 19d501a347b8..b04a60d2ad06 100644
--- a/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts
@@ -1,5 +1,4 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/no-extraneous-class';
@@ -176,12 +175,7 @@ export default class {
static hello() {}
}
`,
- errors: [
- {
- ...onlyStatic,
- type: AST_NODE_TYPES.ClassDeclaration,
- },
- ],
+ errors: [onlyStatic],
},
{
code: `
diff --git a/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts b/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts
index e2a272f6f3dc..87ead2f2b19d 100644
--- a/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts
@@ -2044,7 +2044,7 @@ async function test() {
messageId: 'floatingFixVoid',
output: `
async function test() {
- void ((Promise.resolve(), 123));
+ void (Promise.resolve(), 123);
(123, Promise.resolve());
(123, Promise.resolve(), 123);
}
@@ -2054,7 +2054,7 @@ async function test() {
messageId: 'floatingFixAwait',
output: `
async function test() {
- await ((Promise.resolve(), 123));
+ await (Promise.resolve(), 123);
(123, Promise.resolve());
(123, Promise.resolve(), 123);
}
@@ -2071,7 +2071,7 @@ async function test() {
output: `
async function test() {
(Promise.resolve(), 123);
- void ((123, Promise.resolve()));
+ void (123, Promise.resolve());
(123, Promise.resolve(), 123);
}
`,
@@ -2081,7 +2081,7 @@ async function test() {
output: `
async function test() {
(Promise.resolve(), 123);
- await ((123, Promise.resolve()));
+ await (123, Promise.resolve());
(123, Promise.resolve(), 123);
}
`,
@@ -2098,7 +2098,7 @@ async function test() {
async function test() {
(Promise.resolve(), 123);
(123, Promise.resolve());
- void ((123, Promise.resolve(), 123));
+ void (123, Promise.resolve(), 123);
}
`,
},
@@ -2108,7 +2108,7 @@ async function test() {
async function test() {
(Promise.resolve(), 123);
(123, Promise.resolve());
- await ((123, Promise.resolve(), 123));
+ await (123, Promise.resolve(), 123);
}
`,
},
@@ -2237,7 +2237,7 @@ async function returnsPromise() {
async function returnsPromise() {
return 'value';
}
-await ((1, returnsPromise()));
+await (1, returnsPromise());
`,
},
],
@@ -4556,13 +4556,13 @@ await promiseIntersection.finally(() => {});
{
messageId: 'floatingFixVoid',
output: `
-void ((Promise.resolve().finally(() => {}), 123));
+void (Promise.resolve().finally(() => {}), 123);
`,
},
{
messageId: 'floatingFixAwait',
output: `
-await ((Promise.resolve().finally(() => {}), 123));
+await (Promise.resolve().finally(() => {}), 123);
`,
},
],
diff --git a/packages/eslint-plugin/tests/rules/no-loop-func.test.ts b/packages/eslint-plugin/tests/rules/no-loop-func.test.ts
index 8b22f6a4ce8a..6075aec1b4ad 100644
--- a/packages/eslint-plugin/tests/rules/no-loop-func.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-loop-func.test.ts
@@ -1,5 +1,4 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/no-loop-func';
@@ -479,7 +478,6 @@ for (var i = 0; i < l; i++) {
{
data: { varNames: "'i'" },
messageId: 'unsafeRefs',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
},
@@ -497,7 +495,6 @@ for (var i = 0; i < l; i++) {
{
data: { varNames: "'i', 'j'" },
messageId: 'unsafeRefs',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
},
@@ -513,7 +510,6 @@ for (var i in {}) {
{
data: { varNames: "'i'" },
messageId: 'unsafeRefs',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
},
@@ -529,7 +525,6 @@ for (var i of {}) {
{
data: { varNames: "'i'" },
messageId: 'unsafeRefs',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -546,7 +541,6 @@ for (var i = 0; i < l; i++) {
{
data: { varNames: "'i'" },
messageId: 'unsafeRefs',
- type: AST_NODE_TYPES.ArrowFunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -563,7 +557,6 @@ for (var i = 0; i < l; i++) {
{
data: { varNames: "'i'" },
messageId: 'unsafeRefs',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
},
@@ -580,7 +573,6 @@ for (var i = 0; i < l; i++) {
{
data: { varNames: "'i'" },
messageId: 'unsafeRefs',
- type: AST_NODE_TYPES.FunctionDeclaration,
},
],
},
@@ -600,7 +592,6 @@ for (let i = 0; i < l; i++) {
{
data: { varNames: "'a'" },
messageId: 'unsafeRefs',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -619,7 +610,6 @@ for (let i in {}) {
{
data: { varNames: "'a'" },
messageId: 'unsafeRefs',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -638,7 +628,6 @@ a = 1;
{
data: { varNames: "'a'" },
messageId: 'unsafeRefs',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -659,7 +648,6 @@ for (let i = 0; i < l; i++) {
{
data: { varNames: "'a'" },
messageId: 'unsafeRefs',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -680,7 +668,6 @@ for (let i in {}) {
{
data: { varNames: "'a'" },
messageId: 'unsafeRefs',
- type: AST_NODE_TYPES.FunctionDeclaration,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -701,7 +688,6 @@ a = 1;
{
data: { varNames: "'a'" },
messageId: 'unsafeRefs',
- type: AST_NODE_TYPES.ArrowFunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -717,7 +703,6 @@ for (var i = 0; i < 10; ++i) {
{
data: { varNames: "'i'" },
messageId: 'unsafeRefs',
- type: AST_NODE_TYPES.ArrowFunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -738,7 +723,6 @@ for (let x of xs) {
{
data: { varNames: "'a'" },
messageId: 'unsafeRefs',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -757,7 +741,6 @@ for (var x of xs) {
{
data: { varNames: "'x'" },
messageId: 'unsafeRefs',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -774,7 +757,6 @@ for (var x of xs) {
{
data: { varNames: "'x'" },
messageId: 'unsafeRefs',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -793,7 +775,6 @@ for (let x of xs) {
{
data: { varNames: "'a'" },
messageId: 'unsafeRefs',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -812,7 +793,6 @@ for (let x of xs) {
{
data: { varNames: "'a'" },
messageId: 'unsafeRefs',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -834,7 +814,6 @@ foo();
{
data: { varNames: "'a'" },
messageId: 'unsafeRefs',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -856,7 +835,6 @@ foo();
{
data: { varNames: "'a'" },
messageId: 'unsafeRefs',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
diff --git a/packages/eslint-plugin/tests/rules/no-redeclare.test.ts b/packages/eslint-plugin/tests/rules/no-redeclare.test.ts
index 3d2f55e1d4e1..2b99a6168246 100644
--- a/packages/eslint-plugin/tests/rules/no-redeclare.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-redeclare.test.ts
@@ -1,5 +1,4 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/no-redeclare';
@@ -155,7 +154,6 @@ var a = 10;
id: 'a',
},
messageId: 'redeclared',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -175,7 +173,6 @@ switch (foo) {
id: 'b',
},
messageId: 'redeclared',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -190,7 +187,6 @@ var a = 10;
id: 'a',
},
messageId: 'redeclared',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -205,7 +201,6 @@ var a = [];
id: 'a',
},
messageId: 'redeclared',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -220,7 +215,6 @@ function a() {}
id: 'a',
},
messageId: 'redeclared',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -235,7 +229,6 @@ function a() {}
id: 'a',
},
messageId: 'redeclared',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -250,7 +243,6 @@ var a = function () {};
id: 'a',
},
messageId: 'redeclared',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -265,7 +257,6 @@ var a = new Date();
id: 'a',
},
messageId: 'redeclared',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -281,14 +272,12 @@ var a = 15;
id: 'a',
},
messageId: 'redeclared',
- type: AST_NODE_TYPES.Identifier,
},
{
data: {
id: 'a',
},
messageId: 'redeclared',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -303,7 +292,6 @@ var a;
id: 'a',
},
messageId: 'redeclared',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { sourceType: 'module' } },
@@ -319,7 +307,6 @@ var a;
id: 'a',
},
messageId: 'redeclared',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { sourceType: 'module' } },
@@ -332,7 +319,6 @@ var a;
id: 'Object',
},
messageId: 'redeclaredAsBuiltin',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ builtinGlobals: true }],
@@ -345,7 +331,6 @@ var a;
id: 'top',
},
messageId: 'redeclaredAsBuiltin',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: {
@@ -364,14 +349,12 @@ var { a = 0, b: Object = 0 } = {};
id: 'a',
},
messageId: 'redeclared',
- type: AST_NODE_TYPES.Identifier,
},
{
data: {
id: 'Object',
},
messageId: 'redeclaredAsBuiltin',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -388,7 +371,6 @@ var { a = 0, b: Object = 0 } = {};
id: 'a',
},
messageId: 'redeclared',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: {
@@ -407,7 +389,6 @@ var { a = 0, b: Object = 0 } = {};
id: 'a',
},
messageId: 'redeclared',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: {
@@ -426,7 +407,6 @@ var { a = 0, b: Object = 0 } = {};
id: 'a',
},
messageId: 'redeclared',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -442,7 +422,6 @@ var { a = 0, b: Object = 0 } = {};
id: 'b',
},
messageId: 'redeclaredBySyntax',
- type: AST_TOKEN_TYPES.Identifier,
},
],
options: [{ builtinGlobals: true }],
diff --git a/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts b/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts
index b43a52ef8d71..c7f04a16db35 100644
--- a/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts
@@ -1,5 +1,4 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/no-restricted-imports';
@@ -393,7 +392,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'path',
- type: AST_NODE_TYPES.ImportDeclaration,
},
],
options: ['import1', 'import2'],
@@ -412,7 +410,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'path',
- type: AST_NODE_TYPES.ExportNamedDeclaration,
},
],
options: ['import1', 'import2'],
@@ -422,7 +419,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'path',
- type: AST_NODE_TYPES.ImportDeclaration,
},
],
options: [{ paths: ['import1', 'import2'] }],
@@ -432,7 +428,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'path',
- type: AST_NODE_TYPES.ExportNamedDeclaration,
},
],
options: [{ paths: ['import1', 'import2'] }],
@@ -442,7 +437,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'patterns',
- type: AST_NODE_TYPES.ImportDeclaration,
},
],
options: [
@@ -457,7 +451,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'patterns',
- type: AST_NODE_TYPES.ExportNamedDeclaration,
},
],
options: [
@@ -472,7 +465,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'pathWithCustomMessage',
- type: AST_NODE_TYPES.ImportDeclaration,
},
],
options: [
@@ -495,7 +487,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'pathWithCustomMessage',
- type: AST_NODE_TYPES.ExportNamedDeclaration,
},
],
options: [
@@ -518,7 +509,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'importNameWithCustomMessage',
- type: AST_NODE_TYPES.ImportDeclaration,
},
],
options: [
@@ -538,7 +528,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'importNameWithCustomMessage',
- type: AST_NODE_TYPES.ExportNamedDeclaration,
},
],
options: [
@@ -558,7 +547,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'patternWithCustomMessage',
- type: AST_NODE_TYPES.ImportDeclaration,
},
],
options: [
@@ -582,7 +570,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'patternWithCustomMessage',
- type: AST_NODE_TYPES.ExportNamedDeclaration,
},
],
options: [
@@ -606,7 +593,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'path',
- type: AST_NODE_TYPES.ImportDeclaration,
},
],
options: [
@@ -624,7 +610,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'path',
- type: AST_NODE_TYPES.ImportDeclaration,
},
],
options: [
@@ -643,7 +628,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'pathWithCustomMessage',
- type: AST_NODE_TYPES.ImportDeclaration,
},
],
options: [
@@ -682,7 +666,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'importNameWithCustomMessage',
- type: AST_NODE_TYPES.ImportDeclaration,
},
],
options: [
@@ -703,7 +686,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'importNameWithCustomMessage',
- type: AST_NODE_TYPES.ExportNamedDeclaration,
},
],
options: [
@@ -724,7 +706,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'patternWithCustomMessage',
- type: AST_NODE_TYPES.ImportDeclaration,
},
],
options: [
@@ -744,7 +725,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'patternWithCustomMessage',
- type: AST_NODE_TYPES.ExportNamedDeclaration,
},
],
options: [
@@ -764,7 +744,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'patternWithCustomMessage',
- type: AST_NODE_TYPES.ExportNamedDeclaration,
},
],
options: [
@@ -784,7 +763,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'patternWithCustomMessage',
- type: AST_NODE_TYPES.ImportDeclaration,
},
],
options: [
@@ -805,7 +783,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'path',
- type: AST_NODE_TYPES.ExportAllDeclaration,
},
],
options: ['import1'],
@@ -815,7 +792,6 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'patterns',
- type: AST_NODE_TYPES.ImportDeclaration,
},
],
options: [
@@ -829,11 +805,9 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'importNameWithCustomMessage',
- type: AST_NODE_TYPES.ImportDeclaration,
},
{
messageId: 'importNameWithCustomMessage',
- type: AST_NODE_TYPES.ImportDeclaration,
},
],
options: [
@@ -854,11 +828,9 @@ import type { foo } from 'import2/private/bar';
errors: [
{
messageId: 'importNameWithCustomMessage',
- type: AST_NODE_TYPES.ExportNamedDeclaration,
},
{
messageId: 'importNameWithCustomMessage',
- type: AST_NODE_TYPES.ExportNamedDeclaration,
},
],
options: [
diff --git a/packages/eslint-plugin/tests/rules/no-shadow/no-shadow-eslint.test.ts b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow-eslint.test.ts
index c7c8fcbab3c5..1b009461ac9f 100644
--- a/packages/eslint-plugin/tests/rules/no-shadow/no-shadow-eslint.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow-eslint.test.ts
@@ -3,7 +3,6 @@
// License : https://github.com/eslint/eslint/blob/c4a70499720f48e27734068074fbeee4f48fb460/LICENSE
import { RuleTester } from '@typescript-eslint/rule-tester';
-import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../../src/rules/no-shadow';
@@ -27,7 +26,6 @@ function a(x) {
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -47,7 +45,6 @@ var a = x => {
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -68,7 +65,6 @@ function a(x) {
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -87,7 +83,6 @@ function a(x) {
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -106,7 +101,6 @@ function b() {
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -128,7 +122,6 @@ setTimeout(function () {
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -151,7 +144,6 @@ setTimeout(function () {
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
{
data: {
@@ -160,7 +152,6 @@ setTimeout(function () {
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -179,7 +170,6 @@ var x = 1;
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -199,7 +189,6 @@ let x = 1;
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -219,7 +208,6 @@ function a() {}
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -239,7 +227,6 @@ function a() {}
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -259,7 +246,6 @@ function a() {}
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -279,7 +265,6 @@ function a() {}
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -297,7 +282,6 @@ function a() {}
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -317,7 +301,6 @@ let a;
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -338,7 +321,6 @@ var a;
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -359,7 +341,6 @@ function a() {}
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -380,7 +361,6 @@ const a = 1;
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -401,7 +381,6 @@ var a;
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -422,7 +401,6 @@ function a() {}
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -443,7 +421,6 @@ let a;
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -464,7 +441,6 @@ var a;
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -485,7 +461,6 @@ function a() {}
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -506,7 +481,6 @@ let a;
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -527,7 +501,6 @@ var a;
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -548,7 +521,6 @@ function a() {}
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -567,7 +539,6 @@ let a;
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -586,7 +557,6 @@ var a;
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -605,7 +575,6 @@ function a() {}
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -625,7 +594,6 @@ function a() {}
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -643,7 +611,6 @@ function a() {}
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -662,7 +629,6 @@ function a() {}
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -680,7 +646,6 @@ function a() {}
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -699,7 +664,6 @@ function a() {}
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -719,7 +683,6 @@ function a() {}
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -739,7 +702,6 @@ function a() {}
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -760,7 +722,6 @@ function a() {}
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -780,7 +741,6 @@ function a() {}
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -803,7 +763,6 @@ function a() {}
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -824,7 +783,6 @@ class A {
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -845,7 +803,6 @@ class A {
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
{
data: {
@@ -854,7 +811,6 @@ class A {
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -870,7 +826,6 @@ function foo() {
name: 'Object',
},
messageId: 'noShadowGlobal',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ builtinGlobals: true }],
@@ -887,7 +842,6 @@ function foo() {
name: 'top',
},
messageId: 'noShadowGlobal',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { globals: { top: 'readonly' } },
@@ -901,12 +855,9 @@ function foo() {
name: 'Object',
},
messageId: 'noShadowGlobal',
- type: AST_NODE_TYPES.Identifier,
},
],
- languageOptions: {
- parserOptions: { ecmaVersion: 6, sourceType: 'module' },
- },
+ languageOptions: {},
options: [{ builtinGlobals: true }],
},
{
@@ -917,12 +868,10 @@ function foo() {
name: 'top',
},
messageId: 'noShadowGlobal',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: {
globals: { top: 'readonly' },
- parserOptions: { ecmaVersion: 6, sourceType: 'module' },
},
options: [{ builtinGlobals: true }],
},
@@ -934,7 +883,6 @@ function foo() {
name: 'Object',
},
messageId: 'noShadowGlobal',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: {
@@ -950,7 +898,6 @@ function foo() {
name: 'top',
},
messageId: 'noShadowGlobal',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: {
@@ -975,7 +922,6 @@ function foo(cb) {
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
},
diff --git a/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts
index 1378a1785ae2..4d5b84ad3d81 100644
--- a/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts
@@ -1,5 +1,4 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../../src/rules/no-shadow';
@@ -328,7 +327,6 @@ function doThing(foo: number) {}
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ ignoreTypeValueShadow: false }],
@@ -346,7 +344,6 @@ function doThing(foo: number) {}
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ ignoreTypeValueShadow: false }],
@@ -364,7 +361,6 @@ function doThing(foo: number, bar: number) {}
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ ignoreTypeValueShadow: true }],
@@ -387,7 +383,6 @@ declare module 'bar' {
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -409,7 +404,6 @@ declare module 'baz' {
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -431,7 +425,6 @@ declare module 'baz' {
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -448,7 +441,6 @@ let y;
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
{
data: {
@@ -457,7 +449,6 @@ let y;
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -476,7 +467,6 @@ let y;
shadowedLine: 2,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -495,7 +485,6 @@ type A = 1;
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ hoist: 'types' }],
@@ -513,7 +502,6 @@ type A = 1;
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ hoist: 'types' }],
@@ -531,7 +519,6 @@ interface A {}
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ hoist: 'types' }],
@@ -549,7 +536,6 @@ interface A {}
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ hoist: 'types' }],
@@ -569,7 +555,6 @@ type A = 1;
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ hoist: 'types' }],
@@ -589,7 +574,6 @@ type A = 1;
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ hoist: 'types' }],
@@ -608,7 +592,6 @@ type A = 1;
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ hoist: 'all' }],
@@ -626,7 +609,6 @@ type A = 1;
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ hoist: 'all' }],
@@ -644,7 +626,6 @@ interface A {}
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ hoist: 'all' }],
@@ -662,7 +643,6 @@ interface A {}
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ hoist: 'all' }],
@@ -682,7 +662,6 @@ type A = 1;
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ hoist: 'all' }],
@@ -702,7 +681,6 @@ type A = 1;
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ hoist: 'all' }],
@@ -721,7 +699,6 @@ type A = 1;
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ hoist: 'functions-and-types' }],
@@ -739,7 +716,6 @@ type A = 1;
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ hoist: 'functions-and-types' }],
@@ -757,7 +733,6 @@ interface A {}
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ hoist: 'functions-and-types' }],
@@ -775,7 +750,6 @@ interface A {}
shadowedLine: 3,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ hoist: 'functions-and-types' }],
@@ -795,7 +769,6 @@ type A = 1;
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ hoist: 'functions-and-types' }],
@@ -815,7 +788,6 @@ type A = 1;
shadowedLine: 5,
},
messageId: 'noShadow',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ hoist: 'functions-and-types' }],
diff --git a/packages/eslint-plugin/tests/rules/no-this-alias.test.ts b/packages/eslint-plugin/tests/rules/no-this-alias.test.ts
index 810092f744b2..0ad0667512c6 100644
--- a/packages/eslint-plugin/tests/rules/no-this-alias.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-this-alias.test.ts
@@ -1,19 +1,15 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/no-this-alias';
const idError = {
messageId: 'thisAssignment' as const,
- type: AST_NODE_TYPES.Identifier,
};
const destructureError = {
messageId: 'thisDestructure' as const,
- type: AST_NODE_TYPES.ObjectPattern,
};
const arrayDestructureError = {
messageId: 'thisDestructure' as const,
- type: AST_NODE_TYPES.ArrayPattern,
};
const ruleTester = new RuleTester();
diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts
index 91a153d7dd33..8bbc814fd314 100644
--- a/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts
@@ -1,5 +1,4 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/no-unnecessary-qualifier';
import { getFixturesRootDir } from '../RuleTester';
@@ -94,7 +93,6 @@ namespace A {
errors: [
{
messageId: 'unnecessaryQualifier',
- type: AST_NODE_TYPES.Identifier,
},
],
output: `
@@ -114,7 +112,6 @@ namespace A {
errors: [
{
messageId: 'unnecessaryQualifier',
- type: AST_NODE_TYPES.Identifier,
},
],
output: `
@@ -136,7 +133,6 @@ namespace A {
errors: [
{
messageId: 'unnecessaryQualifier',
- type: AST_NODE_TYPES.Identifier,
},
],
output: `
@@ -160,7 +156,6 @@ namespace A {
errors: [
{
messageId: 'unnecessaryQualifier',
- type: AST_NODE_TYPES.TSQualifiedName,
},
],
output: `
@@ -184,7 +179,6 @@ namespace A {
errors: [
{
messageId: 'unnecessaryQualifier',
- type: AST_NODE_TYPES.TSQualifiedName,
},
],
output: `
@@ -208,7 +202,6 @@ namespace A {
errors: [
{
messageId: 'unnecessaryQualifier',
- type: AST_NODE_TYPES.MemberExpression,
},
],
output: `
@@ -230,7 +223,6 @@ enum A {
errors: [
{
messageId: 'unnecessaryQualifier',
- type: AST_NODE_TYPES.Identifier,
},
],
output: `
@@ -252,7 +244,6 @@ namespace Foo {
errors: [
{
messageId: 'unnecessaryQualifier',
- type: AST_NODE_TYPES.MemberExpression,
},
],
output: `
@@ -274,7 +265,6 @@ declare module './foo' {
errors: [
{
messageId: 'unnecessaryQualifier',
- type: AST_NODE_TYPES.Identifier,
},
],
output: `
diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-member-access.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-member-access.test.ts
index 089d20ee6e19..b300edf5bb0e 100644
--- a/packages/eslint-plugin/tests/rules/no-unsafe-member-access.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-unsafe-member-access.test.ts
@@ -67,6 +67,38 @@ class B implements F.S.T.A {}
`
interface B extends F.S.T.A {}
`,
+ {
+ code: `
+function foo(x?: { a: number }) {
+ x?.a;
+}
+ `,
+ options: [{ allowOptionalChaining: true }],
+ },
+ {
+ code: `
+function foo(x?: { a: number }, y: string) {
+ x?.[y];
+}
+ `,
+ options: [{ allowOptionalChaining: true }],
+ },
+ {
+ code: `
+function foo(x: { a: number }, y: 'a') {
+ x?.[y];
+}
+ `,
+ options: [{ allowOptionalChaining: true }],
+ },
+ {
+ code: `
+function foo(x: { a: number }, y: NotKnown) {
+ x?.[y];
+}
+ `,
+ options: [{ allowOptionalChaining: true }],
+ },
],
invalid: [
{
@@ -382,5 +414,115 @@ class C {
},
],
},
+ {
+ code: `
+let value: any;
+
+value?.middle.inner;
+ `,
+ errors: [
+ {
+ column: 15,
+ data: {
+ property: '.inner',
+ type: '`any`',
+ },
+ endColumn: 20,
+ line: 4,
+ messageId: 'unsafeMemberExpression',
+ },
+ ],
+ options: [{ allowOptionalChaining: true }],
+ },
+ {
+ code: `
+let value: any;
+
+value?.outer.middle.inner;
+ `,
+ errors: [
+ {
+ column: 14,
+ data: {
+ property: '.middle',
+ type: '`any`',
+ },
+ endColumn: 20,
+ line: 4,
+ messageId: 'unsafeMemberExpression',
+ },
+ ],
+ options: [{ allowOptionalChaining: true }],
+ },
+ {
+ code: `
+let value: any;
+
+value.outer?.middle.inner;
+ `,
+ errors: [
+ {
+ column: 7,
+ data: {
+ property: '.outer',
+ type: '`any`',
+ },
+ endColumn: 12,
+ line: 4,
+ messageId: 'unsafeMemberExpression',
+ },
+ {
+ column: 21,
+ data: {
+ property: '.inner',
+ type: '`any`',
+ },
+ endColumn: 26,
+ line: 4,
+ messageId: 'unsafeMemberExpression',
+ },
+ ],
+ options: [{ allowOptionalChaining: true }],
+ },
+ {
+ code: `
+let value: any;
+
+value.outer.middle?.inner;
+ `,
+ errors: [
+ {
+ column: 7,
+ data: {
+ property: '.outer',
+ type: '`any`',
+ },
+ endColumn: 12,
+ line: 4,
+ messageId: 'unsafeMemberExpression',
+ },
+ ],
+ options: [{ allowOptionalChaining: true }],
+ },
+ {
+ code: `
+function foo(x: { a: number }, y: NotKnown) {
+ x[y];
+}
+ `,
+ errors: [
+ {
+ column: 5,
+ data: {
+ property: '[y]',
+ type: '`error` typed',
+ },
+ endColumn: 6,
+ line: 3,
+ messageId: 'unsafeComputedMemberAccess',
+ },
+ ],
+ options: [{ allowOptionalChaining: true }],
+ },
],
});
diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts
index aa1fb5b9b018..4573260c3271 100644
--- a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts
@@ -6,7 +6,6 @@ import type { TestCaseError } from '@typescript-eslint/rule-tester';
import type { TSESTree } from '@typescript-eslint/utils';
import { RuleTester } from '@typescript-eslint/rule-tester';
-import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import type { MessageIds } from '../../../src/rules/no-unused-vars';
@@ -40,7 +39,6 @@ ruleTester.defineRule('use-every-a', {
schema: [],
type: 'problem',
},
- name: 'use-every-a',
});
/**
@@ -89,13 +87,11 @@ function assignedError(
* Returns an expected error for used-but-ignored variables.
* @param varName The name of the variable
* @param [additional] The additional text for the message data
- * @param [type] The node type (defaults to "Identifier")
* @returns An expected error object
*/
function usedIgnoredError(
varName: string,
additional = '',
- type = AST_NODE_TYPES.Identifier,
): TestCaseError {
return {
data: {
@@ -103,7 +99,6 @@ function usedIgnoredError(
varName,
},
messageId: 'usedIgnoredVar',
- type,
};
}
diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts
index 10014dcc66d7..75dbb87439a7 100644
--- a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts
@@ -32,7 +32,6 @@ ruleTester.defineRule('collect-unused-vars', {
schema: [],
type: 'problem',
},
- name: 'collect-unused-vars',
});
ruleTester.run('no-unused-vars', rule, {
@@ -1716,6 +1715,48 @@ export {};
],
filename: 'foo.d.ts',
},
+ {
+ code: `
+using resource = getResource();
+ `,
+ errors: [
+ {
+ data: {
+ action: 'assigned a value',
+ additional: '',
+ varName: 'resource',
+ },
+ line: 2,
+ messageId: 'unusedVar',
+ },
+ ],
+ languageOptions: {
+ parserOptions: {
+ ecmaVersion: 2026,
+ },
+ },
+ },
+ {
+ code: `
+await using resource = getResource();
+ `,
+ errors: [
+ {
+ data: {
+ action: 'assigned a value',
+ additional: '',
+ varName: 'resource',
+ },
+ line: 2,
+ messageId: 'unusedVar',
+ },
+ ],
+ languageOptions: {
+ parserOptions: {
+ ecmaVersion: 2026,
+ },
+ },
+ },
],
valid: [
@@ -3019,5 +3060,38 @@ declare class Bar {}
`,
filename: 'foo.d.ts',
},
+ {
+ code: `
+using resource = getResource();
+resource;
+ `,
+ languageOptions: {
+ parserOptions: {
+ ecmaVersion: 2026,
+ },
+ },
+ },
+ {
+ code: `
+using resource = getResource();
+ `,
+ languageOptions: {
+ parserOptions: {
+ ecmaVersion: 2026,
+ },
+ },
+ options: [{ ignoreUsingDeclarations: true }],
+ },
+ {
+ code: `
+await using resource = getResource();
+ `,
+ languageOptions: {
+ parserOptions: {
+ ecmaVersion: 2026,
+ },
+ },
+ options: [{ ignoreUsingDeclarations: true }],
+ },
],
});
diff --git a/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts b/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts
index a08b8de812a9..8494eb33e658 100644
--- a/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts
@@ -1,5 +1,4 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/no-use-before-define';
@@ -601,7 +600,6 @@ var a = 19;
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: {
@@ -617,7 +615,6 @@ var a = 19;
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -631,7 +628,6 @@ var a = 19;
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -644,7 +640,6 @@ var a = function () {};
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -657,7 +652,6 @@ var a = [1, 3];
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -674,12 +668,10 @@ function a() {
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
{
data: { name: 'b' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -692,7 +684,6 @@ var a = function () {};
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
options: ['nofunc'],
@@ -708,7 +699,6 @@ var a = function () {};
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -722,7 +712,6 @@ function a() {}
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -740,7 +729,6 @@ try {
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -753,7 +741,6 @@ var a;
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -767,7 +754,6 @@ class A {}
{
data: { name: 'A' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -783,7 +769,6 @@ class A {}
{
data: { name: 'A' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -797,7 +782,6 @@ var A = class {};
{
data: { name: 'A' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -813,7 +797,6 @@ var A = class {};
{
data: { name: 'A' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -831,7 +814,6 @@ a++;
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -848,7 +830,6 @@ a++;
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -864,7 +845,6 @@ a++;
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -882,7 +862,6 @@ switch (foo) {
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -900,7 +879,6 @@ if (true) {
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -916,7 +894,6 @@ var a = function () {};
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ classes: false, functions: false }],
@@ -930,7 +907,6 @@ var A = class {};
{
data: { name: 'A' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -947,7 +923,6 @@ var A = class {};
{
data: { name: 'A' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -961,7 +936,6 @@ var A = class {};
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -971,7 +945,6 @@ var A = class {};
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -982,7 +955,6 @@ var A = class {};
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -993,7 +965,6 @@ var A = class {};
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -1004,7 +975,6 @@ var A = class {};
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -1015,7 +985,6 @@ var A = class {};
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -1026,7 +995,6 @@ var A = class {};
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -1037,7 +1005,6 @@ var A = class {};
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -1048,7 +1015,6 @@ var A = class {};
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -1059,7 +1025,6 @@ var A = class {};
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -1073,7 +1038,6 @@ for (var a in a) {
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
},
@@ -1086,7 +1050,6 @@ for (var a of a) {
{
data: { name: 'a' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
@@ -1105,7 +1068,6 @@ const Foo = 2;
{
data: { name: 'Foo' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ ignoreTypeReferences: false }],
@@ -1124,7 +1086,6 @@ class Foo {
{
data: { name: 'Foo' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ ignoreTypeReferences: false }],
@@ -1145,7 +1106,6 @@ const Foo = {
{
data: { name: 'Foo' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ ignoreTypeReferences: false }],
@@ -1164,7 +1124,6 @@ const baz = '';
{
data: { name: 'baz' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
options: [{ ignoreTypeReferences: false }],
@@ -1183,7 +1142,6 @@ var bar;
{
data: { name: 'bar' },
messageId: 'noUseBeforeDefine',
- type: AST_NODE_TYPES.Identifier,
},
],
languageOptions: { parserOptions },
diff --git a/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts b/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts
index 3d792dca4c7e..7eb57f812d2b 100644
--- a/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts
@@ -1,5 +1,4 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/no-useless-constructor';
@@ -228,7 +227,6 @@ ${' '}
`,
},
],
- type: AST_NODE_TYPES.MethodDefinition,
},
],
},
@@ -253,7 +251,6 @@ ${' '}
`,
},
],
- type: AST_NODE_TYPES.MethodDefinition,
},
],
},
@@ -278,7 +275,6 @@ ${' '}
`,
},
],
- type: AST_NODE_TYPES.MethodDefinition,
},
],
},
@@ -303,7 +299,6 @@ ${' '}
`,
},
],
- type: AST_NODE_TYPES.MethodDefinition,
},
],
},
@@ -328,7 +323,6 @@ ${' '}
`,
},
],
- type: AST_NODE_TYPES.MethodDefinition,
},
],
},
@@ -353,7 +347,6 @@ ${' '}
`,
},
],
- type: AST_NODE_TYPES.MethodDefinition,
},
],
},
@@ -378,7 +371,6 @@ ${' '}
`,
},
],
- type: AST_NODE_TYPES.MethodDefinition,
},
],
},
@@ -403,7 +395,6 @@ ${' '}
`,
},
],
- type: AST_NODE_TYPES.MethodDefinition,
},
],
},
@@ -426,7 +417,6 @@ ${' '}
`,
},
],
- type: AST_NODE_TYPES.MethodDefinition,
},
],
},
diff --git a/packages/eslint-plugin/tests/rules/prefer-destructuring.test.ts b/packages/eslint-plugin/tests/rules/prefer-destructuring.test.ts
index 452990eadbcd..3c4b0fa576aa 100644
--- a/packages/eslint-plugin/tests/rules/prefer-destructuring.test.ts
+++ b/packages/eslint-plugin/tests/rules/prefer-destructuring.test.ts
@@ -1,5 +1,4 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/prefer-destructuring';
import { getFixturesRootDir } from '../RuleTester';
@@ -482,7 +481,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.VariableDeclarator,
},
],
options: [
@@ -497,7 +495,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'array' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.VariableDeclarator,
},
],
options: [
@@ -512,7 +509,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.VariableDeclarator,
},
],
options: [
@@ -535,7 +531,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'array' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.VariableDeclarator,
},
],
output: null,
@@ -549,7 +544,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'array' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.AssignmentExpression,
},
],
output: null,
@@ -563,7 +557,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'array' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.VariableDeclarator,
},
],
output: null,
@@ -577,7 +570,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'array' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.AssignmentExpression,
},
],
output: null,
@@ -593,7 +585,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'array' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.VariableDeclarator,
},
],
output: null,
@@ -609,7 +600,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'array' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.AssignmentExpression,
},
],
output: null,
@@ -623,7 +613,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'array' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.VariableDeclarator,
},
],
output: null,
@@ -637,7 +626,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'array' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.AssignmentExpression,
},
],
output: null,
@@ -651,7 +639,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'array' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.VariableDeclarator,
},
],
output: null,
@@ -665,7 +652,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'array' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.AssignmentExpression,
},
],
output: null,
@@ -679,7 +665,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'array' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.VariableDeclarator,
},
],
output: null,
@@ -693,7 +678,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'array' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.AssignmentExpression,
},
],
output: null,
@@ -707,7 +691,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.VariableDeclarator,
},
],
options: [{ object: true }, { enforceForRenamedProperties: true }],
@@ -722,7 +705,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.AssignmentExpression,
},
],
options: [{ object: true }, { enforceForRenamedProperties: true }],
@@ -737,7 +719,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.VariableDeclarator,
},
],
options: [
@@ -758,7 +739,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.AssignmentExpression,
},
],
options: [
@@ -780,7 +760,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.AssignmentExpression,
},
],
options: [
@@ -799,7 +778,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.AssignmentExpression,
},
],
options: [
@@ -818,7 +796,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.AssignmentExpression,
},
],
options: [
@@ -837,7 +814,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.AssignmentExpression,
},
],
options: [
@@ -856,7 +832,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.AssignmentExpression,
},
],
options: [
@@ -875,7 +850,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.AssignmentExpression,
},
],
options: [
@@ -893,7 +867,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.VariableDeclarator,
},
],
options: [{ object: true }, { enforceForRenamedProperties: true }],
@@ -908,7 +881,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.AssignmentExpression,
},
],
options: [{ object: true }, { enforceForRenamedProperties: true }],
@@ -925,7 +897,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.VariableDeclarator,
},
],
output: `
@@ -943,7 +914,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.VariableDeclarator,
},
],
output: `
@@ -958,7 +928,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.VariableDeclarator,
},
],
output: 'const {call} = () => null;',
@@ -973,7 +942,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.VariableDeclarator,
},
],
output: `
@@ -991,7 +959,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.VariableDeclarator,
},
],
output: `
@@ -1008,7 +975,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.VariableDeclarator,
},
],
output: `
@@ -1027,7 +993,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.VariableDeclarator,
},
],
options: [{ object: true }, { enforceForRenamedProperties: true }],
@@ -1043,7 +1008,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.AssignmentExpression,
},
],
options: [{ object: true }, { enforceForRenamedProperties: true }],
@@ -1059,7 +1023,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.VariableDeclarator,
},
],
options: [{ object: true }, { enforceForRenamedProperties: true }],
@@ -1076,7 +1039,6 @@ ruleTester.run('prefer-destructuring', rule, {
{
data: { type: 'object' },
messageId: 'preferDestructuring',
- type: AST_NODE_TYPES.AssignmentExpression,
},
],
options: [{ object: true }, { enforceForRenamedProperties: true }],
diff --git a/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts b/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts
index 12f1bb333689..64109ab7e180 100644
--- a/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts
+++ b/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts
@@ -55,7 +55,6 @@ interface Foo {
literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration],
},
messageId: 'functionTypeOverCallableType',
- type: AST_NODE_TYPES.TSCallSignatureDeclaration,
},
],
output: `
@@ -76,7 +75,6 @@ export default interface Foo {
literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration],
},
messageId: 'functionTypeOverCallableType',
- type: AST_NODE_TYPES.TSCallSignatureDeclaration,
},
],
output: null,
@@ -94,7 +92,6 @@ interface Foo {
literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration],
},
messageId: 'functionTypeOverCallableType',
- type: AST_NODE_TYPES.TSCallSignatureDeclaration,
},
],
output: `
@@ -115,7 +112,6 @@ export interface Foo {
literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration],
},
messageId: 'functionTypeOverCallableType',
- type: AST_NODE_TYPES.TSCallSignatureDeclaration,
},
],
output: `
@@ -136,7 +132,6 @@ export interface Foo {
literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration],
},
messageId: 'functionTypeOverCallableType',
- type: AST_NODE_TYPES.TSCallSignatureDeclaration,
},
],
output: `
@@ -156,7 +151,6 @@ function foo(bar: { /* comment */ (s: string): number } | undefined): number {
literalOrInterface: phrases[AST_NODE_TYPES.TSTypeLiteral],
},
messageId: 'functionTypeOverCallableType',
- type: AST_NODE_TYPES.TSCallSignatureDeclaration,
},
],
output: `
@@ -177,7 +171,6 @@ type Foo = {
literalOrInterface: phrases[AST_NODE_TYPES.TSTypeLiteral],
},
messageId: 'functionTypeOverCallableType',
- type: AST_NODE_TYPES.TSCallSignatureDeclaration,
},
],
output: `
@@ -196,7 +189,6 @@ function foo(bar: { (s: string): number }): number {
literalOrInterface: phrases[AST_NODE_TYPES.TSTypeLiteral],
},
messageId: 'functionTypeOverCallableType',
- type: AST_NODE_TYPES.TSCallSignatureDeclaration,
},
],
output: `
@@ -217,7 +209,6 @@ function foo(bar: { (s: string): number } | undefined): number {
literalOrInterface: phrases[AST_NODE_TYPES.TSTypeLiteral],
},
messageId: 'functionTypeOverCallableType',
- type: AST_NODE_TYPES.TSCallSignatureDeclaration,
},
],
output: `
@@ -238,7 +229,6 @@ interface Foo extends Function {
literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration],
},
messageId: 'functionTypeOverCallableType',
- type: AST_NODE_TYPES.TSCallSignatureDeclaration,
},
],
output: `
@@ -257,7 +247,6 @@ interface Foo {
literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration],
},
messageId: 'functionTypeOverCallableType',
- type: AST_NODE_TYPES.TSCallSignatureDeclaration,
},
],
output: `
@@ -276,7 +265,6 @@ interface Foo {
literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration],
},
messageId: 'functionTypeOverCallableType',
- type: AST_NODE_TYPES.TSCallSignatureDeclaration,
},
],
output: `
@@ -293,7 +281,6 @@ type Foo = { (this: string): T };
literalOrInterface: phrases[AST_NODE_TYPES.TSTypeLiteral],
},
messageId: 'functionTypeOverCallableType',
- type: AST_NODE_TYPES.TSCallSignatureDeclaration,
},
],
output: `
@@ -312,7 +299,6 @@ interface Foo {
interfaceName: 'Foo',
},
messageId: 'unexpectedThisOnFunctionOnlyInterface',
- type: AST_NODE_TYPES.TSThisType,
},
],
output: null,
@@ -329,7 +315,6 @@ interface Foo {
interfaceName: 'Foo',
},
messageId: 'unexpectedThisOnFunctionOnlyInterface',
- type: AST_NODE_TYPES.TSThisType,
},
],
output: null,
@@ -355,7 +340,6 @@ interface Foo {
literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration],
},
messageId: 'functionTypeOverCallableType',
- type: AST_NODE_TYPES.TSCallSignatureDeclaration,
},
],
output: `
@@ -381,7 +365,6 @@ type X = {} | { (): void; }
literalOrInterface: phrases[AST_NODE_TYPES.TSTypeLiteral],
},
messageId: 'functionTypeOverCallableType',
- type: AST_NODE_TYPES.TSCallSignatureDeclaration,
},
],
output: `
@@ -398,7 +381,6 @@ type X = {} & { (): void; };
literalOrInterface: phrases[AST_NODE_TYPES.TSTypeLiteral],
},
messageId: 'functionTypeOverCallableType',
- type: AST_NODE_TYPES.TSCallSignatureDeclaration,
},
],
output: `
diff --git a/packages/eslint-plugin/tests/rules/prefer-promise-reject-errors.test.ts b/packages/eslint-plugin/tests/rules/prefer-promise-reject-errors.test.ts
index 09aa8d7e460e..d8edf4fb9c48 100644
--- a/packages/eslint-plugin/tests/rules/prefer-promise-reject-errors.test.ts
+++ b/packages/eslint-plugin/tests/rules/prefer-promise-reject-errors.test.ts
@@ -1,5 +1,4 @@
import { noFormat, RuleTester } from '@typescript-eslint/rule-tester';
-import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/prefer-promise-reject-errors';
import { getFixturesRootDir } from '../RuleTester';
@@ -320,7 +319,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, {
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -333,7 +331,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, {
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -346,7 +343,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, {
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -359,7 +355,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, {
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -372,7 +367,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, {
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -385,7 +379,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, {
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -398,7 +391,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, {
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -411,7 +403,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, {
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -424,7 +415,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, {
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
options: [{ allowEmptyReject: true }],
@@ -438,7 +428,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, {
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -451,7 +440,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, {
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -464,7 +452,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, {
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -480,7 +467,6 @@ Promise.reject(foo);
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -496,7 +482,6 @@ Promise.reject(await foo());
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -512,7 +497,6 @@ Promise.reject(foo && new Error());
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -528,7 +512,6 @@ foo.reject();
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -542,7 +525,6 @@ foo.reject();
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -555,7 +537,6 @@ foo.reject();
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -568,7 +549,6 @@ foo.reject();
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -581,7 +561,6 @@ foo.reject();
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -594,7 +573,6 @@ foo.reject();
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -607,7 +585,6 @@ foo.reject();
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -622,7 +599,6 @@ foo.reject();
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -635,7 +611,6 @@ foo.reject();
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -648,7 +623,6 @@ foo.reject();
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -661,7 +635,6 @@ foo.reject();
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -674,7 +647,6 @@ foo.reject();
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -687,7 +659,6 @@ foo.reject();
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -703,7 +674,6 @@ Promise.reject(foo);
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -719,7 +689,6 @@ Promise.reject(foo);
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -736,7 +705,6 @@ Promise.reject(foo);
endLine: 4,
line: 4,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -752,7 +720,6 @@ Promise.reject(foo);
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -768,7 +735,6 @@ Promise.reject(foo);
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -784,7 +750,6 @@ Promise.reject(foo);
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -800,7 +765,6 @@ Promise.reject(foo);
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -816,7 +780,6 @@ Promise.reject(foo);
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -832,7 +795,6 @@ Promise.reject(foo);
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -848,7 +810,6 @@ Promise.reject(foo);
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -864,7 +825,6 @@ Promise.reject(foo);
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -881,7 +841,6 @@ Promise.reject(foo);
endLine: 4,
line: 4,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -897,7 +856,6 @@ Promise.reject(foo);
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -913,7 +871,6 @@ Promise.reject(foo);
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -929,7 +886,6 @@ Promise.reject(foo);
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -947,7 +903,6 @@ new Promise(function (resolve, reject) {
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -964,7 +919,6 @@ new Promise(function (resolve, reject) {
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -981,7 +935,6 @@ new Promise((resolve, reject) => {
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -994,7 +947,6 @@ new Promise((resolve, reject) => {
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1014,7 +966,6 @@ new Promise((resolve, reject) => {
endLine: 4,
line: 4,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1027,7 +978,6 @@ new Promise((resolve, reject) => {
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1040,7 +990,6 @@ new Promise((resolve, reject) => {
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1057,7 +1006,6 @@ new Promise(function (reject, reject) {
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1074,7 +1022,6 @@ new Promise(function (foo, arguments) {
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1087,7 +1034,6 @@ new Promise(function (foo, arguments) {
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1104,7 +1050,6 @@ new Promise(function ({}, reject) {
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1117,7 +1062,6 @@ new Promise(function ({}, reject) {
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1130,7 +1074,6 @@ new Promise(function ({}, reject) {
endLine: 1,
line: 1,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1148,7 +1091,6 @@ new foo.bar((resolve, reject) => reject(5));
endLine: 5,
line: 5,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1166,7 +1108,6 @@ new (foo?.bar)((resolve, reject) => reject(5));
endLine: 5,
line: 5,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1182,7 +1123,6 @@ new foo((resolve, reject) => reject(5));
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1198,7 +1138,6 @@ new Promise((resolve, reject) => reject(foo));
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1214,7 +1153,6 @@ new Promise((resolve, reject) => reject(foo));
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1231,7 +1169,6 @@ new Promise((resolve, reject) => reject(foo));
endLine: 4,
line: 4,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1247,7 +1184,6 @@ new Promise((resolve, reject) => reject(foo));
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1263,7 +1199,6 @@ new Promise((resolve, reject) => reject(foo));
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1279,7 +1214,6 @@ new Promise((resolve, reject) => reject(foo));
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1295,7 +1229,6 @@ new Promise((resolve, reject) => reject(foo));
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1311,7 +1244,6 @@ new Promise((resolve, reject) => reject(foo));
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1327,7 +1259,6 @@ new Promise((resolve, reject) => reject(foo));
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1343,7 +1274,6 @@ new Promise((resolve, reject) => reject(foo));
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1359,7 +1289,6 @@ new Promise((resolve, reject) => reject(foo));
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1376,7 +1305,6 @@ new Promise((resolve, reject) => reject(foo));
endLine: 4,
line: 4,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1392,7 +1320,6 @@ new Promise((resolve, reject) => reject(foo));
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1408,7 +1335,6 @@ new Promise((resolve, reject) => reject(foo));
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1424,7 +1350,6 @@ new Promise((resolve, reject) => reject(foo));
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1440,7 +1365,6 @@ Foo.reject(5);
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1456,7 +1380,6 @@ foo.reject(5);
endLine: 3,
line: 3,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1473,7 +1396,6 @@ Bar.reject(5);
endLine: 4,
line: 4,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1491,7 +1413,6 @@ function fun(t: T): void {
endLine: 4,
line: 4,
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1503,7 +1424,6 @@ function fun(t: T): void {
errors: [
{
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
options: [{ allowThrowingAny: false, allowThrowingUnknown: true }],
@@ -1516,7 +1436,6 @@ function fun(t: T): void {
errors: [
{
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
options: [{ allowThrowingAny: true, allowThrowingUnknown: false }],
@@ -1529,7 +1448,6 @@ function fun(t: T): void {
errors: [
{
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
@@ -1541,7 +1459,6 @@ function fun(t: T): void {
errors: [
{
messageId: 'rejectAnError',
- type: AST_NODE_TYPES.CallExpression,
},
],
},
diff --git a/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts b/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts
index 027f2f7ae49e..94381614160a 100644
--- a/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts
+++ b/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts
@@ -320,6 +320,114 @@ function foo(arg: Test) {}
const willNotCrash = (foo: Readonly) => {};
`,
+ `
+type TaggedBigInt = bigint & {
+ readonly __tag: unique symbol;
+};
+function custom1(arg: TaggedBigInt) {}
+ `,
+ `
+type TaggedNumber = number & {
+ readonly __tag: unique symbol;
+};
+function custom1(arg: TaggedNumber) {}
+ `,
+ `
+type TaggedString = string & {
+ readonly __tag: unique symbol;
+};
+function custom1(arg: TaggedString) {}
+ `,
+ `
+type TaggedString = string & {
+ readonly __tagA: unique symbol;
+ readonly __tagB: unique symbol;
+};
+function custom1(arg: TaggedString) {}
+ `,
+ `
+type TaggedString = string & {
+ readonly __tag: unique symbol;
+};
+
+type OtherSpecialString = string & {
+ readonly ' __other_tag': unique symbol;
+};
+
+function custom1(arg: TaggedString | OtherSpecialString) {}
+ `,
+ `
+type TaggedTemplateLiteral = \`\${string}-\${string}\` & {
+ readonly __tag: unique symbol;
+};
+function custom1(arg: TaggedTemplateLiteral) {}
+ `,
+ `
+type TaggedNumber = 1 & {
+ readonly __tag: unique symbol;
+};
+
+function custom1(arg: TaggedNumber) {}
+ `,
+ `
+type TaggedNumber = (1 | 2) & {
+ readonly __tag: unique symbol;
+};
+
+function custom1(arg: TaggedNumber) {}
+ `,
+ `
+type TaggedString = ('a' | 'b') & {
+ readonly __tag: unique symbol;
+};
+
+function custom1(arg: TaggedString) {}
+ `,
+ `
+type Strings = 'one' | 'two' | 'three';
+
+type TaggedString = Strings & {
+ readonly __tag: unique symbol;
+};
+
+function custom1(arg: TaggedString) {}
+ `,
+ `
+type Strings = 'one' | 'two' | 'three';
+
+type TaggedString = Strings & {
+ __tag: unique symbol;
+};
+
+function custom1(arg: TaggedString) {}
+ `,
+ `
+type TaggedString = string & {
+ __tag: unique symbol;
+} & {
+ __tag: unique symbol;
+};
+function custom1(arg: TaggedString) {}
+ `,
+ `
+type TaggedString = string & {
+ __tagA: unique symbol;
+} & {
+ __tagB: unique symbol;
+};
+function custom1(arg: TaggedString) {}
+ `,
+ `
+type TaggedString = string &
+ ({ __tag: unique symbol } | { __tag: unique symbol });
+function custom1(arg: TaggedString) {}
+ `,
+ `
+type TaggedFunction = (() => void) & {
+ readonly __tag: unique symbol;
+};
+function custom1(arg: TaggedFunction) {}
+ `,
{
code: `
type Callback = (options: T) => void;
@@ -909,6 +1017,23 @@ function foo(arg: Test) {}
},
],
},
+ {
+ code: `
+class ClassExample {}
+type Test = typeof ClassExample & {
+ readonly property: boolean;
+};
+function foo(arg: Test) {}
+ `,
+ errors: [
+ {
+ column: 14,
+ endColumn: 23,
+ line: 6,
+ messageId: 'shouldBeReadonly',
+ },
+ ],
+ },
{
code: `
const sym = Symbol('sym');
diff --git a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts
index 2b6ddbdb9870..587445eba9b9 100644
--- a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts
+++ b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts
@@ -156,11 +156,6 @@ function foo(): Promise | boolean {
code: `
abstract class Test {
abstract test1(): Promise;
-
- // abstract method with body is always an error but it still parses into valid AST
- abstract test2(): Promise {
- return Promise.resolve(1);
- }
}
`,
},
diff --git a/packages/eslint-plugin/tests/schema-snapshots/adjacent-overload-signatures.shot b/packages/eslint-plugin/tests/schema-snapshots/adjacent-overload-signatures.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/adjacent-overload-signatures.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/adjacent-overload-signatures.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/await-thenable.shot b/packages/eslint-plugin/tests/schema-snapshots/await-thenable.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/await-thenable.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/await-thenable.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/ban-ts-comment.shot b/packages/eslint-plugin/tests/schema-snapshots/ban-ts-comment.shot
index ad8dac75ad73..9c5d8cf6deba 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/ban-ts-comment.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/ban-ts-comment.shot
@@ -33,16 +33,20 @@
"type": "number"
},
"ts-check": {
- "$ref": "#/items/0/$defs/directiveConfigSchema"
+ "$ref": "#/items/0/$defs/directiveConfigSchema",
+ "description": "Whether allow ts-check directives, and with which restrictions."
},
"ts-expect-error": {
- "$ref": "#/items/0/$defs/directiveConfigSchema"
+ "$ref": "#/items/0/$defs/directiveConfigSchema",
+ "description": "Whether and when expect-error directives, and with which restrictions."
},
"ts-ignore": {
- "$ref": "#/items/0/$defs/directiveConfigSchema"
+ "$ref": "#/items/0/$defs/directiveConfigSchema",
+ "description": "Whether allow ts-ignore directives, and with which restrictions."
},
"ts-nocheck": {
- "$ref": "#/items/0/$defs/directiveConfigSchema"
+ "$ref": "#/items/0/$defs/directiveConfigSchema",
+ "description": "Whether allow ts-nocheck directives, and with which restrictions."
}
},
"type": "object"
@@ -61,9 +65,13 @@ type DirectiveConfigSchema =
type Options = [
{
+ /** Whether allow ts-check directives, and with which restrictions. */
'ts-check'?: DirectiveConfigSchema;
+ /** Whether and when expect-error directives, and with which restrictions. */
'ts-expect-error'?: DirectiveConfigSchema;
+ /** Whether allow ts-ignore directives, and with which restrictions. */
'ts-ignore'?: DirectiveConfigSchema;
+ /** Whether allow ts-nocheck directives, and with which restrictions. */
'ts-nocheck'?: DirectiveConfigSchema;
/** A minimum character length for descriptions when `allow-with-description` is enabled. */
minimumDescriptionLength?: number;
diff --git a/packages/eslint-plugin/tests/schema-snapshots/ban-tslint-comment.shot b/packages/eslint-plugin/tests/schema-snapshots/ban-tslint-comment.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/ban-tslint-comment.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/ban-tslint-comment.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/default-param-last.shot b/packages/eslint-plugin/tests/schema-snapshots/default-param-last.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/default-param-last.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/default-param-last.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/explicit-member-accessibility.shot b/packages/eslint-plugin/tests/schema-snapshots/explicit-member-accessibility.shot
index ebdf7f52fabd..09e140871eb6 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/explicit-member-accessibility.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/explicit-member-accessibility.shot
@@ -42,19 +42,24 @@
"description": "Changes to required accessibility modifiers for specific kinds of class members.",
"properties": {
"accessors": {
- "$ref": "#/items/0/$defs/accessibilityLevel"
+ "$ref": "#/items/0/$defs/accessibilityLevel",
+ "description": "Which member accessibility modifier requirements to apply for accessors."
},
"constructors": {
- "$ref": "#/items/0/$defs/accessibilityLevel"
+ "$ref": "#/items/0/$defs/accessibilityLevel",
+ "description": "Which member accessibility modifier requirements to apply for constructors."
},
"methods": {
- "$ref": "#/items/0/$defs/accessibilityLevel"
+ "$ref": "#/items/0/$defs/accessibilityLevel",
+ "description": "Which member accessibility modifier requirements to apply for methods."
},
"parameterProperties": {
- "$ref": "#/items/0/$defs/accessibilityLevel"
+ "$ref": "#/items/0/$defs/accessibilityLevel",
+ "description": "Which member accessibility modifier requirements to apply for parameterProperties."
},
"properties": {
- "$ref": "#/items/0/$defs/accessibilityLevel"
+ "$ref": "#/items/0/$defs/accessibilityLevel",
+ "description": "Which member accessibility modifier requirements to apply for properties."
}
},
"type": "object"
@@ -83,10 +88,15 @@ type Options = [
ignoredMethodNames?: string[];
/** Changes to required accessibility modifiers for specific kinds of class members. */
overrides?: {
+ /** Which member accessibility modifier requirements to apply for accessors. */
accessors?: AccessibilityLevel;
+ /** Which member accessibility modifier requirements to apply for constructors. */
constructors?: AccessibilityLevel;
+ /** Which member accessibility modifier requirements to apply for methods. */
methods?: AccessibilityLevel;
+ /** Which member accessibility modifier requirements to apply for parameterProperties. */
parameterProperties?: AccessibilityLevel;
+ /** Which member accessibility modifier requirements to apply for properties. */
properties?: AccessibilityLevel;
};
},
diff --git a/packages/eslint-plugin/tests/schema-snapshots/member-ordering.shot b/packages/eslint-plugin/tests/schema-snapshots/member-ordering.shot
index 4da3214b15d1..e9d92a53bd03 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/member-ordering.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/member-ordering.shot
@@ -311,19 +311,24 @@
"additionalProperties": false,
"properties": {
"classes": {
- "$ref": "#/items/0/$defs/baseConfig"
+ "$ref": "#/items/0/$defs/baseConfig",
+ "description": "Which ordering to enforce for classes."
},
"classExpressions": {
- "$ref": "#/items/0/$defs/baseConfig"
+ "$ref": "#/items/0/$defs/baseConfig",
+ "description": "Which ordering to enforce for classExpressions."
},
"default": {
- "$ref": "#/items/0/$defs/baseConfig"
+ "$ref": "#/items/0/$defs/baseConfig",
+ "description": "Which ordering to enforce for default."
},
"interfaces": {
- "$ref": "#/items/0/$defs/typesConfig"
+ "$ref": "#/items/0/$defs/typesConfig",
+ "description": "Which ordering to enforce for interfaces."
},
"typeLiterals": {
- "$ref": "#/items/0/$defs/typesConfig"
+ "$ref": "#/items/0/$defs/typesConfig",
+ "description": "Which ordering to enforce for typeLiterals."
}
},
"type": "object"
@@ -525,10 +530,15 @@ type TypesConfig =
type Options = [
{
+ /** Which ordering to enforce for classExpressions. */
classExpressions?: BaseConfig;
+ /** Which ordering to enforce for classes. */
classes?: BaseConfig;
+ /** Which ordering to enforce for default. */
default?: BaseConfig;
+ /** Which ordering to enforce for interfaces. */
interfaces?: TypesConfig;
+ /** Which ordering to enforce for typeLiterals. */
typeLiterals?: TypesConfig;
},
];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/method-signature-style.shot b/packages/eslint-plugin/tests/schema-snapshots/method-signature-style.shot
index 53587bcf325b..42b7d652fd2b 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/method-signature-style.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/method-signature-style.shot
@@ -3,6 +3,7 @@
[
{
+ "description": "The method signature style to enforce using.",
"enum": ["method", "property"],
"type": "string"
}
@@ -11,4 +12,9 @@
# TYPES:
-type Options = ['method' | 'property'];
+type Options = [
+ /** The method signature style to enforce using. */
+ | 'property'
+ /** The method signature style to enforce using. */
+ | 'method',
+];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-array-constructor.shot b/packages/eslint-plugin/tests/schema-snapshots/no-array-constructor.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-array-constructor.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-array-constructor.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-array-delete.shot b/packages/eslint-plugin/tests/schema-snapshots/no-array-delete.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-array-delete.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-array-delete.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-base-to-string.shot b/packages/eslint-plugin/tests/schema-snapshots/no-base-to-string.shot
index 207398f5c070..20ae8b227f21 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-base-to-string.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-base-to-string.shot
@@ -10,7 +10,7 @@
"type": "boolean"
},
"ignoredTypeNames": {
- "description": "Stringified regular expressions of type names to ignore.",
+ "description": "Stringified type names to ignore.",
"items": {
"type": "string"
},
@@ -28,7 +28,7 @@ type Options = [
{
/** Whether to also check values of type `unknown` */
checkUnknown?: boolean;
- /** Stringified regular expressions of type names to ignore. */
+ /** Stringified type names to ignore. */
ignoredTypeNames?: string[];
},
];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-confusing-non-null-assertion.shot b/packages/eslint-plugin/tests/schema-snapshots/no-confusing-non-null-assertion.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-confusing-non-null-assertion.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-confusing-non-null-assertion.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-dupe-class-members.shot b/packages/eslint-plugin/tests/schema-snapshots/no-dupe-class-members.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-dupe-class-members.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-dupe-class-members.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-duplicate-enum-values.shot b/packages/eslint-plugin/tests/schema-snapshots/no-duplicate-enum-values.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-duplicate-enum-values.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-duplicate-enum-values.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-dynamic-delete.shot b/packages/eslint-plugin/tests/schema-snapshots/no-dynamic-delete.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-dynamic-delete.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-dynamic-delete.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-extra-non-null-assertion.shot b/packages/eslint-plugin/tests/schema-snapshots/no-extra-non-null-assertion.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-extra-non-null-assertion.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-extra-non-null-assertion.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-for-in-array.shot b/packages/eslint-plugin/tests/schema-snapshots/no-for-in-array.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-for-in-array.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-for-in-array.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-implied-eval.shot b/packages/eslint-plugin/tests/schema-snapshots/no-implied-eval.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-implied-eval.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-implied-eval.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-import-type-side-effects.shot b/packages/eslint-plugin/tests/schema-snapshots/no-import-type-side-effects.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-import-type-side-effects.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-import-type-side-effects.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-loop-func.shot b/packages/eslint-plugin/tests/schema-snapshots/no-loop-func.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-loop-func.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-loop-func.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-loss-of-precision.shot b/packages/eslint-plugin/tests/schema-snapshots/no-loss-of-precision.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-loss-of-precision.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-loss-of-precision.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-misused-new.shot b/packages/eslint-plugin/tests/schema-snapshots/no-misused-new.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-misused-new.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-misused-new.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-mixed-enums.shot b/packages/eslint-plugin/tests/schema-snapshots/no-mixed-enums.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-mixed-enums.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-mixed-enums.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-non-null-asserted-nullish-coalescing.shot b/packages/eslint-plugin/tests/schema-snapshots/no-non-null-asserted-nullish-coalescing.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-non-null-asserted-nullish-coalescing.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-non-null-asserted-nullish-coalescing.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-non-null-asserted-optional-chain.shot b/packages/eslint-plugin/tests/schema-snapshots/no-non-null-asserted-optional-chain.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-non-null-asserted-optional-chain.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-non-null-asserted-optional-chain.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-non-null-assertion.shot b/packages/eslint-plugin/tests/schema-snapshots/no-non-null-assertion.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-non-null-assertion.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-non-null-assertion.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-redundant-type-constituents.shot b/packages/eslint-plugin/tests/schema-snapshots/no-redundant-type-constituents.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-redundant-type-constituents.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-redundant-type-constituents.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-condition.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-condition.shot
index 44388c6bd694..2f59fc5bdb8c 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-condition.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-condition.shot
@@ -9,9 +9,11 @@
"description": "Whether to ignore constant loop conditions, such as `while (true)`.",
"oneOf": [
{
+ "description": "Always ignore or not ignore the loop conditions",
"type": "boolean"
},
{
+ "description": "Which situations to ignore constant conditions in.",
"enum": ["always", "never", "only-allowed-literals"],
"type": "string"
}
@@ -37,11 +39,15 @@ type Options = [
{
/** Whether to ignore constant loop conditions, such as `while (true)`. */
allowConstantLoopConditions?:
- | 'always'
| 'never'
| 'only-allowed-literals'
- /** Whether to ignore constant loop conditions, such as `while (true)`. */
- | boolean;
+ /**
+ * Whether to ignore constant loop conditions, such as `while (true)`.
+ * Always ignore or not ignore the loop conditions
+ */
+ | boolean
+ /** Which situations to ignore constant conditions in. */
+ | 'always';
/** Whether to not error when running with a tsconfig that has strictNullChecks turned. */
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean;
/** Whether to check the asserted argument of a type predicate function for unnecessary conditions */
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-parameter-property-assignment.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-parameter-property-assignment.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-parameter-property-assignment.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-parameter-property-assignment.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-qualifier.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-qualifier.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-qualifier.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-qualifier.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-template-expression.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-template-expression.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-template-expression.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-template-expression.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-arguments.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-arguments.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-arguments.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-arguments.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-constraint.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-constraint.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-constraint.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-constraint.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-conversion.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-conversion.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-conversion.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-conversion.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-parameters.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-parameters.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-parameters.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-parameters.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-argument.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-argument.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-argument.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-argument.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-assignment.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-assignment.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-assignment.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-assignment.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-call.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-call.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-call.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-call.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-declaration-merging.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-declaration-merging.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-declaration-merging.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-declaration-merging.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-enum-comparison.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-enum-comparison.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-enum-comparison.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-enum-comparison.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-function-type.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-function-type.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-function-type.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-function-type.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-member-access.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-member-access.shot
index 42f81875ed94..254c8f5ff07e 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-member-access.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-member-access.shot
@@ -1,10 +1,25 @@
# SCHEMA:
-[]
+[
+ {
+ "additionalProperties": false,
+ "properties": {
+ "allowOptionalChaining": {
+ "description": "Whether to allow `?.` optional chains on `any` values.",
+ "type": "boolean"
+ }
+ },
+ "type": "object"
+ }
+]
# TYPES:
-/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [
+ {
+ /** Whether to allow `?.` optional chains on `any` values. */
+ allowOptionalChaining?: boolean;
+ },
+];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-return.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-return.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-return.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-return.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-type-assertion.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-type-assertion.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-type-assertion.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-type-assertion.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-unary-minus.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-unary-minus.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-unary-minus.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-unary-minus.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unused-vars.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unused-vars.shot
index 0d9872aa6a11..fa83b7e42e8e 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-unused-vars.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-unused-vars.shot
@@ -5,6 +5,7 @@
{
"oneOf": [
{
+ "description": "Broad setting for unused variables to target.",
"enum": ["all", "local"],
"type": "string"
},
@@ -41,6 +42,10 @@
"description": "Whether to ignore sibling properties in `...` destructurings.",
"type": "boolean"
},
+ "ignoreUsingDeclarations": {
+ "description": "Whether to ignore using or await using declarations.",
+ "type": "boolean"
+ },
"reportUsedIgnorePattern": {
"description": "Whether to report variables that match any of the valid ignore pattern options if they have been used.",
"type": "boolean"
@@ -65,7 +70,6 @@
# TYPES:
type Options = [
- | 'all'
| 'local'
| {
/** Whether to check all, some, or no arguments. */
@@ -89,6 +93,8 @@ type Options = [
ignoreClassWithStaticInitBlock?: boolean;
/** Whether to ignore sibling properties in `...` destructurings. */
ignoreRestSiblings?: boolean;
+ /** Whether to ignore using or await using declarations. */
+ ignoreUsingDeclarations?: boolean;
/** Whether to report variables that match any of the valid ignore pattern options if they have been used. */
reportUsedIgnorePattern?: boolean;
/** Whether to check all variables or only locally-declared variables. */
@@ -98,5 +104,7 @@ type Options = [
| 'all';
/** Regular expressions of variable names to not check for usage. */
varsIgnorePattern?: string;
- },
+ }
+ /** Broad setting for unused variables to target. */
+ | 'all',
];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-use-before-define.shot b/packages/eslint-plugin/tests/schema-snapshots/no-use-before-define.shot
index f3864668838f..1aace09f842c 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-use-before-define.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-use-before-define.shot
@@ -5,6 +5,7 @@
{
"oneOf": [
{
+ "description": "Broadly set functions and allowNamedExports to false.",
"enum": ["nofunc"],
"type": "string"
},
@@ -50,7 +51,6 @@
# TYPES:
type Options = [
- | 'nofunc'
| {
/** Whether to ignore named exports. */
allowNamedExports?: boolean;
@@ -66,5 +66,7 @@ type Options = [
typedefs?: boolean;
/** Whether to ignore references to variables. */
variables?: boolean;
- },
+ }
+ /** Broadly set functions and allowNamedExports to false. */
+ | 'nofunc',
];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-useless-constructor.shot b/packages/eslint-plugin/tests/schema-snapshots/no-useless-constructor.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-useless-constructor.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-useless-constructor.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-useless-empty-export.shot b/packages/eslint-plugin/tests/schema-snapshots/no-useless-empty-export.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-useless-empty-export.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-useless-empty-export.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-wrapper-object-types.shot b/packages/eslint-plugin/tests/schema-snapshots/no-wrapper-object-types.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-wrapper-object-types.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-wrapper-object-types.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/non-nullable-type-assertion-style.shot b/packages/eslint-plugin/tests/schema-snapshots/non-nullable-type-assertion-style.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/non-nullable-type-assertion-style.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/non-nullable-type-assertion-style.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-as-const.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-as-const.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/prefer-as-const.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-as-const.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-enum-initializers.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-enum-initializers.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/prefer-enum-initializers.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-enum-initializers.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-find.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-find.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/prefer-find.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-find.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-for-of.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-for-of.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/prefer-for-of.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-for-of.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-function-type.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-function-type.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/prefer-function-type.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-function-type.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-includes.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-includes.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/prefer-includes.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-includes.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-namespace-keyword.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-namespace-keyword.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/prefer-namespace-keyword.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-namespace-keyword.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-reduce-type-parameter.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-reduce-type-parameter.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/prefer-reduce-type-parameter.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-reduce-type-parameter.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-regexp-exec.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-regexp-exec.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/prefer-regexp-exec.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-regexp-exec.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-return-this-type.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-return-this-type.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/prefer-return-this-type.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-return-this-type.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-ts-expect-error.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-ts-expect-error.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/prefer-ts-expect-error.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-ts-expect-error.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/related-getter-setter-pairs.shot b/packages/eslint-plugin/tests/schema-snapshots/related-getter-setter-pairs.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/related-getter-setter-pairs.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/related-getter-setter-pairs.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/require-await.shot b/packages/eslint-plugin/tests/schema-snapshots/require-await.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/require-await.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/require-await.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schema-snapshots/use-unknown-in-catch-callback-variable.shot b/packages/eslint-plugin/tests/schema-snapshots/use-unknown-in-catch-callback-variable.shot
index 42f81875ed94..cdd9f8375858 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/use-unknown-in-catch-callback-variable.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/use-unknown-in-catch-callback-variable.shot
@@ -7,4 +7,4 @@
# TYPES:
/** No options declared */
-type Options = [];
\ No newline at end of file
+type Options = [];
diff --git a/packages/eslint-plugin/tests/schemas.test.ts b/packages/eslint-plugin/tests/schemas.test.ts
index 14380218c9e8..4d4e5c9b2ac3 100644
--- a/packages/eslint-plugin/tests/schemas.test.ts
+++ b/packages/eslint-plugin/tests/schemas.test.ts
@@ -1,4 +1,4 @@
-import { compile } from '@typescript-eslint/rule-schema-to-typescript-types';
+import { schemaToTypes } from '@typescript-eslint/rule-schema-to-typescript-types';
import * as fs from 'node:fs/promises';
import * as path from 'node:path';
import prettier from 'prettier';
@@ -41,7 +41,7 @@ const ruleEntries = Object.entries(rules);
describe('Rule schemas should be convertible to TS types for documentation purposes', async () => {
const PRETTIER_CONFIG = {
schema: await getPrettierConfig(SCHEMA_FILEPATH),
- tsType: getPrettierConfig(TS_TYPE_FILEPATH),
+ tsType: await getPrettierConfig(TS_TYPE_FILEPATH),
};
beforeAll(async () => {
@@ -83,8 +83,8 @@ describe('Rule schemas should be convertible to TS types for documentation purpo
),
PRETTIER_CONFIG.schema,
);
- const compilationResult = await compile(
- ruleDef.meta.schema,
+ const compilationResult = await prettier.format(
+ schemaToTypes(ruleDef.meta.schema),
PRETTIER_CONFIG.tsType,
);
diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md
index 148e3265e057..45579e3b5d5d 100644
--- a/packages/parser/CHANGELOG.md
+++ b/packages/parser/CHANGELOG.md
@@ -1,3 +1,9 @@
+## 8.46.0 (2025-10-06)
+
+This was a version bump only for parser to align it with other projects, there were no code changes.
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
## 8.45.0 (2025-09-29)
This was a version bump only for parser to align it with other projects, there were no code changes.
diff --git a/packages/parser/package.json b/packages/parser/package.json
index aa7f345fb173..ed6e1efc32d9 100644
--- a/packages/parser/package.json
+++ b/packages/parser/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/parser",
- "version": "8.45.0",
+ "version": "8.46.0",
"description": "An ESLint custom parser which leverages TypeScript ESTree",
"files": [
"dist",
@@ -51,10 +51,10 @@
"typescript": ">=4.8.4 <6.0.0"
},
"dependencies": {
- "@typescript-eslint/scope-manager": "8.45.0",
- "@typescript-eslint/types": "8.45.0",
- "@typescript-eslint/typescript-estree": "8.45.0",
- "@typescript-eslint/visitor-keys": "8.45.0",
+ "@typescript-eslint/scope-manager": "8.46.0",
+ "@typescript-eslint/types": "8.46.0",
+ "@typescript-eslint/typescript-estree": "8.46.0",
+ "@typescript-eslint/visitor-keys": "8.46.0",
"debug": "^4.3.4"
},
"devDependencies": {
diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md
index 7217085d8e88..23925751fe40 100644
--- a/packages/project-service/CHANGELOG.md
+++ b/packages/project-service/CHANGELOG.md
@@ -1,3 +1,9 @@
+## 8.46.0 (2025-10-06)
+
+This was a version bump only for project-service to align it with other projects, there were no code changes.
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
## 8.45.0 (2025-09-29)
This was a version bump only for project-service to align it with other projects, there were no code changes.
diff --git a/packages/project-service/package.json b/packages/project-service/package.json
index 8954ebe69165..7de623639b7f 100644
--- a/packages/project-service/package.json
+++ b/packages/project-service/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/project-service",
- "version": "8.45.0",
+ "version": "8.46.0",
"description": "Standalone TypeScript project service wrapper for linting.",
"files": [
"dist",
@@ -49,8 +49,8 @@
"typescript": ">=4.8.4 <6.0.0"
},
"dependencies": {
- "@typescript-eslint/tsconfig-utils": "^8.45.0",
- "@typescript-eslint/types": "^8.45.0",
+ "@typescript-eslint/tsconfig-utils": "^8.46.0",
+ "@typescript-eslint/types": "^8.46.0",
"debug": "^4.3.4"
},
"devDependencies": {
diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md
index 17977ab0492a..f7280aeb60ec 100644
--- a/packages/rule-schema-to-typescript-types/CHANGELOG.md
+++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md
@@ -1,3 +1,15 @@
+## 8.46.0 (2025-10-06)
+
+### 🚀 Features
+
+- **rule-schema-to-typescript-types:** clean up and make public ([#11633](https://github.com/typescript-eslint/typescript-eslint/pull/11633))
+
+### ❤️ Thank You
+
+- Josh Goldberg ✨
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
## 8.45.0 (2025-09-29)
This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes.
diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json
index bdb5dc885613..b47a3fb329ab 100644
--- a/packages/rule-schema-to-typescript-types/package.json
+++ b/packages/rule-schema-to-typescript-types/package.json
@@ -1,8 +1,8 @@
{
"name": "@typescript-eslint/rule-schema-to-typescript-types",
- "version": "8.45.0",
- "private": true,
- "type": "commonjs",
+ "version": "8.46.0",
+ "description": "Converts ESLint rule schemas to equivalent TypeScript type strings.",
+ "type": "module",
"exports": {
".": {
"types": "./index.d.ts",
@@ -32,10 +32,9 @@
"typecheck": "yarn run -BT nx typecheck"
},
"dependencies": {
- "@typescript-eslint/type-utils": "8.45.0",
- "@typescript-eslint/utils": "8.45.0",
- "natural-compare": "^1.4.0",
- "prettier": "3.6.2"
+ "@typescript-eslint/type-utils": "8.46.0",
+ "@typescript-eslint/utils": "8.46.0",
+ "natural-compare": "^1.4.0"
},
"devDependencies": {
"@vitest/coverage-v8": "^3.1.3",
@@ -48,6 +47,9 @@
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
+ "publishConfig": {
+ "access": "public"
+ },
"nx": {
"name": "rule-schema-to-typescript-types",
"includedScripts": [
diff --git a/packages/rule-schema-to-typescript-types/src/generateArrayType.ts b/packages/rule-schema-to-typescript-types/src/generateArrayType.ts
index 54c1499f8a6c..e86e51f72dce 100644
--- a/packages/rule-schema-to-typescript-types/src/generateArrayType.ts
+++ b/packages/rule-schema-to-typescript-types/src/generateArrayType.ts
@@ -5,11 +5,17 @@ import type {
import { TSUtils } from '@typescript-eslint/utils';
-import type { ArrayAST, AST, RefMap, TupleAST, UnionAST } from './types';
+import type {
+ ArrayAST,
+ SchemaAST,
+ RefMap,
+ TupleAST,
+ UnionAST,
+} from './types.js';
-import { NotSupportedError, UnexpectedError } from './errors';
-import { generateType } from './generateType';
-import { getCommentLines } from './getCommentLines';
+import { NotSupportedError, UnexpectedError } from './errors.js';
+import { generateType } from './generateType.js';
+import { getCommentLines } from './getCommentLines.js';
/**
* If there are more than 20 tuple items then we will not make it a tuple type
@@ -95,7 +101,7 @@ export function generateArrayType(
const b: B = ['a', undefined, 'c'] // TS error
*/
const cumulativeTypesList = itemTypes.slice(0, minItems);
- const typesToUnion: AST[] = [];
+ const typesToUnion: SchemaAST[] = [];
if (cumulativeTypesList.length > 0) {
// actually has minItems, so add the initial state
typesToUnion.push(createTupleType(cumulativeTypesList));
@@ -131,8 +137,8 @@ export function generateArrayType(
}
function createTupleType(
- elements: AST[],
- spreadType: AST | null = null,
+ elements: SchemaAST[],
+ spreadType: SchemaAST | null = null,
): TupleAST {
return {
type: 'tuple',
diff --git a/packages/rule-schema-to-typescript-types/src/generateObjectType.ts b/packages/rule-schema-to-typescript-types/src/generateObjectType.ts
index 61a88a4f1e8c..1d2592f62aff 100644
--- a/packages/rule-schema-to-typescript-types/src/generateObjectType.ts
+++ b/packages/rule-schema-to-typescript-types/src/generateObjectType.ts
@@ -3,10 +3,10 @@ import type { JSONSchema4ObjectSchema } from '@typescript-eslint/utils/json-sche
import { requiresQuoting } from '@typescript-eslint/type-utils';
import { TSUtils } from '@typescript-eslint/utils';
-import type { AST, ObjectAST, RefMap } from './types';
+import type { SchemaAST, ObjectAST, RefMap } from './types.js';
-import { generateType } from './generateType';
-import { getCommentLines } from './getCommentLines';
+import { generateType } from './generateType.js';
+import { getCommentLines } from './getCommentLines.js';
export function generateObjectType(
schema: JSONSchema4ObjectSchema,
@@ -14,7 +14,7 @@ export function generateObjectType(
): ObjectAST {
const commentLines = getCommentLines(schema);
- let indexSignature: AST | null = null;
+ let indexSignature: SchemaAST | null = null;
if (
schema.additionalProperties === true ||
// eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish
diff --git a/packages/rule-schema-to-typescript-types/src/generateType.ts b/packages/rule-schema-to-typescript-types/src/generateType.ts
index 00d4e0d6e9c0..f5ef138ce3a0 100644
--- a/packages/rule-schema-to-typescript-types/src/generateType.ts
+++ b/packages/rule-schema-to-typescript-types/src/generateType.ts
@@ -2,13 +2,13 @@ import type { JSONSchema4 } from '@typescript-eslint/utils/json-schema';
import { TSUtils } from '@typescript-eslint/utils';
-import type { AST, RefMap } from './types';
+import type { SchemaAST, RefMap } from './types.js';
-import { NotSupportedError, UnexpectedError } from './errors';
-import { generateArrayType } from './generateArrayType';
-import { generateObjectType } from './generateObjectType';
-import { generateUnionType } from './generateUnionType';
-import { getCommentLines } from './getCommentLines';
+import { NotSupportedError, UnexpectedError } from './errors.js';
+import { generateArrayType } from './generateArrayType.js';
+import { generateObjectType } from './generateObjectType.js';
+import { generateUnionType } from './generateUnionType.js';
+import { getCommentLines } from './getCommentLines.js';
// keywords we probably should support but currently do not support
const UNSUPPORTED_KEYWORDS = new Set([
@@ -22,7 +22,7 @@ const UNSUPPORTED_KEYWORDS = new Set([
'patternProperties',
]);
-export function generateType(schema: JSONSchema4, refMap: RefMap): AST {
+export function generateType(schema: JSONSchema4, refMap: RefMap): SchemaAST {
const unsupportedProps = Object.keys(schema).filter(key =>
UNSUPPORTED_KEYWORDS.has(key),
);
diff --git a/packages/rule-schema-to-typescript-types/src/generateUnionType.ts b/packages/rule-schema-to-typescript-types/src/generateUnionType.ts
index ced5d9bf63aa..6370abf3a8e1 100644
--- a/packages/rule-schema-to-typescript-types/src/generateUnionType.ts
+++ b/packages/rule-schema-to-typescript-types/src/generateUnionType.ts
@@ -3,20 +3,20 @@ import type {
JSONSchema4Type,
} from '@typescript-eslint/utils/json-schema';
-import type { AST, RefMap, UnionAST } from './types';
+import type { SchemaAST, RefMap, UnionAST } from './types.js';
-import { NotSupportedError } from './errors';
-import { generateType } from './generateType';
+import { NotSupportedError } from './errors.js';
+import { generateType } from './generateType.js';
export function generateUnionType(
members: (JSONSchema4 | JSONSchema4Type)[],
refMap: RefMap,
): UnionAST {
- const elements: AST[] = [];
+ const elements: SchemaAST[] = [];
for (const memberSchema of members) {
elements.push(
- ((): AST => {
+ ((): SchemaAST => {
switch (typeof memberSchema) {
case 'string':
return {
diff --git a/packages/rule-schema-to-typescript-types/src/index.ts b/packages/rule-schema-to-typescript-types/src/index.ts
index e046d9ced2c6..d61da632a371 100644
--- a/packages/rule-schema-to-typescript-types/src/index.ts
+++ b/packages/rule-schema-to-typescript-types/src/index.ts
@@ -1,39 +1,34 @@
import type { JSONSchema4 } from '@typescript-eslint/utils/json-schema';
import { TSUtils } from '@typescript-eslint/utils';
-import prettier from 'prettier';
-import type { AST } from './types';
+import type { SchemaAST } from './types.js';
-import { generateType } from './generateType';
-import { optimizeAST } from './optimizeAST';
-import { printTypeAlias } from './printAST';
+import { generateType } from './generateType.js';
+import { optimizeAST } from './optimizeAST.js';
+import { printTypeAlias } from './printAST.js';
-export async function compile(
- schemaIn: JSONSchema4 | readonly JSONSchema4[],
- prettierConfig: Promise,
-): Promise {
- const { isArraySchema, schema } = (() => {
- if (TSUtils.isArray(schemaIn)) {
- return {
- isArraySchema: true,
- schema: schemaIn,
- };
- }
- return {
- isArraySchema: false,
- schema: [schemaIn],
- };
- })();
+/**
+ * Converts rule options schema(s) to the equivalent TypeScript type string.
+ *
+ * @param schema Original rule schema(s) as declared in `meta.schema`.
+ * @returns Stringified TypeScript type(s) equivalent to the options schema(s).
+ */
+export function schemaToTypes(
+ schema: JSONSchema4 | readonly JSONSchema4[],
+): string {
+ const [isArraySchema, schemaNormalized] = TSUtils.isArray(schema)
+ ? [true, schema]
+ : [false, [schema]];
- if (schema.length === 0) {
+ if (schemaNormalized.length === 0) {
return ['/** No options declared */', 'type Options = [];'].join('\n');
}
const refTypes: string[] = [];
- const types: AST[] = [];
- for (let i = 0; i < schema.length; i += 1) {
- const result = compileSchema(schema[i], i);
+ const types: SchemaAST[] = [];
+ for (let i = 0; i < schemaNormalized.length; i += 1) {
+ const result = compileSchema(schemaNormalized[i], i);
refTypes.push(...result.refTypes);
types.push(result.type);
}
@@ -47,21 +42,13 @@ export async function compile(
})
: printTypeAlias('Options', types[0]);
- const unformattedCode = [...refTypes, optionsType].join('\n\n');
- try {
- return await prettier.format(unformattedCode, await prettierConfig);
- } catch (e) {
- if (e instanceof Error) {
- e.message += `\n\nUnformatted Code:\n${unformattedCode}`;
- }
- throw e;
- }
+ return [...refTypes, optionsType].join('\n\n');
}
function compileSchema(
schema: JSONSchema4,
index: number,
-): { refTypes: string[]; type: AST } {
+): { refTypes: string[]; type: SchemaAST } {
const refTypes: string[] = [];
const refMap = new Map();
diff --git a/packages/rule-schema-to-typescript-types/src/optimizeAST.ts b/packages/rule-schema-to-typescript-types/src/optimizeAST.ts
index 14a0fd1c778a..0ec3626a46cd 100644
--- a/packages/rule-schema-to-typescript-types/src/optimizeAST.ts
+++ b/packages/rule-schema-to-typescript-types/src/optimizeAST.ts
@@ -1,6 +1,6 @@
-import type { AST, UnionAST } from './types';
+import type { SchemaAST, UnionAST } from './types.js';
-export function optimizeAST(ast: AST | null): void {
+export function optimizeAST(ast: SchemaAST | null): void {
if (ast == null) {
return;
}
@@ -40,7 +40,7 @@ export function optimizeAST(ast: AST | null): void {
}
// hacky way to deduplicate union members
- const uniqueElementsMap = new Map();
+ const uniqueElementsMap = new Map();
for (const element of elements) {
uniqueElementsMap.set(JSON.stringify(element), element);
}
@@ -53,8 +53,8 @@ export function optimizeAST(ast: AST | null): void {
}
}
-function unwrapUnions(union: UnionAST): AST[] {
- const elements: AST[] = [];
+function unwrapUnions(union: UnionAST): SchemaAST[] {
+ const elements: SchemaAST[] = [];
for (const element of union.elements) {
if (element.type === 'union') {
elements.push(...unwrapUnions(element));
diff --git a/packages/rule-schema-to-typescript-types/src/printAST.ts b/packages/rule-schema-to-typescript-types/src/printAST.ts
index 746d0b850b0c..a618b903a5d0 100644
--- a/packages/rule-schema-to-typescript-types/src/printAST.ts
+++ b/packages/rule-schema-to-typescript-types/src/printAST.ts
@@ -1,12 +1,12 @@
import naturalCompare from 'natural-compare';
-import type { AST, TupleAST } from './types';
+import type { SchemaAST, TupleAST } from './types.js';
-export function printTypeAlias(aliasName: string, ast: AST): string {
+export function printTypeAlias(aliasName: string, ast: SchemaAST): string {
return `${printComment(ast)}type ${aliasName} = ${printAST(ast).code}`;
}
-export function printASTWithComment(ast: AST): string {
+export function printASTWithComment(ast: SchemaAST): string {
const result = printAST(ast);
return `${printComment(result)}${result.code}`;
}
@@ -36,7 +36,7 @@ interface CodeWithComments {
code: string;
commentLines: string[];
}
-function printAST(ast: AST): CodeWithComments {
+function printAST(ast: SchemaAST): CodeWithComments {
switch (ast.type) {
case 'array': {
const code = printAndMaybeParenthesise(ast.elementType);
@@ -124,7 +124,7 @@ function printAST(ast: AST): CodeWithComments {
interface Element {
code: string;
- element: AST;
+ element: SchemaAST;
}
function compareElements(a: Element, b: Element): number {
if (a.element.type !== b.element.type) {
@@ -153,7 +153,7 @@ function compareElements(a: Element, b: Element): number {
}
}
-function printAndMaybeParenthesise(ast: AST): CodeWithComments {
+function printAndMaybeParenthesise(ast: SchemaAST): CodeWithComments {
const printed = printAST(ast);
if (ast.type === 'union') {
return {
diff --git a/packages/rule-schema-to-typescript-types/src/types.ts b/packages/rule-schema-to-typescript-types/src/types.ts
index 9edcbf0b404c..e2026a4e8917 100644
--- a/packages/rule-schema-to-typescript-types/src/types.ts
+++ b/packages/rule-schema-to-typescript-types/src/types.ts
@@ -1,3 +1,6 @@
+/**
+ * Maps ref paths to generated type names.
+ */
export type RefMap = ReadonlyMap<
// ref path
string,
@@ -5,7 +8,10 @@ export type RefMap = ReadonlyMap<
string
>;
-export type AST =
+/**
+ * Minimal representation of the nodes in a schema being compiled to types.
+ */
+export type SchemaAST =
| ArrayAST
| LiteralAST
| ObjectAST
@@ -13,37 +19,37 @@ export type AST =
| TypeReferenceAST
| UnionAST;
-interface BaseASTNode {
+export interface BaseSchemaASTNode {
readonly commentLines: string[];
}
-export interface ArrayAST extends BaseASTNode {
- readonly elementType: AST;
+export interface ArrayAST extends BaseSchemaASTNode {
+ readonly elementType: SchemaAST;
readonly type: 'array';
}
-export interface LiteralAST extends BaseASTNode {
+export interface LiteralAST extends BaseSchemaASTNode {
readonly code: string;
readonly type: 'literal';
}
-export interface ObjectAST extends BaseASTNode {
- readonly indexSignature: AST | null;
+export interface ObjectAST extends BaseSchemaASTNode {
+ readonly indexSignature: SchemaAST | null;
readonly properties: {
readonly name: string;
readonly optional: boolean;
- readonly type: AST;
+ readonly type: SchemaAST;
}[];
readonly type: 'object';
}
-export interface TupleAST extends BaseASTNode {
- readonly elements: AST[];
- readonly spreadType: AST | null;
+export interface TupleAST extends BaseSchemaASTNode {
+ readonly elements: SchemaAST[];
+ readonly spreadType: SchemaAST | null;
readonly type: 'tuple';
}
-export interface TypeReferenceAST extends BaseASTNode {
+export interface TypeReferenceAST extends BaseSchemaASTNode {
readonly type: 'type-reference';
readonly typeName: string;
}
-export interface UnionAST extends BaseASTNode {
- readonly elements: AST[];
+export interface UnionAST extends BaseSchemaASTNode {
+ readonly elements: SchemaAST[];
readonly type: 'union';
}
diff --git a/packages/rule-schema-to-typescript-types/tests/index.test.ts b/packages/rule-schema-to-typescript-types/tests/index.test.ts
new file mode 100644
index 000000000000..49db40f209f7
--- /dev/null
+++ b/packages/rule-schema-to-typescript-types/tests/index.test.ts
@@ -0,0 +1,148 @@
+import { schemaToTypes } from '../src/index.js';
+
+describe(schemaToTypes, () => {
+ it('returns a [] type when the schema is an empty array', () => {
+ const actual = schemaToTypes([]);
+
+ expect(actual).toMatchInlineSnapshot(`
+ "/** No options declared */
+ type Options = [];"
+ `);
+ });
+
+ it('returns a single Options type when the schema is not an array', () => {
+ const actual = schemaToTypes({ type: 'string' });
+
+ expect(actual).toMatchInlineSnapshot(`"type Options = string"`);
+ });
+
+ it('returns an array Options type when the schema is an array', () => {
+ const actual = schemaToTypes([{ type: 'string' }]);
+
+ expect(actual).toMatchInlineSnapshot(`"type Options = [string]"`);
+ });
+
+ it('returns a complex Options type when the schema contains an array of items', () => {
+ const actual = schemaToTypes([
+ {
+ items: [{ type: 'string' }],
+ type: 'array',
+ },
+ ]);
+
+ expect(actual).toMatchInlineSnapshot(`
+ "type Options = [ | []
+ | [string]]"
+ `);
+ });
+
+ it('returns a complex Options type when the schema is nested', () => {
+ const actual = schemaToTypes([
+ {
+ description: 'My schema items.',
+ items: { type: 'string' },
+ type: 'array',
+ },
+ ]);
+
+ expect(actual).toMatchInlineSnapshot(`
+ "type Options = [/** My schema items. */
+ string[]]"
+ `);
+ });
+
+ it('factors in one $ref property when a $defs property exists at the top level', () => {
+ const actual = schemaToTypes([
+ {
+ $defs: {
+ defOption: {
+ enum: ['a', 'b'],
+ type: 'string',
+ },
+ },
+ additionalProperties: false,
+ properties: {
+ one: {
+ $ref: '#/items/0/$defs/defOption',
+ },
+ },
+ type: 'object',
+ },
+ ]);
+
+ expect(actual).toMatchInlineSnapshot(`
+ "type DefOption = | 'a'
+ | 'b'
+
+ type Options = [{
+ one?: DefOption}]"
+ `);
+ });
+
+ it('factors in one $ref property when a definitions property exists at the top level', () => {
+ const actual = schemaToTypes([
+ {
+ additionalProperties: false,
+ definitions: {
+ defOption: {
+ enum: ['a', 'b'],
+ type: 'string',
+ },
+ },
+ properties: {
+ one: {
+ $ref: '#/items/0/$defs/defOption',
+ },
+ },
+ type: 'object',
+ },
+ ]);
+
+ expect(actual).toMatchInlineSnapshot(`
+ "type DefOption = | 'a'
+ | 'b'
+
+ type Options = [{
+ one?: DefOption}]"
+ `);
+ });
+
+ it('factors in two $ref properties when two $defs properties exist at the top level', () => {
+ const actual = schemaToTypes([
+ {
+ $defs: {
+ defOptionOne: {
+ enum: ['a', 'b'],
+ type: 'string',
+ },
+ defOptionTwo: {
+ enum: ['c', 'd'],
+ type: 'string',
+ },
+ },
+ additionalProperties: false,
+ properties: {
+ one: {
+ $ref: '#/items/0/$defs/defOptionOne',
+ },
+ two: {
+ $ref: '#/items/0/$defs/defOptionTwo',
+ },
+ },
+ type: 'object',
+ },
+ ]);
+
+ expect(actual).toMatchInlineSnapshot(`
+ "type DefOptionOne = | 'a'
+ | 'b'
+
+ type DefOptionTwo = | 'c'
+ | 'd'
+
+ type Options = [{
+ one?: DefOptionOne;
+ two?: DefOptionTwo}]"
+ `);
+ });
+});
diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md
index 3c613e796f41..6d53afcf7509 100644
--- a/packages/rule-tester/CHANGELOG.md
+++ b/packages/rule-tester/CHANGELOG.md
@@ -1,3 +1,15 @@
+## 8.46.0 (2025-10-06)
+
+### 🩹 Fixes
+
+- **rule-tester:** deprecate TestCaseError#type and LintMessage#nodeType ([#11628](https://github.com/typescript-eslint/typescript-eslint/pull/11628))
+
+### ❤️ Thank You
+
+- Mark de Dios @peanutenthusiast
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
## 8.45.0 (2025-09-29)
### 🚀 Features
diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json
index 87eccdd8595f..b12bbd465ab6 100644
--- a/packages/rule-tester/package.json
+++ b/packages/rule-tester/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/rule-tester",
- "version": "8.45.0",
+ "version": "8.46.0",
"description": "Tooling to test ESLint rules",
"files": [
"dist",
@@ -44,9 +44,9 @@
},
"//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70",
"dependencies": {
- "@typescript-eslint/parser": "8.45.0",
- "@typescript-eslint/typescript-estree": "8.45.0",
- "@typescript-eslint/utils": "8.45.0",
+ "@typescript-eslint/parser": "8.46.0",
+ "@typescript-eslint/typescript-estree": "8.46.0",
+ "@typescript-eslint/utils": "8.46.0",
"ajv": "^6.12.6",
"json-stable-stringify-without-jsonify": "^1.0.1",
"lodash.merge": "4.6.2",
diff --git a/packages/rule-tester/src/RuleTester.ts b/packages/rule-tester/src/RuleTester.ts
index bd0d8cede4eb..723bc6b17227 100644
--- a/packages/rule-tester/src/RuleTester.ts
+++ b/packages/rule-tester/src/RuleTester.ts
@@ -1102,14 +1102,6 @@ export class RuleTester extends TestFramework {
);
}
- if (error.type) {
- assert.strictEqual(
- message.nodeType,
- error.type,
- `Error type should be ${error.type}, found ${message.nodeType}`,
- );
- }
-
if (hasOwnProperty(error, 'line')) {
assert.strictEqual(
message.line,
diff --git a/packages/rule-tester/src/types/InvalidTestCase.ts b/packages/rule-tester/src/types/InvalidTestCase.ts
index 73e8f48a6771..f5ba876c8510 100644
--- a/packages/rule-tester/src/types/InvalidTestCase.ts
+++ b/packages/rule-tester/src/types/InvalidTestCase.ts
@@ -53,7 +53,7 @@ export interface TestCaseError {
*/
readonly suggestions?: readonly SuggestionOutput[] | null;
/**
- * The type of the reported AST node.
+ * @deprecated `type` is deprecated and will be removed in the next major version.
*/
readonly type?: AST_NODE_TYPES | AST_TOKEN_TYPES;
diff --git a/packages/rule-tester/tests/RuleTester.test.ts b/packages/rule-tester/tests/RuleTester.test.ts
index 054986010bc9..b7a276c69e4c 100644
--- a/packages/rule-tester/tests/RuleTester.test.ts
+++ b/packages/rule-tester/tests/RuleTester.test.ts
@@ -94,7 +94,6 @@ const NOOP_RULE: RuleModule<'error'> = {
schema: [],
type: 'problem',
},
- name: 'rule',
};
function windowsToPosixPath(p: string): string {
@@ -145,7 +144,6 @@ describe(RuleTester, () => {
line: 0,
message: 'error',
messageId: 'error',
- nodeType: AST_NODE_TYPES.Program,
ruleId: 'my-rule',
severity: 2,
source: null,
@@ -1109,7 +1107,6 @@ describe('RuleTester - hooks', () => {
schema: [],
type: 'problem',
},
- name: 'rule',
};
const ruleTester = new RuleTester();
@@ -1333,7 +1330,6 @@ describe('RuleTester - multipass fixer', () => {
schema: [],
type: 'problem',
},
- name: 'rule',
};
it('passes with no output', () => {
@@ -1419,7 +1415,6 @@ describe('RuleTester - multipass fixer', () => {
schema: [],
type: 'problem',
},
- name: 'rule',
};
it('passes with correct string output', () => {
@@ -1542,7 +1537,6 @@ describe('RuleTester - multipass fixer', () => {
schema: [],
type: 'problem',
},
- name: 'rule',
};
it('passes with correct array output', () => {
@@ -1649,7 +1643,6 @@ describe('RuleTester - run types', () => {
],
type: 'suggestion',
},
- name: 'rule',
};
describe('infer from `rule` parameter', () => {
diff --git a/packages/rule-tester/tests/filename.test.ts b/packages/rule-tester/tests/filename.test.ts
index 943ab1894a38..8f3442cf670a 100644
--- a/packages/rule-tester/tests/filename.test.ts
+++ b/packages/rule-tester/tests/filename.test.ts
@@ -19,7 +19,6 @@ const rule = ESLintUtils.RuleCreator.withoutDocs({
type: 'problem',
hasSuggestions: true,
},
- name: 'rule',
defaultOptions: [],
create: context => ({
Program(node): void {
diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md
index 2caf9fb9dc4a..9c273f69cb7b 100644
--- a/packages/scope-manager/CHANGELOG.md
+++ b/packages/scope-manager/CHANGELOG.md
@@ -1,3 +1,9 @@
+## 8.46.0 (2025-10-06)
+
+This was a version bump only for scope-manager to align it with other projects, there were no code changes.
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
## 8.45.0 (2025-09-29)
This was a version bump only for scope-manager to align it with other projects, there were no code changes.
diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json
index fb9c03271b02..7bf9f5c6c957 100644
--- a/packages/scope-manager/package.json
+++ b/packages/scope-manager/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/scope-manager",
- "version": "8.45.0",
+ "version": "8.46.0",
"description": "TypeScript scope analyser for ESLint",
"files": [
"dist",
@@ -47,11 +47,11 @@
"typecheck": "yarn run -BT nx typecheck"
},
"dependencies": {
- "@typescript-eslint/types": "8.45.0",
- "@typescript-eslint/visitor-keys": "8.45.0"
+ "@typescript-eslint/types": "8.46.0",
+ "@typescript-eslint/visitor-keys": "8.46.0"
},
"devDependencies": {
- "@typescript-eslint/typescript-estree": "8.45.0",
+ "@typescript-eslint/typescript-estree": "8.46.0",
"@vitest/coverage-v8": "^3.1.3",
"@vitest/pretty-format": "^3.1.3",
"eslint": "*",
diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md
index c46f153905b3..56e6067e86e5 100644
--- a/packages/tsconfig-utils/CHANGELOG.md
+++ b/packages/tsconfig-utils/CHANGELOG.md
@@ -1,3 +1,9 @@
+## 8.46.0 (2025-10-06)
+
+This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes.
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
## 8.45.0 (2025-09-29)
This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes.
diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json
index 286854329c8b..0a489b1036ca 100644
--- a/packages/tsconfig-utils/package.json
+++ b/packages/tsconfig-utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/tsconfig-utils",
- "version": "8.45.0",
+ "version": "8.46.0",
"description": "Utilities for collecting TSConfigs for linting scenarios.",
"files": [
"dist",
diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md
index 6f95accd3e83..e3173aa353e5 100644
--- a/packages/type-utils/CHANGELOG.md
+++ b/packages/type-utils/CHANGELOG.md
@@ -1,3 +1,15 @@
+## 8.46.0 (2025-10-06)
+
+### 🩹 Fixes
+
+- **eslint-plugin:** [prefer-readonly-parameter-types] ignore tagged primitives ([#11660](https://github.com/typescript-eslint/typescript-eslint/pull/11660))
+
+### ❤️ Thank You
+
+- Josh Goldberg ✨
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
## 8.45.0 (2025-09-29)
This was a version bump only for type-utils to align it with other projects, there were no code changes.
diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json
index 9816f01f37cb..fb7d9b0df675 100644
--- a/packages/type-utils/package.json
+++ b/packages/type-utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/type-utils",
- "version": "8.45.0",
+ "version": "8.46.0",
"description": "Type utilities for working with TypeScript + ESLint together",
"files": [
"dist",
@@ -44,9 +44,9 @@
"typecheck": "yarn run -BT nx typecheck"
},
"dependencies": {
- "@typescript-eslint/types": "8.45.0",
- "@typescript-eslint/typescript-estree": "8.45.0",
- "@typescript-eslint/utils": "8.45.0",
+ "@typescript-eslint/types": "8.46.0",
+ "@typescript-eslint/typescript-estree": "8.46.0",
+ "@typescript-eslint/utils": "8.46.0",
"debug": "^4.3.4",
"ts-api-utils": "^2.1.0"
},
@@ -55,7 +55,7 @@
"typescript": ">=4.8.4 <6.0.0"
},
"devDependencies": {
- "@typescript-eslint/parser": "8.45.0",
+ "@typescript-eslint/parser": "8.46.0",
"@vitest/coverage-v8": "^3.1.3",
"ajv": "^6.12.6",
"eslint": "*",
diff --git a/packages/type-utils/src/index.ts b/packages/type-utils/src/index.ts
index 8435b4e1f429..8b83a1931405 100644
--- a/packages/type-utils/src/index.ts
+++ b/packages/type-utils/src/index.ts
@@ -6,6 +6,7 @@ export * from './getDeclaration';
export * from './getSourceFileOfNode';
export * from './getTypeName';
export * from './isSymbolFromDefaultLibrary';
+export * from './isTypeBrandedLiteralLike';
export * from './isTypeReadonly';
export * from './isUnsafeAssignment';
export * from './predicates';
diff --git a/packages/type-utils/src/isTypeBrandedLiteralLike.ts b/packages/type-utils/src/isTypeBrandedLiteralLike.ts
new file mode 100644
index 000000000000..93852c95fbc4
--- /dev/null
+++ b/packages/type-utils/src/isTypeBrandedLiteralLike.ts
@@ -0,0 +1,50 @@
+import * as tsutils from 'ts-api-utils';
+import * as ts from 'typescript';
+
+function isLiteralOrTaggablePrimitiveLike(type: ts.Type): boolean {
+ return (
+ type.isLiteral() ||
+ tsutils.isTypeFlagSet(
+ type,
+ ts.TypeFlags.BigInt |
+ ts.TypeFlags.Number |
+ ts.TypeFlags.String |
+ ts.TypeFlags.TemplateLiteral,
+ )
+ );
+}
+
+function isObjectLiteralLike(type: ts.Type): boolean {
+ return (
+ !type.getCallSignatures().length &&
+ !type.getConstructSignatures().length &&
+ tsutils.isObjectType(type)
+ );
+}
+
+function isTypeBrandedLiteral(type: ts.Type): boolean {
+ if (!type.isIntersection()) {
+ return false;
+ }
+
+ let hadObjectLike = false;
+ let hadPrimitiveLike = false;
+
+ for (const constituent of type.types) {
+ if (isObjectLiteralLike(constituent)) {
+ hadPrimitiveLike = true;
+ } else if (isLiteralOrTaggablePrimitiveLike(constituent)) {
+ hadObjectLike = true;
+ } else {
+ return false;
+ }
+ }
+
+ return hadPrimitiveLike && hadObjectLike;
+}
+
+export function isTypeBrandedLiteralLike(type: ts.Type): boolean {
+ return type.isUnion()
+ ? type.types.every(isTypeBrandedLiteral)
+ : isTypeBrandedLiteral(type);
+}
diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md
index 06a9fadf74df..a8b32d0d089e 100644
--- a/packages/types/CHANGELOG.md
+++ b/packages/types/CHANGELOG.md
@@ -1,3 +1,9 @@
+## 8.46.0 (2025-10-06)
+
+This was a version bump only for types to align it with other projects, there were no code changes.
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
## 8.45.0 (2025-09-29)
This was a version bump only for types to align it with other projects, there were no code changes.
diff --git a/packages/types/package.json b/packages/types/package.json
index 272df4eddb9c..95466be524bb 100644
--- a/packages/types/package.json
+++ b/packages/types/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/types",
- "version": "8.45.0",
+ "version": "8.46.0",
"description": "Types for the TypeScript-ESTree AST spec",
"files": [
"dist",
diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md
index 307c04862040..f16f92e76f8b 100644
--- a/packages/typescript-eslint/CHANGELOG.md
+++ b/packages/typescript-eslint/CHANGELOG.md
@@ -1,3 +1,15 @@
+## 8.46.0 (2025-10-06)
+
+### 🚀 Features
+
+- **typescript-eslint:** export util types ([#10848](https://github.com/typescript-eslint/typescript-eslint/pull/10848), [#10849](https://github.com/typescript-eslint/typescript-eslint/pull/10849))
+
+### ❤️ Thank You
+
+- Mister-Hope @Mister-Hope
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
## 8.45.0 (2025-09-29)
This was a version bump only for typescript-eslint to align it with other projects, there were no code changes.
diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json
index c7767100da6c..19132a1a4198 100644
--- a/packages/typescript-eslint/package.json
+++ b/packages/typescript-eslint/package.json
@@ -1,6 +1,6 @@
{
"name": "typescript-eslint",
- "version": "8.45.0",
+ "version": "8.46.0",
"description": "Tooling which enables you to use TypeScript with ESLint",
"files": [
"dist",
@@ -50,10 +50,10 @@
"typecheck": "yarn run -BT nx typecheck"
},
"dependencies": {
- "@typescript-eslint/eslint-plugin": "8.45.0",
- "@typescript-eslint/parser": "8.45.0",
- "@typescript-eslint/typescript-estree": "8.45.0",
- "@typescript-eslint/utils": "8.45.0"
+ "@typescript-eslint/eslint-plugin": "8.46.0",
+ "@typescript-eslint/parser": "8.46.0",
+ "@typescript-eslint/typescript-estree": "8.46.0",
+ "@typescript-eslint/utils": "8.46.0"
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0",
diff --git a/packages/typescript-eslint/src/index.ts b/packages/typescript-eslint/src/index.ts
index c369d3605d2c..3f5f47da4b33 100644
--- a/packages/typescript-eslint/src/index.ts
+++ b/packages/typescript-eslint/src/index.ts
@@ -16,6 +16,8 @@ import type {
import { config } from './config-helper';
import { getTSConfigRootDirFromStack } from './getTSConfigRootDirFromStack';
+export type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
+
export const parser: CompatibleParser =
rawPlugin.parser as CompatibleParser satisfies FlatConfig.Parser;
diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md
index 0230830c43ef..9f63c47283f1 100644
--- a/packages/typescript-estree/CHANGELOG.md
+++ b/packages/typescript-estree/CHANGELOG.md
@@ -1,3 +1,23 @@
+## 8.46.0 (2025-10-06)
+
+### 🚀 Features
+
+- **typescript-estree:** private identifiers can only appear on LHS of in expressions ([#9232](https://github.com/typescript-eslint/typescript-eslint/pull/9232))
+- **typescript-estree:** mention file specifics in project service allowDefaultProject error ([#11635](https://github.com/typescript-eslint/typescript-eslint/pull/11635))
+
+### 🩹 Fixes
+
+- **typescript-estree:** forbid abstract method and accessor to have implementation ([#11657](https://github.com/typescript-eslint/typescript-eslint/pull/11657))
+- **typescript-estree:** forbid `abstract` modifier in object methods ([#11656](https://github.com/typescript-eslint/typescript-eslint/pull/11656))
+
+### ❤️ Thank You
+
+- fisker Cheung @fisker
+- Josh Goldberg ✨
+- Joshua Chen
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
## 8.45.0 (2025-09-29)
This was a version bump only for typescript-estree to align it with other projects, there were no code changes.
diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json
index 7f3e72f55f35..29d8b7f4e88b 100644
--- a/packages/typescript-estree/package.json
+++ b/packages/typescript-estree/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/typescript-estree",
- "version": "8.45.0",
+ "version": "8.46.0",
"description": "A parser that converts TypeScript source code into an ESTree compatible form",
"files": [
"dist",
@@ -52,10 +52,10 @@
"typecheck": "yarn run -BT nx typecheck"
},
"dependencies": {
- "@typescript-eslint/project-service": "8.45.0",
- "@typescript-eslint/tsconfig-utils": "8.45.0",
- "@typescript-eslint/types": "8.45.0",
- "@typescript-eslint/visitor-keys": "8.45.0",
+ "@typescript-eslint/project-service": "8.46.0",
+ "@typescript-eslint/tsconfig-utils": "8.46.0",
+ "@typescript-eslint/types": "8.46.0",
+ "@typescript-eslint/visitor-keys": "8.46.0",
"debug": "^4.3.4",
"fast-glob": "^3.3.2",
"is-glob": "^4.0.3",
diff --git a/packages/typescript-estree/src/check-modifiers.ts b/packages/typescript-estree/src/check-modifiers.ts
new file mode 100644
index 000000000000..b25956b8064f
--- /dev/null
+++ b/packages/typescript-estree/src/check-modifiers.ts
@@ -0,0 +1,388 @@
+import * as ts from 'typescript';
+
+import type { TSNode } from './ts-estree';
+
+import { getDecorators, getModifiers } from './getModifiers';
+import {
+ getDeclarationKind,
+ hasModifier,
+ isThisIdentifier,
+ createError,
+} from './node-utils';
+
+const SyntaxKind = ts.SyntaxKind;
+
+// `ts.nodeIsMissing`
+function nodeIsMissing(node: ts.Node | undefined): boolean {
+ if (node == null) {
+ return true;
+ }
+ return (
+ node.pos === node.end &&
+ node.pos >= 0 &&
+ node.kind !== SyntaxKind.EndOfFileToken
+ );
+}
+
+// `ts.nodeIsPresent`
+function nodeIsPresent(node: ts.Node | undefined): node is ts.Node {
+ return !nodeIsMissing(node);
+}
+
+// `ts.hasAbstractModifier`
+function hasAbstractModifier(node: ts.Node): boolean {
+ return hasModifier(SyntaxKind.AbstractKeyword, node);
+}
+
+// `ts.getThisParameter`
+function getThisParameter(
+ signature: ts.SignatureDeclaration,
+): ts.ParameterDeclaration | null {
+ if (signature.parameters.length && !ts.isJSDocSignature(signature)) {
+ const thisParameter = signature.parameters[0];
+ if (parameterIsThisKeyword(thisParameter)) {
+ return thisParameter;
+ }
+ }
+
+ return null;
+}
+
+// `ts.parameterIsThisKeyword`
+function parameterIsThisKeyword(parameter: ts.ParameterDeclaration): boolean {
+ return isThisIdentifier(parameter.name);
+}
+
+// `ts.getContainingFunction`
+function getContainingFunction(
+ node: ts.Node,
+): ts.SignatureDeclaration | undefined {
+ return ts.findAncestor(node.parent, ts.isFunctionLike);
+}
+
+// Rewrite version of `ts.nodeCanBeDecorated`
+// Returns `true` for both `useLegacyDecorators: true` and `useLegacyDecorators: false`
+function nodeCanBeDecorated(node: TSNode): boolean {
+ switch (node.kind) {
+ case SyntaxKind.ClassDeclaration:
+ return true;
+ case SyntaxKind.ClassExpression:
+ // `ts.nodeCanBeDecorated` returns `false` if `useLegacyDecorators: true`
+ return true;
+ case SyntaxKind.PropertyDeclaration: {
+ const { parent } = node;
+
+ // `ts.nodeCanBeDecorated` uses this if `useLegacyDecorators: true`
+ if (ts.isClassDeclaration(parent)) {
+ return true;
+ }
+
+ // `ts.nodeCanBeDecorated` uses this if `useLegacyDecorators: false`
+ if (ts.isClassLike(parent) && !hasAbstractModifier(node)) {
+ return true;
+ }
+
+ return false;
+ }
+ case SyntaxKind.GetAccessor:
+ case SyntaxKind.SetAccessor:
+ case SyntaxKind.MethodDeclaration: {
+ const { parent } = node;
+ // In `ts.nodeCanBeDecorated`
+ // when `useLegacyDecorators: true` uses `ts.isClassDeclaration`
+ // when `useLegacyDecorators: true` uses `ts.isClassLike`
+ return (
+ Boolean(node.body) &&
+ (ts.isClassDeclaration(parent) || ts.isClassLike(parent))
+ );
+ }
+ case SyntaxKind.Parameter: {
+ // `ts.nodeCanBeDecorated` returns `false` if `useLegacyDecorators: false`
+
+ const { parent } = node;
+ const grandparent = parent.parent;
+
+ return (
+ Boolean(parent) &&
+ 'body' in parent &&
+ Boolean(parent.body) &&
+ (parent.kind === SyntaxKind.Constructor ||
+ parent.kind === SyntaxKind.MethodDeclaration ||
+ parent.kind === SyntaxKind.SetAccessor) &&
+ getThisParameter(parent) !== node &&
+ Boolean(grandparent) &&
+ grandparent.kind === SyntaxKind.ClassDeclaration
+ );
+ }
+ }
+
+ return false;
+}
+
+function nodeHasIllegalDecorators(
+ node: ts.Node,
+): node is { illegalDecorators: ts.Node[] } & ts.Node {
+ return !!(
+ 'illegalDecorators' in node &&
+ (node.illegalDecorators as unknown[] | undefined)?.length
+ );
+}
+
+function throwError(node: ts.Node, message: string): never {
+ const ast = node.getSourceFile();
+ const start = node.getStart(ast);
+ const end = node.getEnd();
+
+ throw createError(message, ast, start, end);
+}
+
+export function checkModifiers(node: ts.Node): void {
+ // typescript<5.0.0
+ if (nodeHasIllegalDecorators(node)) {
+ throwError(node.illegalDecorators[0], 'Decorators are not valid here.');
+ }
+
+ for (const decorator of getDecorators(
+ node,
+ /* includeIllegalDecorators */ true,
+ ) ?? []) {
+ // `checkGrammarModifiers` function in typescript
+ if (!nodeCanBeDecorated(node as TSNode)) {
+ if (ts.isMethodDeclaration(node) && !nodeIsPresent(node.body)) {
+ throwError(
+ decorator,
+ 'A decorator can only decorate a method implementation, not an overload.',
+ );
+ } else {
+ throwError(decorator, 'Decorators are not valid here.');
+ }
+ }
+ }
+
+ for (const modifier of getModifiers(
+ node,
+ /* includeIllegalModifiers */ true,
+ ) ?? []) {
+ if (modifier.kind !== SyntaxKind.ReadonlyKeyword) {
+ if (
+ node.kind === SyntaxKind.PropertySignature ||
+ node.kind === SyntaxKind.MethodSignature
+ ) {
+ throwError(
+ modifier,
+ `'${ts.tokenToString(
+ modifier.kind,
+ )}' modifier cannot appear on a type member`,
+ );
+ }
+
+ if (
+ node.kind === SyntaxKind.IndexSignature &&
+ (modifier.kind !== SyntaxKind.StaticKeyword ||
+ !ts.isClassLike(node.parent))
+ ) {
+ throwError(
+ modifier,
+ `'${ts.tokenToString(
+ modifier.kind,
+ )}' modifier cannot appear on an index signature`,
+ );
+ }
+ }
+
+ if (
+ modifier.kind !== SyntaxKind.InKeyword &&
+ modifier.kind !== SyntaxKind.OutKeyword &&
+ modifier.kind !== SyntaxKind.ConstKeyword &&
+ node.kind === SyntaxKind.TypeParameter
+ ) {
+ throwError(
+ modifier,
+ `'${ts.tokenToString(
+ modifier.kind,
+ )}' modifier cannot appear on a type parameter`,
+ );
+ }
+
+ if (
+ (modifier.kind === SyntaxKind.InKeyword ||
+ modifier.kind === SyntaxKind.OutKeyword) &&
+ (node.kind !== SyntaxKind.TypeParameter ||
+ !(
+ ts.isInterfaceDeclaration(node.parent) ||
+ ts.isClassLike(node.parent) ||
+ ts.isTypeAliasDeclaration(node.parent)
+ ))
+ ) {
+ throwError(
+ modifier,
+ `'${ts.tokenToString(
+ modifier.kind,
+ )}' modifier can only appear on a type parameter of a class, interface or type alias`,
+ );
+ }
+
+ if (
+ modifier.kind === SyntaxKind.ReadonlyKeyword &&
+ node.kind !== SyntaxKind.PropertyDeclaration &&
+ node.kind !== SyntaxKind.PropertySignature &&
+ node.kind !== SyntaxKind.IndexSignature &&
+ node.kind !== SyntaxKind.Parameter
+ ) {
+ throwError(
+ modifier,
+ "'readonly' modifier can only appear on a property declaration or index signature.",
+ );
+ }
+
+ if (
+ modifier.kind === SyntaxKind.DeclareKeyword &&
+ ts.isClassLike(node.parent) &&
+ !ts.isPropertyDeclaration(node)
+ ) {
+ throwError(
+ modifier,
+ `'${ts.tokenToString(
+ modifier.kind,
+ )}' modifier cannot appear on class elements of this kind.`,
+ );
+ }
+
+ if (
+ modifier.kind === SyntaxKind.DeclareKeyword &&
+ ts.isVariableStatement(node)
+ ) {
+ const declarationKind = getDeclarationKind(node.declarationList);
+ if (declarationKind === 'using' || declarationKind === 'await using') {
+ throwError(
+ modifier,
+ `'declare' modifier cannot appear on a '${declarationKind}' declaration.`,
+ );
+ }
+ }
+
+ if (
+ modifier.kind === SyntaxKind.AbstractKeyword &&
+ node.kind !== SyntaxKind.ClassDeclaration &&
+ node.kind !== SyntaxKind.ConstructorType &&
+ node.kind !== SyntaxKind.MethodDeclaration &&
+ node.kind !== SyntaxKind.PropertyDeclaration &&
+ node.kind !== SyntaxKind.GetAccessor &&
+ node.kind !== SyntaxKind.SetAccessor
+ ) {
+ throwError(
+ modifier,
+ `'${ts.tokenToString(
+ modifier.kind,
+ )}' modifier can only appear on a class, method, or property declaration.`,
+ );
+ }
+
+ if (
+ (modifier.kind === SyntaxKind.StaticKeyword ||
+ modifier.kind === SyntaxKind.PublicKeyword ||
+ modifier.kind === SyntaxKind.ProtectedKeyword ||
+ modifier.kind === SyntaxKind.PrivateKeyword) &&
+ (node.parent.kind === SyntaxKind.ModuleBlock ||
+ node.parent.kind === SyntaxKind.SourceFile)
+ ) {
+ throwError(
+ modifier,
+ `'${ts.tokenToString(
+ modifier.kind,
+ )}' modifier cannot appear on a module or namespace element.`,
+ );
+ }
+
+ if (
+ modifier.kind === SyntaxKind.AccessorKeyword &&
+ node.kind !== SyntaxKind.PropertyDeclaration
+ ) {
+ throwError(
+ modifier,
+ "'accessor' modifier can only appear on a property declaration.",
+ );
+ }
+
+ // `checkGrammarAsyncModifier` function in `typescript`
+ if (
+ modifier.kind === SyntaxKind.AsyncKeyword &&
+ node.kind !== SyntaxKind.MethodDeclaration &&
+ node.kind !== SyntaxKind.FunctionDeclaration &&
+ node.kind !== SyntaxKind.FunctionExpression &&
+ node.kind !== SyntaxKind.ArrowFunction
+ ) {
+ throwError(modifier, "'async' modifier cannot be used here.");
+ }
+
+ // `checkGrammarModifiers` function in `typescript`
+ if (
+ node.kind === SyntaxKind.Parameter &&
+ (modifier.kind === SyntaxKind.StaticKeyword ||
+ modifier.kind === SyntaxKind.ExportKeyword ||
+ modifier.kind === SyntaxKind.DeclareKeyword ||
+ modifier.kind === SyntaxKind.AsyncKeyword)
+ ) {
+ throwError(
+ modifier,
+ `'${ts.tokenToString(
+ modifier.kind,
+ )}' modifier cannot appear on a parameter.`,
+ );
+ }
+
+ // `checkGrammarModifiers` function in `typescript`
+ if (
+ modifier.kind === SyntaxKind.PublicKeyword ||
+ modifier.kind === SyntaxKind.ProtectedKeyword ||
+ modifier.kind === SyntaxKind.PrivateKeyword
+ ) {
+ for (const anotherModifier of getModifiers(node) ?? []) {
+ if (
+ anotherModifier !== modifier &&
+ (anotherModifier.kind === SyntaxKind.PublicKeyword ||
+ anotherModifier.kind === SyntaxKind.ProtectedKeyword ||
+ anotherModifier.kind === SyntaxKind.PrivateKeyword)
+ ) {
+ throwError(anotherModifier, `Accessibility modifier already seen.`);
+ }
+ }
+ }
+
+ // `checkParameter` function in `typescript`
+ if (
+ node.kind === SyntaxKind.Parameter &&
+ // In `typescript` package, it's `ts.hasSyntacticModifier(node, ts.ModifierFlags.ParameterPropertyModifier)`
+ // https://github.com/typescript-eslint/typescript-eslint/pull/6615#discussion_r1136489935
+ (modifier.kind === SyntaxKind.PublicKeyword ||
+ modifier.kind === SyntaxKind.PrivateKeyword ||
+ modifier.kind === SyntaxKind.ProtectedKeyword ||
+ modifier.kind === SyntaxKind.ReadonlyKeyword ||
+ modifier.kind === SyntaxKind.OverrideKeyword)
+ ) {
+ const func = getContainingFunction(node);
+
+ if (
+ !(func?.kind === SyntaxKind.Constructor && nodeIsPresent(func.body))
+ ) {
+ throwError(
+ modifier,
+ 'A parameter property is only allowed in a constructor implementation.',
+ );
+ }
+ }
+
+ // There are more cases in `checkGrammarObjectLiteralExpression` in TypeScript.
+ // We may add more validations for them here in the future.
+ if (
+ modifier.kind === SyntaxKind.AbstractKeyword &&
+ node.kind === SyntaxKind.MethodDeclaration &&
+ node.parent.kind === SyntaxKind.ObjectLiteralExpression
+ ) {
+ throwError(
+ modifier,
+ `'${ts.tokenToString(modifier.kind)}' modifier cannot be used here.`,
+ );
+ }
+ }
+}
diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts
index bec26fede610..3facbe34af20 100644
--- a/packages/typescript-estree/src/convert.ts
+++ b/packages/typescript-estree/src/convert.ts
@@ -10,13 +10,14 @@ import type {
import type { SemanticOrSyntacticError } from './semantic-or-syntactic-errors';
import type { TSESTree, TSESTreeToTSNode, TSNode } from './ts-estree';
+import { checkModifiers } from './check-modifiers';
import { getDecorators, getModifiers } from './getModifiers';
import {
canContainDirective,
createError,
+ declarationNameToString,
findNextToken,
getBinaryExpressionType,
- getContainingFunction,
getDeclarationKind,
getLastModifier,
getLineAndCharacterFor,
@@ -34,9 +35,6 @@ import {
isOptional,
isThisInTypeQuery,
isValidAssignmentTarget,
- nodeCanBeDecorated,
- nodeHasIllegalDecorators,
- nodeIsPresent,
unescapeStringLiteralText,
} from './node-utils';
import { AST_NODE_TYPES } from './ts-estree';
@@ -158,247 +156,7 @@ export class Converter {
return;
}
- // typescript<5.0.0
- if (nodeHasIllegalDecorators(node)) {
- this.#throwError(
- node.illegalDecorators[0],
- 'Decorators are not valid here.',
- );
- }
-
- for (const decorator of getDecorators(
- node,
- /* includeIllegalDecorators */ true,
- ) ?? []) {
- // `checkGrammarModifiers` function in typescript
- if (!nodeCanBeDecorated(node as TSNode)) {
- if (ts.isMethodDeclaration(node) && !nodeIsPresent(node.body)) {
- this.#throwError(
- decorator,
- 'A decorator can only decorate a method implementation, not an overload.',
- );
- } else {
- this.#throwError(decorator, 'Decorators are not valid here.');
- }
- }
- }
-
- for (const modifier of getModifiers(
- node,
- /* includeIllegalModifiers */ true,
- ) ?? []) {
- if (modifier.kind !== SyntaxKind.ReadonlyKeyword) {
- if (
- node.kind === SyntaxKind.PropertySignature ||
- node.kind === SyntaxKind.MethodSignature
- ) {
- this.#throwError(
- modifier,
- `'${ts.tokenToString(
- modifier.kind,
- )}' modifier cannot appear on a type member`,
- );
- }
-
- if (
- node.kind === SyntaxKind.IndexSignature &&
- (modifier.kind !== SyntaxKind.StaticKeyword ||
- !ts.isClassLike(node.parent))
- ) {
- this.#throwError(
- modifier,
- `'${ts.tokenToString(
- modifier.kind,
- )}' modifier cannot appear on an index signature`,
- );
- }
- }
-
- if (
- modifier.kind !== SyntaxKind.InKeyword &&
- modifier.kind !== SyntaxKind.OutKeyword &&
- modifier.kind !== SyntaxKind.ConstKeyword &&
- node.kind === SyntaxKind.TypeParameter
- ) {
- this.#throwError(
- modifier,
- `'${ts.tokenToString(
- modifier.kind,
- )}' modifier cannot appear on a type parameter`,
- );
- }
-
- if (
- (modifier.kind === SyntaxKind.InKeyword ||
- modifier.kind === SyntaxKind.OutKeyword) &&
- (node.kind !== SyntaxKind.TypeParameter ||
- !(
- ts.isInterfaceDeclaration(node.parent) ||
- ts.isClassLike(node.parent) ||
- ts.isTypeAliasDeclaration(node.parent)
- ))
- ) {
- this.#throwError(
- modifier,
- `'${ts.tokenToString(
- modifier.kind,
- )}' modifier can only appear on a type parameter of a class, interface or type alias`,
- );
- }
-
- if (
- modifier.kind === SyntaxKind.ReadonlyKeyword &&
- node.kind !== SyntaxKind.PropertyDeclaration &&
- node.kind !== SyntaxKind.PropertySignature &&
- node.kind !== SyntaxKind.IndexSignature &&
- node.kind !== SyntaxKind.Parameter
- ) {
- this.#throwError(
- modifier,
- "'readonly' modifier can only appear on a property declaration or index signature.",
- );
- }
-
- if (
- modifier.kind === SyntaxKind.DeclareKeyword &&
- ts.isClassLike(node.parent) &&
- !ts.isPropertyDeclaration(node)
- ) {
- this.#throwError(
- modifier,
- `'${ts.tokenToString(
- modifier.kind,
- )}' modifier cannot appear on class elements of this kind.`,
- );
- }
-
- if (
- modifier.kind === SyntaxKind.DeclareKeyword &&
- ts.isVariableStatement(node)
- ) {
- const declarationKind = getDeclarationKind(node.declarationList);
- if (declarationKind === 'using' || declarationKind === 'await using') {
- this.#throwError(
- modifier,
- `'declare' modifier cannot appear on a '${declarationKind}' declaration.`,
- );
- }
- }
-
- if (
- modifier.kind === SyntaxKind.AbstractKeyword &&
- node.kind !== SyntaxKind.ClassDeclaration &&
- node.kind !== SyntaxKind.ConstructorType &&
- node.kind !== SyntaxKind.MethodDeclaration &&
- node.kind !== SyntaxKind.PropertyDeclaration &&
- node.kind !== SyntaxKind.GetAccessor &&
- node.kind !== SyntaxKind.SetAccessor
- ) {
- this.#throwError(
- modifier,
- `'${ts.tokenToString(
- modifier.kind,
- )}' modifier can only appear on a class, method, or property declaration.`,
- );
- }
-
- if (
- (modifier.kind === SyntaxKind.StaticKeyword ||
- modifier.kind === SyntaxKind.PublicKeyword ||
- modifier.kind === SyntaxKind.ProtectedKeyword ||
- modifier.kind === SyntaxKind.PrivateKeyword) &&
- (node.parent.kind === SyntaxKind.ModuleBlock ||
- node.parent.kind === SyntaxKind.SourceFile)
- ) {
- this.#throwError(
- modifier,
- `'${ts.tokenToString(
- modifier.kind,
- )}' modifier cannot appear on a module or namespace element.`,
- );
- }
-
- if (
- modifier.kind === SyntaxKind.AccessorKeyword &&
- node.kind !== SyntaxKind.PropertyDeclaration
- ) {
- this.#throwError(
- modifier,
- "'accessor' modifier can only appear on a property declaration.",
- );
- }
-
- // `checkGrammarAsyncModifier` function in `typescript`
- if (
- modifier.kind === SyntaxKind.AsyncKeyword &&
- node.kind !== SyntaxKind.MethodDeclaration &&
- node.kind !== SyntaxKind.FunctionDeclaration &&
- node.kind !== SyntaxKind.FunctionExpression &&
- node.kind !== SyntaxKind.ArrowFunction
- ) {
- this.#throwError(modifier, "'async' modifier cannot be used here.");
- }
-
- // `checkGrammarModifiers` function in `typescript`
- if (
- node.kind === SyntaxKind.Parameter &&
- (modifier.kind === SyntaxKind.StaticKeyword ||
- modifier.kind === SyntaxKind.ExportKeyword ||
- modifier.kind === SyntaxKind.DeclareKeyword ||
- modifier.kind === SyntaxKind.AsyncKeyword)
- ) {
- this.#throwError(
- modifier,
- `'${ts.tokenToString(
- modifier.kind,
- )}' modifier cannot appear on a parameter.`,
- );
- }
-
- // `checkGrammarModifiers` function in `typescript`
- if (
- modifier.kind === SyntaxKind.PublicKeyword ||
- modifier.kind === SyntaxKind.ProtectedKeyword ||
- modifier.kind === SyntaxKind.PrivateKeyword
- ) {
- for (const anotherModifier of getModifiers(node) ?? []) {
- if (
- anotherModifier !== modifier &&
- (anotherModifier.kind === SyntaxKind.PublicKeyword ||
- anotherModifier.kind === SyntaxKind.ProtectedKeyword ||
- anotherModifier.kind === SyntaxKind.PrivateKeyword)
- ) {
- this.#throwError(
- anotherModifier,
- `Accessibility modifier already seen.`,
- );
- }
- }
- }
-
- // `checkParameter` function in `typescript`
- if (
- node.kind === SyntaxKind.Parameter &&
- // In `typescript` package, it's `ts.hasSyntacticModifier(node, ts.ModifierFlags.ParameterPropertyModifier)`
- // https://github.com/typescript-eslint/typescript-eslint/pull/6615#discussion_r1136489935
- (modifier.kind === SyntaxKind.PublicKeyword ||
- modifier.kind === SyntaxKind.PrivateKeyword ||
- modifier.kind === SyntaxKind.ProtectedKeyword ||
- modifier.kind === SyntaxKind.ReadonlyKeyword ||
- modifier.kind === SyntaxKind.OverrideKeyword)
- ) {
- const func = getContainingFunction(node)!;
-
- if (
- !(func.kind === SyntaxKind.Constructor && nodeIsPresent(func.body))
- ) {
- this.#throwError(
- modifier,
- 'A parameter property is only allowed in a constructor implementation.',
- );
- }
- }
- }
+ checkModifiers(node);
}
#throwError(node: number | ts.Node | TSESTree.Range, message: string): never {
@@ -1599,6 +1357,18 @@ export class Converter {
}
// otherwise, it is a non-type accessor - intentional fallthrough
case SyntaxKind.MethodDeclaration: {
+ const isAbstract = hasModifier(SyntaxKind.AbstractKeyword, node);
+
+ if (isAbstract && node.body) {
+ this.#throwError(
+ node.name,
+ node.kind === SyntaxKind.GetAccessor ||
+ node.kind === SyntaxKind.SetAccessor
+ ? 'An abstract accessor cannot have an implementation.'
+ : `Method '${declarationNameToString(node.name, this.ast)}' cannot have an implementation because it is marked abstract.`,
+ );
+ }
+
const method = this.createNode<
TSESTree.FunctionExpression | TSESTree.TSEmptyBodyFunctionExpression
>(node, {
@@ -1654,10 +1424,7 @@ export class Converter {
/**
* TypeScript class methods can be defined as "abstract"
*/
- const methodDefinitionType = hasModifier(
- SyntaxKind.AbstractKeyword,
- node,
- )
+ const methodDefinitionType = isAbstract
? AST_NODE_TYPES.TSAbstractMethodDefinition
: AST_NODE_TYPES.MethodDefinition;
@@ -2405,6 +2172,21 @@ export class Converter {
// Binary Operations
case SyntaxKind.BinaryExpression: {
+ if (
+ node.operatorToken.kind !== SyntaxKind.InKeyword &&
+ node.left.kind === SyntaxKind.PrivateIdentifier
+ ) {
+ this.#throwError(
+ node.left,
+ "Private identifiers cannot appear on the right-hand-side of an 'in' expression.",
+ );
+ } else if (node.right.kind === SyntaxKind.PrivateIdentifier) {
+ this.#throwError(
+ node.right,
+ "Private identifiers are only allowed on the left-hand-side of an 'in' expression.",
+ );
+ }
+
// TypeScript uses BinaryExpression for sequences as well
if (isComma(node.operatorToken)) {
const result = this.createNode(node, {
diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts
index 640b493d63bb..b5990014e589 100644
--- a/packages/typescript-estree/src/node-utils.ts
+++ b/packages/typescript-estree/src/node-utils.ts
@@ -1,6 +1,6 @@
import * as ts from 'typescript';
-import type { TSESTree, TSNode } from './ts-estree';
+import type { TSESTree } from './ts-estree';
import { getModifiers } from './getModifiers';
import { xhtmlEntities } from './jsx/xhtml-entities';
@@ -692,15 +692,6 @@ export function createError(
return new TSError(message, ast.fileName, { end, start });
}
-export function nodeHasIllegalDecorators(
- node: ts.Node,
-): node is { illegalDecorators: ts.Node[] } & ts.Node {
- return !!(
- 'illegalDecorators' in node &&
- (node.illegalDecorators as unknown[] | undefined)?.length
- );
-}
-
export function nodeHasTokens(n: ts.Node, ast: ts.SourceFile): boolean {
// If we have a token or node that has a non-zero width, it must have tokens.
// Note: getWidth() does not take trivia into account.
@@ -762,113 +753,6 @@ export function isThisInTypeQuery(node: ts.Node): boolean {
return node.parent.kind === SyntaxKind.TypeQuery;
}
-// `ts.nodeIsMissing`
-function nodeIsMissing(node: ts.Node | undefined): boolean {
- if (node == null) {
- return true;
- }
- return (
- node.pos === node.end &&
- node.pos >= 0 &&
- node.kind !== SyntaxKind.EndOfFileToken
- );
-}
-
-// `ts.nodeIsPresent`
-export function nodeIsPresent(node: ts.Node | undefined): node is ts.Node {
- return !nodeIsMissing(node);
-}
-
-// `ts.getContainingFunction`
-export function getContainingFunction(
- node: ts.Node,
-): ts.SignatureDeclaration | undefined {
- return ts.findAncestor(node.parent, ts.isFunctionLike);
-}
-
-// `ts.hasAbstractModifier`
-function hasAbstractModifier(node: ts.Node): boolean {
- return hasModifier(SyntaxKind.AbstractKeyword, node);
-}
-
-// `ts.getThisParameter`
-function getThisParameter(
- signature: ts.SignatureDeclaration,
-): ts.ParameterDeclaration | null {
- if (signature.parameters.length && !ts.isJSDocSignature(signature)) {
- const thisParameter = signature.parameters[0];
- if (parameterIsThisKeyword(thisParameter)) {
- return thisParameter;
- }
- }
-
- return null;
-}
-
-// `ts.parameterIsThisKeyword`
-function parameterIsThisKeyword(parameter: ts.ParameterDeclaration): boolean {
- return isThisIdentifier(parameter.name);
-}
-
-// Rewrite version of `ts.nodeCanBeDecorated`
-// Returns `true` for both `useLegacyDecorators: true` and `useLegacyDecorators: false`
-export function nodeCanBeDecorated(node: TSNode): boolean {
- switch (node.kind) {
- case SyntaxKind.ClassDeclaration:
- return true;
- case SyntaxKind.ClassExpression:
- // `ts.nodeCanBeDecorated` returns `false` if `useLegacyDecorators: true`
- return true;
- case SyntaxKind.PropertyDeclaration: {
- const { parent } = node;
-
- // `ts.nodeCanBeDecorated` uses this if `useLegacyDecorators: true`
- if (ts.isClassDeclaration(parent)) {
- return true;
- }
-
- // `ts.nodeCanBeDecorated` uses this if `useLegacyDecorators: false`
- if (ts.isClassLike(parent) && !hasAbstractModifier(node)) {
- return true;
- }
-
- return false;
- }
- case SyntaxKind.GetAccessor:
- case SyntaxKind.SetAccessor:
- case SyntaxKind.MethodDeclaration: {
- const { parent } = node;
- // In `ts.nodeCanBeDecorated`
- // when `useLegacyDecorators: true` uses `ts.isClassDeclaration`
- // when `useLegacyDecorators: true` uses `ts.isClassLike`
- return (
- Boolean(node.body) &&
- (ts.isClassDeclaration(parent) || ts.isClassLike(parent))
- );
- }
- case SyntaxKind.Parameter: {
- // `ts.nodeCanBeDecorated` returns `false` if `useLegacyDecorators: false`
-
- const { parent } = node;
- const grandparent = parent.parent;
-
- return (
- Boolean(parent) &&
- 'body' in parent &&
- Boolean(parent.body) &&
- (parent.kind === SyntaxKind.Constructor ||
- parent.kind === SyntaxKind.MethodDeclaration ||
- parent.kind === SyntaxKind.SetAccessor) &&
- getThisParameter(parent) !== node &&
- Boolean(grandparent) &&
- grandparent.kind === SyntaxKind.ClassDeclaration
- );
- }
- }
-
- return false;
-}
-
export function isValidAssignmentTarget(node: ts.Node): boolean {
switch (node.kind) {
case SyntaxKind.Identifier:
@@ -919,3 +803,12 @@ export function getNamespaceModifiers(
}
return modifiers;
}
+
+// `ts.declarationNameToString`
+export function declarationNameToString(
+ name: ts.Node,
+ ast: ts.SourceFile,
+): string {
+ const text = ast.text.slice(name.pos, name.end).trimStart();
+ return text || '(Missing)';
+}
diff --git a/packages/typescript-estree/src/useProgramFromProjectService.ts b/packages/typescript-estree/src/useProgramFromProjectService.ts
index 9a365029de02..fec277ce4ea6 100644
--- a/packages/typescript-estree/src/useProgramFromProjectService.ts
+++ b/packages/typescript-estree/src/useProgramFromProjectService.ts
@@ -96,8 +96,24 @@ function openClientFileFromProjectService(
}
if (!isDefaultProjectAllowed) {
+ const baseMessage = `${wasNotFound}. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`;
+ const allowDefaultProject =
+ parseSettings.projectService?.allowDefaultProject;
+
+ if (!allowDefaultProject) {
+ throw new Error(baseMessage);
+ }
+
+ const relativeFilePath = path.relative(
+ parseSettings.tsconfigRootDir,
+ filePathAbsolute,
+ );
+
throw new Error(
- `${wasNotFound}. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`,
+ [
+ baseMessage,
+ `allowDefaultProject is set to ${JSON.stringify(allowDefaultProject)}, which does not match '${relativeFilePath}'.`,
+ ].join('\n'),
);
}
}
diff --git a/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts b/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts
index 48e62e1c39b6..3e0a30a52940 100644
--- a/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts
+++ b/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts
@@ -167,7 +167,7 @@ describe(useProgramFromProjectService, () => {
expect(service.reloadProjects).not.toHaveBeenCalled();
});
- it('throws an error after reloading projects when hasFullTypeInformation is enabled, the file is neither in the project service nor allowDefaultProject, and the last reload was recent', () => {
+ it('throws a non-file-specific error after reloading projects when hasFullTypeInformation is enabled, the file is neither in the project service nor an empty allowDefaultProject, and the last reload was recent', () => {
const { service } = createMockProjectService();
service.openClientFile.mockReturnValueOnce({}).mockReturnValueOnce({});
@@ -189,6 +189,40 @@ describe(useProgramFromProjectService, () => {
expect(service.reloadProjects).toHaveBeenCalledOnce();
});
+ it('throws a file-specific error after reloading projects when hasFullTypeInformation is enabled, the file is neither in the project service nor a populated allowDefaultProject, and the last reload was recent', () => {
+ const { service } = createMockProjectService();
+ const allowDefaultProject = ['a.js', 'b.js'];
+
+ service.openClientFile.mockReturnValueOnce({}).mockReturnValueOnce({});
+
+ expect(() =>
+ useProgramFromProjectService(
+ createProjectServiceSettings({
+ allowDefaultProject,
+ lastReloadTimestamp: 0,
+ service,
+ }),
+ {
+ ...mockParseSettings,
+ projectService: {
+ allowDefaultProject,
+ lastReloadTimestamp: 0,
+ maximumDefaultProjectFileMatchCount: 8,
+ service,
+ },
+ },
+ true,
+ new Set(),
+ ),
+ ).toThrow(
+ [
+ `${mockParseSettings.filePath} was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`,
+ `allowDefaultProject is set to ["a.js","b.js"], which does not match '${path.normalize('path/PascalCaseDirectory/camelCaseFile.ts')}'.`,
+ ].join('\n'),
+ );
+ expect(service.reloadProjects).toHaveBeenCalledOnce();
+ });
+
it('returns a created program after reloading projects when hasFullTypeInformation is enabled, the file is only in the project service after reload, and the last reload was recent', () => {
const { service } = createMockProjectService();
const program = { getSourceFile: vi.fn() };
diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md
index fb4091a5f528..1551ec7a7ab8 100644
--- a/packages/utils/CHANGELOG.md
+++ b/packages/utils/CHANGELOG.md
@@ -1,3 +1,15 @@
+## 8.46.0 (2025-10-06)
+
+### 🩹 Fixes
+
+- **rule-tester:** deprecate TestCaseError#type and LintMessage#nodeType ([#11628](https://github.com/typescript-eslint/typescript-eslint/pull/11628))
+
+### ❤️ Thank You
+
+- Mark de Dios @peanutenthusiast
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
## 8.45.0 (2025-09-29)
### 🚀 Features
diff --git a/packages/utils/package.json b/packages/utils/package.json
index 0b189d847863..21546d4601ed 100644
--- a/packages/utils/package.json
+++ b/packages/utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/utils",
- "version": "8.45.0",
+ "version": "8.46.0",
"description": "Utilities for working with TypeScript + ESLint together",
"files": [
"dist",
@@ -62,9 +62,9 @@
},
"dependencies": {
"@eslint-community/eslint-utils": "^4.7.0",
- "@typescript-eslint/scope-manager": "8.45.0",
- "@typescript-eslint/types": "8.45.0",
- "@typescript-eslint/typescript-estree": "8.45.0"
+ "@typescript-eslint/scope-manager": "8.46.0",
+ "@typescript-eslint/types": "8.46.0",
+ "@typescript-eslint/typescript-estree": "8.46.0"
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0",
diff --git a/packages/utils/src/eslint-utils/RuleCreator.ts b/packages/utils/src/eslint-utils/RuleCreator.ts
index 57ab282c3632..cd06aee6231f 100644
--- a/packages/utils/src/eslint-utils/RuleCreator.ts
+++ b/packages/utils/src/eslint-utils/RuleCreator.ts
@@ -36,7 +36,6 @@ export interface RuleWithMeta<
Docs = unknown,
> extends RuleCreateAndOptions {
meta: RuleMetaData;
- name: string;
}
export interface RuleWithMetaAndName<
@@ -77,7 +76,6 @@ export function RuleCreator(
url: urlCreator(name),
},
},
- name,
...rule,
});
};
@@ -91,7 +89,6 @@ function createRule<
create,
defaultOptions,
meta,
- name,
}: Readonly>): RuleModule<
MessageIds,
Options,
@@ -104,7 +101,6 @@ function createRule<
},
defaultOptions,
meta,
- name,
};
}
diff --git a/packages/utils/src/ts-eslint/Linter.ts b/packages/utils/src/ts-eslint/Linter.ts
index 499213d95f3b..7bbb2b316445 100644
--- a/packages/utils/src/ts-eslint/Linter.ts
+++ b/packages/utils/src/ts-eslint/Linter.ts
@@ -229,7 +229,10 @@ namespace Linter {
*/
message: string;
messageId?: string;
- nodeType: string;
+ /**
+ * @deprecated `nodeType` is deprecated and will be removed in the next major version.
+ */
+ nodeType?: string;
/**
* The ID of the rule which makes this message.
*/
diff --git a/packages/utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts
index be28d4a0b9ec..1a4920a3e79e 100644
--- a/packages/utils/src/ts-eslint/Rule.ts
+++ b/packages/utils/src/ts-eslint/Rule.ts
@@ -735,11 +735,6 @@ export interface RuleModule<
* Metadata about the rule
*/
meta: RuleMetaData;
-
- /**
- * Rule name
- */
- name: string;
}
export type AnyRuleModule = RuleModule;
diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md
index f04350762015..4ead0db9eaa4 100644
--- a/packages/visitor-keys/CHANGELOG.md
+++ b/packages/visitor-keys/CHANGELOG.md
@@ -1,3 +1,9 @@
+## 8.46.0 (2025-10-06)
+
+This was a version bump only for visitor-keys to align it with other projects, there were no code changes.
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
## 8.45.0 (2025-09-29)
This was a version bump only for visitor-keys to align it with other projects, there were no code changes.
diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json
index da60c60208f8..156e3591061e 100644
--- a/packages/visitor-keys/package.json
+++ b/packages/visitor-keys/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/visitor-keys",
- "version": "8.45.0",
+ "version": "8.46.0",
"description": "Visitor keys used to help traverse the TypeScript-ESTree AST",
"files": [
"dist",
@@ -45,7 +45,7 @@
"typecheck": "yarn run -BT nx typecheck"
},
"dependencies": {
- "@typescript-eslint/types": "8.45.0",
+ "@typescript-eslint/types": "8.46.0",
"eslint-visitor-keys": "^4.2.1"
},
"devDependencies": {
diff --git a/packages/website/docusaurus.config.mts b/packages/website/docusaurus.config.mts
index 3e6ff8e252f4..9a51ea074f54 100644
--- a/packages/website/docusaurus.config.mts
+++ b/packages/website/docusaurus.config.mts
@@ -368,32 +368,34 @@ const config: Config = {
organizationName: 'typescript-eslint',
plugins: [
'./plugins/recent-blog-posts/index.ts',
- ...['ast-spec', 'project-service', 'tsconfig-utils', 'type-utils'].map(
- packageName => [
- 'docusaurus-plugin-typedoc',
- {
- entryPoints: [`../${packageName}/src/index.ts`],
- enumMembersFormat: 'table',
- exclude: '**/*.d.ts',
- excludeExternals: true,
- groupOrder: ['Functions', 'Variables', '*'],
- hidePageTitle: true,
- id: `typedoc-generated-${packageName}`,
- indexFormat: 'table',
- out: `../../docs/packages/${packageName}/generated`,
- outputFileStrategy: 'modules',
- parametersFormat: 'table',
- plugin: [
- require.resolve('./tools/typedoc-plugin-no-inherit-fork.mjs'),
- ],
- propertiesFormat: 'table',
- readme: 'none',
- tsconfig: `../${packageName}/tsconfig.json`,
- typeDeclarationFormat: 'table',
- useCodeBlocks: true,
- },
- ],
- ),
+ ...[
+ 'ast-spec',
+ 'project-service',
+ 'rule-schema-to-typescript-types',
+ 'tsconfig-utils',
+ 'type-utils',
+ ].map(packageName => [
+ 'docusaurus-plugin-typedoc',
+ {
+ entryPoints: [`../${packageName}/src/index.ts`],
+ enumMembersFormat: 'table',
+ exclude: '**/*.d.ts',
+ excludeExternals: true,
+ groupOrder: ['Functions', 'Variables', '*'],
+ hidePageTitle: true,
+ id: `typedoc-generated-${packageName}`,
+ indexFormat: 'table',
+ out: `../../docs/packages/${packageName}/generated`,
+ outputFileStrategy: 'modules',
+ parametersFormat: 'table',
+ plugin: [require.resolve('./tools/typedoc-plugin-no-inherit-fork.mjs')],
+ propertiesFormat: 'table',
+ readme: 'none',
+ tsconfig: `../${packageName}/tsconfig.json`,
+ typeDeclarationFormat: 'table',
+ useCodeBlocks: true,
+ },
+ ]),
require.resolve('./webpack.plugin'),
['@docusaurus/plugin-content-docs', pluginContentDocsOptions],
['@docusaurus/plugin-pwa', pluginPwaOptions],
diff --git a/packages/website/plugins/generated-rule-docs/insertions/insertNewRuleReferences.ts b/packages/website/plugins/generated-rule-docs/insertions/insertNewRuleReferences.ts
index 89230d62a2fb..2154ca000f61 100644
--- a/packages/website/plugins/generated-rule-docs/insertions/insertNewRuleReferences.ts
+++ b/packages/website/plugins/generated-rule-docs/insertions/insertNewRuleReferences.ts
@@ -2,7 +2,7 @@ import type { ESLintPluginDocs } from '@typescript-eslint/eslint-plugin/use-at-y
import type * as mdast from 'mdast';
import type { MdxJsxFlowElement } from 'mdast-util-mdx';
-import { compile } from '@typescript-eslint/rule-schema-to-typescript-types';
+import { schemaToTypes } from '@typescript-eslint/rule-schema-to-typescript-types';
import { EOL } from 'node:os';
import * as path from 'node:path';
import prettier from 'prettier';
@@ -32,7 +32,7 @@ const PRETTIER_CONFIG_PATH = path.resolve(
'..',
'.prettierrc.json',
);
-const prettierConfig = (async () => {
+const lazyPrettierConfig = (async () => {
const filepath = path.join(__dirname, 'file.ts');
const config = await prettier.resolveConfig(filepath, {
config: PRETTIER_CONFIG_PATH,
@@ -149,6 +149,7 @@ export async function insertNewRuleReferences(
'This rule is not configurable.',
);
} else if (!COMPLICATED_RULE_OPTIONS.has(page.file.stem)) {
+ const prettierConfig = await lazyPrettierConfig;
page.spliceChildren(
page.headingIndices.options + 1,
0,
@@ -159,11 +160,11 @@ export async function insertNewRuleReferences(
lang: 'ts',
type: 'code',
value: [
- await compile(page.rule.meta.schema, prettierConfig),
await prettier.format(
- getRuleDefaultOptions(page),
- await prettierConfig,
+ schemaToTypes(page.rule.meta.schema),
+ prettierConfig,
),
+ await prettier.format(getRuleDefaultOptions(page), prettierConfig),
]
.join(EOL)
.trim(),
diff --git a/packages/website/sidebars/sidebar.base.js b/packages/website/sidebars/sidebar.base.js
index 689a5bb14202..a6d6e196d9e0 100644
--- a/packages/website/sidebars/sidebar.base.js
+++ b/packages/website/sidebars/sidebar.base.js
@@ -104,6 +104,7 @@ module.exports = {
'packages/eslint-plugin-tslint',
'packages/parser',
'packages/project-service',
+ 'packages/rule-schema-to-typescript-types',
'packages/rule-tester',
'packages/scope-manager',
'packages/tsconfig-utils',
diff --git a/packages/website/src/components/linter/createLinter.ts b/packages/website/src/components/linter/createLinter.ts
index eefd1b0e4287..c9c83aa2a34f 100644
--- a/packages/website/src/components/linter/createLinter.ts
+++ b/packages/website/src/components/linter/createLinter.ts
@@ -94,7 +94,6 @@ export function createLinter(
column: 1,
line: 1,
message: String(e instanceof Error ? e.stack : e),
- nodeType: '',
ruleId: '',
severity: 2,
source: 'eslint',
diff --git a/packages/website/tools/generate-website-dts.mts b/packages/website/tools/generate-website-dts.mts
index 92e3e40bb534..37744792cd1f 100644
--- a/packages/website/tools/generate-website-dts.mts
+++ b/packages/website/tools/generate-website-dts.mts
@@ -1,5 +1,5 @@
import fetch from 'cross-fetch';
-import { makeDirectory } from 'make-dir';
+import makeDirectory from 'make-dir';
import * as fs from 'node:fs/promises';
import * as path from 'node:path';
import { fileURLToPath } from 'node:url';
diff --git a/yarn.lock b/yarn.lock
index 4b4a6accc5c4..abe0aa56244e 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -227,6 +227,15 @@ __metadata:
languageName: node
linkType: hard
+"@arcanis/slice-ansi@npm:^1.1.1":
+ version: 1.1.1
+ resolution: "@arcanis/slice-ansi@npm:1.1.1"
+ dependencies:
+ grapheme-splitter: ^1.0.4
+ checksum: 14ed60cb45750d386c64229ac7bab20e10eedc193503fa4decff764162d329d6d3363ed2cd3debec833186ee54affe4f824f6e8eff531295117fd1ebda200270
+ languageName: node
+ linkType: hard
+
"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.16.0, @babel/code-frame@npm:^7.24.2, @babel/code-frame@npm:^7.27.1, @babel/code-frame@npm:^7.8.3":
version: 7.27.1
resolution: "@babel/code-frame@npm:7.27.1"
@@ -3698,14 +3707,16 @@ __metadata:
linkType: hard
"@eslint/compat@npm:^1.2.4":
- version: 1.3.2
- resolution: "@eslint/compat@npm:1.3.2"
+ version: 1.4.0
+ resolution: "@eslint/compat@npm:1.4.0"
+ dependencies:
+ "@eslint/core": ^0.16.0
peerDependencies:
eslint: ^8.40 || 9
peerDependenciesMeta:
eslint:
optional: true
- checksum: 64ef212d38c039b92d1210bbcc640bbc1d21335ff343ca3c6dcbd63d7e7fa734395ab476b7787dbc3466ff40c264db5b11322ac371b4a409f5850e053829010b
+ checksum: 090882a61e3c8fa1911ff796f9cf13ed645139760cdecb2444dcb6c75a0d2f2a379e62b1e83586a13ece2280ed8a3acea9cc125acb99bc68012575918ac8f26d
languageName: node
linkType: hard
@@ -3745,6 +3756,15 @@ __metadata:
languageName: node
linkType: hard
+"@eslint/core@npm:^0.16.0":
+ version: 0.16.0
+ resolution: "@eslint/core@npm:0.16.0"
+ dependencies:
+ "@types/json-schema": ^7.0.15
+ checksum: 5c08dbf08aa27a6e057003a05a29f483038b70e59f9ac7af26938d0fa4627383c95768e2154835260607de34975e8f407c10762af9a005ed348cd8039cc6aede
+ languageName: node
+ linkType: hard
+
"@eslint/eslintrc@npm:^3.2.0, @eslint/eslintrc@npm:^3.3.1":
version: 3.3.1
resolution: "@eslint/eslintrc@npm:3.3.1"
@@ -4878,7 +4898,7 @@ __metadata:
languageName: node
linkType: hard
-"@sindresorhus/is@npm:^4.6.0":
+"@sindresorhus/is@npm:^4.0.0, @sindresorhus/is@npm:^4.6.0":
version: 4.6.0
resolution: "@sindresorhus/is@npm:4.6.0"
checksum: 83839f13da2c29d55c97abc3bc2c55b250d33a0447554997a85c539e058e57b8da092da396e252b11ec24a0279a0bed1f537fa26302209327060643e327f81d2
@@ -5203,6 +5223,15 @@ __metadata:
languageName: node
linkType: hard
+"@szmarczak/http-timer@npm:^4.0.5":
+ version: 4.0.6
+ resolution: "@szmarczak/http-timer@npm:4.0.6"
+ dependencies:
+ defer-to-connect: ^2.0.0
+ checksum: c29df3bcec6fc3bdec2b17981d89d9c9fc9bd7d0c9bcfe92821dc533f4440bc890ccde79971838b4ceed1921d456973c4180d7175ee1d0023ad0562240a58d95
+ languageName: node
+ linkType: hard
+
"@szmarczak/http-timer@npm:^5.0.1":
version: 5.0.1
resolution: "@szmarczak/http-timer@npm:5.0.1"
@@ -5327,6 +5356,18 @@ __metadata:
languageName: node
linkType: hard
+"@types/cacheable-request@npm:^6.0.1":
+ version: 6.0.3
+ resolution: "@types/cacheable-request@npm:6.0.3"
+ dependencies:
+ "@types/http-cache-semantics": "*"
+ "@types/keyv": ^3.1.4
+ "@types/node": "*"
+ "@types/responselike": ^1.0.0
+ checksum: d9b26403fe65ce6b0cb3720b7030104c352bcb37e4fac2a7089a25a97de59c355fa08940658751f2f347a8512aa9d18fdb66ab3ade835975b2f454f2d5befbd9
+ languageName: node
+ linkType: hard
+
"@types/chai@npm:^5.2.2":
version: 5.2.2
resolution: "@types/chai@npm:5.2.2"
@@ -5371,6 +5412,13 @@ __metadata:
languageName: node
linkType: hard
+"@types/emscripten@npm:^1.39.6":
+ version: 1.41.2
+ resolution: "@types/emscripten@npm:1.41.2"
+ checksum: b0321eb7211f23801e886a7fbbd12e105b357eea5bb32ab13617d8cd04946a48a80b34ee7fe075344e76859753af2279969f7a322dda23bfd328bcfdf339a100
+ languageName: node
+ linkType: hard
+
"@types/eslint-plugin-jsx-a11y@npm:^6.10.0":
version: 6.10.0
resolution: "@types/eslint-plugin-jsx-a11y@npm:6.10.0"
@@ -5460,7 +5508,7 @@ __metadata:
languageName: node
linkType: hard
-"@types/http-cache-semantics@npm:^4.0.2":
+"@types/http-cache-semantics@npm:*, @types/http-cache-semantics@npm:^4.0.2":
version: 4.0.4
resolution: "@types/http-cache-semantics@npm:4.0.4"
checksum: 7f4dd832e618bc1e271be49717d7b4066d77c2d4eed5b81198eb987e532bb3e1c7e02f45d77918185bad936f884b700c10cebe06305f50400f382ab75055f9e8
@@ -5536,6 +5584,15 @@ __metadata:
languageName: node
linkType: hard
+"@types/keyv@npm:^3.1.4":
+ version: 3.1.4
+ resolution: "@types/keyv@npm:3.1.4"
+ dependencies:
+ "@types/node": "*"
+ checksum: e009a2bfb50e90ca9b7c6e8f648f8464067271fd99116f881073fa6fa76dc8d0133181dd65e6614d5fb1220d671d67b0124aef7d97dc02d7e342ab143a47779d
+ languageName: node
+ linkType: hard
+
"@types/lodash.merge@npm:4.6.9":
version: 4.6.9
resolution: "@types/lodash.merge@npm:4.6.9"
@@ -5693,6 +5750,15 @@ __metadata:
languageName: node
linkType: hard
+"@types/responselike@npm:^1.0.0":
+ version: 1.0.3
+ resolution: "@types/responselike@npm:1.0.3"
+ dependencies:
+ "@types/node": "*"
+ checksum: 6ac4b35723429b11b117e813c7acc42c3af8b5554caaf1fc750404c1ae59f9b7376bc69b9e9e194a5a97357a597c2228b7173d317320f0360d617b6425212f58
+ languageName: node
+ linkType: hard
+
"@types/retry@npm:^0.12.0":
version: 0.12.1
resolution: "@types/retry@npm:0.12.1"
@@ -5709,10 +5775,10 @@ __metadata:
languageName: node
linkType: hard
-"@types/semver@npm:^7.5.8":
- version: 7.7.0
- resolution: "@types/semver@npm:7.7.0"
- checksum: d488eaeddb23879a0a8a759bed667e1a76cb0dd4d23e3255538e24c189db387357953ca9e7a3bda2bb7f95e84cac8fe0db4fbe6b3456e893043337732d1d23cc
+"@types/semver@npm:^7.1.0, @types/semver@npm:^7.5.8":
+ version: 7.7.1
+ resolution: "@types/semver@npm:7.7.1"
+ checksum: 76d218e414482a398148d5c28f2bfa017108869f3fc18cda379c9d8d062348f8b9653ae2fa8642d3b5b52e211928fe8be34f22da4e1f08245c84e0e51e040673
languageName: node
linkType: hard
@@ -5744,6 +5810,13 @@ __metadata:
languageName: node
linkType: hard
+"@types/treeify@npm:^1.0.0":
+ version: 1.0.3
+ resolution: "@types/treeify@npm:1.0.3"
+ checksum: 777e579b30a916a781e7cbad2b7a76bc5473ff7bfe7167dd6de47f80f4386df5bf3d0dc34170afb75d52e75f6ed61cc109abf2324e093c1f9ecd4e79fec58d0c
+ languageName: node
+ linkType: hard
+
"@types/trusted-types@npm:^1.0.6":
version: 1.0.6
resolution: "@types/trusted-types@npm:1.0.6"
@@ -5837,19 +5910,19 @@ __metadata:
languageName: unknown
linkType: soft
-"@typescript-eslint/eslint-plugin@8.45.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin":
+"@typescript-eslint/eslint-plugin@8.46.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin":
version: 0.0.0-use.local
resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin"
dependencies:
"@eslint-community/regexpp": ^4.10.0
"@types/mdast": ^4.0.3
"@types/natural-compare": "*"
- "@typescript-eslint/rule-schema-to-typescript-types": 8.45.0
- "@typescript-eslint/rule-tester": 8.45.0
- "@typescript-eslint/scope-manager": 8.45.0
- "@typescript-eslint/type-utils": 8.45.0
- "@typescript-eslint/utils": 8.45.0
- "@typescript-eslint/visitor-keys": 8.45.0
+ "@typescript-eslint/rule-schema-to-typescript-types": 8.46.0
+ "@typescript-eslint/rule-tester": 8.46.0
+ "@typescript-eslint/scope-manager": 8.46.0
+ "@typescript-eslint/type-utils": 8.46.0
+ "@typescript-eslint/utils": 8.46.0
+ "@typescript-eslint/visitor-keys": 8.46.0
"@vitest/coverage-v8": ^3.1.3
ajv: ^6.12.6
cross-fetch: "*"
@@ -5872,7 +5945,7 @@ __metadata:
unist-util-visit: ^5.0.0
vitest: ^3.1.3
peerDependencies:
- "@typescript-eslint/parser": ^8.45.0
+ "@typescript-eslint/parser": ^8.46.0
eslint: ^8.57.0 || ^9.0.0
typescript: ">=4.8.4 <6.0.0"
languageName: unknown
@@ -5888,14 +5961,14 @@ __metadata:
languageName: unknown
linkType: soft
-"@typescript-eslint/parser@8.45.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser":
+"@typescript-eslint/parser@8.46.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser":
version: 0.0.0-use.local
resolution: "@typescript-eslint/parser@workspace:packages/parser"
dependencies:
- "@typescript-eslint/scope-manager": 8.45.0
- "@typescript-eslint/types": 8.45.0
- "@typescript-eslint/typescript-estree": 8.45.0
- "@typescript-eslint/visitor-keys": 8.45.0
+ "@typescript-eslint/scope-manager": 8.46.0
+ "@typescript-eslint/types": 8.46.0
+ "@typescript-eslint/typescript-estree": 8.46.0
+ "@typescript-eslint/visitor-keys": 8.46.0
"@vitest/coverage-v8": ^3.1.3
debug: ^4.3.4
eslint: "*"
@@ -5909,12 +5982,12 @@ __metadata:
languageName: unknown
linkType: soft
-"@typescript-eslint/project-service@8.45.0, @typescript-eslint/project-service@workspace:packages/project-service":
+"@typescript-eslint/project-service@8.46.0, @typescript-eslint/project-service@workspace:packages/project-service":
version: 0.0.0-use.local
resolution: "@typescript-eslint/project-service@workspace:packages/project-service"
dependencies:
- "@typescript-eslint/tsconfig-utils": ^8.45.0
- "@typescript-eslint/types": ^8.45.0
+ "@typescript-eslint/tsconfig-utils": ^8.46.0
+ "@typescript-eslint/types": ^8.46.0
"@vitest/coverage-v8": ^3.1.3
debug: ^4.3.4
rimraf: "*"
@@ -5925,31 +5998,30 @@ __metadata:
languageName: unknown
linkType: soft
-"@typescript-eslint/rule-schema-to-typescript-types@8.45.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types":
+"@typescript-eslint/rule-schema-to-typescript-types@8.46.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types":
version: 0.0.0-use.local
resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types"
dependencies:
- "@typescript-eslint/type-utils": 8.45.0
- "@typescript-eslint/utils": 8.45.0
+ "@typescript-eslint/type-utils": 8.46.0
+ "@typescript-eslint/utils": 8.46.0
"@vitest/coverage-v8": ^3.1.3
eslint: "*"
natural-compare: ^1.4.0
- prettier: 3.6.2
rimraf: "*"
typescript: "*"
vitest: ^3.1.3
languageName: unknown
linkType: soft
-"@typescript-eslint/rule-tester@8.45.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester":
+"@typescript-eslint/rule-tester@8.46.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester":
version: 0.0.0-use.local
resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester"
dependencies:
"@types/json-stable-stringify-without-jsonify": ^1.0.2
"@types/lodash.merge": 4.6.9
- "@typescript-eslint/parser": 8.45.0
- "@typescript-eslint/typescript-estree": 8.45.0
- "@typescript-eslint/utils": 8.45.0
+ "@typescript-eslint/parser": 8.46.0
+ "@typescript-eslint/typescript-estree": 8.46.0
+ "@typescript-eslint/utils": 8.46.0
"@vitest/coverage-v8": ^3.1.3
ajv: ^6.12.6
eslint: "*"
@@ -5964,13 +6036,13 @@ __metadata:
languageName: unknown
linkType: soft
-"@typescript-eslint/scope-manager@8.45.0, @typescript-eslint/scope-manager@^8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager":
+"@typescript-eslint/scope-manager@8.46.0, @typescript-eslint/scope-manager@^8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager":
version: 0.0.0-use.local
resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager"
dependencies:
- "@typescript-eslint/types": 8.45.0
- "@typescript-eslint/typescript-estree": 8.45.0
- "@typescript-eslint/visitor-keys": 8.45.0
+ "@typescript-eslint/types": 8.46.0
+ "@typescript-eslint/typescript-estree": 8.46.0
+ "@typescript-eslint/visitor-keys": 8.46.0
"@vitest/coverage-v8": ^3.1.3
"@vitest/pretty-format": ^3.1.3
eslint: "*"
@@ -5981,7 +6053,7 @@ __metadata:
languageName: unknown
linkType: soft
-"@typescript-eslint/tsconfig-utils@8.45.0, @typescript-eslint/tsconfig-utils@^8.45.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils":
+"@typescript-eslint/tsconfig-utils@8.46.0, @typescript-eslint/tsconfig-utils@^8.46.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils":
version: 0.0.0-use.local
resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils"
dependencies:
@@ -5994,14 +6066,14 @@ __metadata:
languageName: unknown
linkType: soft
-"@typescript-eslint/type-utils@8.45.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils":
+"@typescript-eslint/type-utils@8.46.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils":
version: 0.0.0-use.local
resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils"
dependencies:
- "@typescript-eslint/parser": 8.45.0
- "@typescript-eslint/types": 8.45.0
- "@typescript-eslint/typescript-estree": 8.45.0
- "@typescript-eslint/utils": 8.45.0
+ "@typescript-eslint/parser": 8.46.0
+ "@typescript-eslint/types": 8.46.0
+ "@typescript-eslint/typescript-estree": 8.46.0
+ "@typescript-eslint/utils": 8.46.0
"@vitest/coverage-v8": ^3.1.3
ajv: ^6.12.6
debug: ^4.3.4
@@ -6016,7 +6088,7 @@ __metadata:
languageName: unknown
linkType: soft
-"@typescript-eslint/types@8.45.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.45.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types":
+"@typescript-eslint/types@8.46.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.46.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types":
version: 0.0.0-use.local
resolution: "@typescript-eslint/types@workspace:packages/types"
dependencies:
@@ -6086,18 +6158,19 @@ __metadata:
vite: ^6.3.5
vitest: ^3.1.3
yargs: 17.7.2
+ yarn-berry-deduplicate: ^6.1.3
languageName: unknown
linkType: soft
-"@typescript-eslint/typescript-estree@8.45.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree":
+"@typescript-eslint/typescript-estree@8.46.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree":
version: 0.0.0-use.local
resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree"
dependencies:
"@types/is-glob": ^4.0.4
- "@typescript-eslint/project-service": 8.45.0
- "@typescript-eslint/tsconfig-utils": 8.45.0
- "@typescript-eslint/types": 8.45.0
- "@typescript-eslint/visitor-keys": 8.45.0
+ "@typescript-eslint/project-service": 8.46.0
+ "@typescript-eslint/tsconfig-utils": 8.46.0
+ "@typescript-eslint/types": 8.46.0
+ "@typescript-eslint/visitor-keys": 8.46.0
"@vitest/coverage-v8": ^3.1.3
debug: ^4.3.4
eslint: "*"
@@ -6115,14 +6188,14 @@ __metadata:
languageName: unknown
linkType: soft
-"@typescript-eslint/utils@8.45.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils":
+"@typescript-eslint/utils@8.46.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils":
version: 0.0.0-use.local
resolution: "@typescript-eslint/utils@workspace:packages/utils"
dependencies:
"@eslint-community/eslint-utils": ^4.7.0
- "@typescript-eslint/scope-manager": 8.45.0
- "@typescript-eslint/types": 8.45.0
- "@typescript-eslint/typescript-estree": 8.45.0
+ "@typescript-eslint/scope-manager": 8.46.0
+ "@typescript-eslint/types": 8.46.0
+ "@typescript-eslint/typescript-estree": 8.46.0
"@vitest/coverage-v8": ^3.1.3
eslint: "*"
rimraf: "*"
@@ -6134,11 +6207,11 @@ __metadata:
languageName: unknown
linkType: soft
-"@typescript-eslint/visitor-keys@8.45.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys":
+"@typescript-eslint/visitor-keys@8.46.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys":
version: 0.0.0-use.local
resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys"
dependencies:
- "@typescript-eslint/types": 8.45.0
+ "@typescript-eslint/types": 8.46.0
"@vitest/coverage-v8": ^3.1.3
eslint: "*"
eslint-visitor-keys: ^4.2.1
@@ -6480,6 +6553,62 @@ __metadata:
languageName: node
linkType: hard
+"@yarnpkg/core@npm:^4.4.1":
+ version: 4.4.4
+ resolution: "@yarnpkg/core@npm:4.4.4"
+ dependencies:
+ "@arcanis/slice-ansi": ^1.1.1
+ "@types/semver": ^7.1.0
+ "@types/treeify": ^1.0.0
+ "@yarnpkg/fslib": ^3.1.3
+ "@yarnpkg/libzip": ^3.2.2
+ "@yarnpkg/parsers": ^3.0.3
+ "@yarnpkg/shell": ^4.1.3
+ camelcase: ^5.3.1
+ chalk: ^4.1.2
+ ci-info: ^4.0.0
+ clipanion: ^4.0.0-rc.2
+ cross-spawn: ^7.0.3
+ diff: ^5.1.0
+ dotenv: ^16.3.1
+ es-toolkit: ^1.39.7
+ fast-glob: ^3.2.2
+ got: ^11.7.0
+ hpagent: ^1.2.0
+ micromatch: ^4.0.2
+ p-limit: ^2.2.0
+ semver: ^7.1.2
+ strip-ansi: ^6.0.0
+ tar: ^6.0.5
+ tinylogic: ^2.0.0
+ treeify: ^1.1.0
+ tslib: ^2.4.0
+ checksum: 0ed1c0fa9cb590de700b26c50ee021af19a29c7b4d04a0d121864ca1a47ce09280c56619eb947a28454731a0d7eec4ab08b7dda6eba68782f12a5e88e05bebc6
+ languageName: node
+ linkType: hard
+
+"@yarnpkg/fslib@npm:^3.1.2, @yarnpkg/fslib@npm:^3.1.3":
+ version: 3.1.3
+ resolution: "@yarnpkg/fslib@npm:3.1.3"
+ dependencies:
+ tslib: ^2.4.0
+ checksum: 8d9bc2f40bf49d2bec1e0218b142a5504e5bbe1dec6b36000f58c0b0a048c8b00785370a19f0563d8a50d9c7ca6b09df6e7c68900d35ebb127734d65faa31618
+ languageName: node
+ linkType: hard
+
+"@yarnpkg/libzip@npm:^3.2.2":
+ version: 3.2.2
+ resolution: "@yarnpkg/libzip@npm:3.2.2"
+ dependencies:
+ "@types/emscripten": ^1.39.6
+ "@yarnpkg/fslib": ^3.1.3
+ tslib: ^2.4.0
+ peerDependencies:
+ "@yarnpkg/fslib": ^3.1.3
+ checksum: 68736d731ef18f54720ed0b26e24dd0a69adcf26ef5d1f1a2e7ac89c096e2fc50373ff7467158b3a3b3cc7579bbb8ab7e72ee79f2c9044bda0dac52fbf40819b
+ languageName: node
+ linkType: hard
+
"@yarnpkg/lockfile@npm:^1.1.0":
version: 1.1.0
resolution: "@yarnpkg/lockfile@npm:1.1.0"
@@ -6497,6 +6626,34 @@ __metadata:
languageName: node
linkType: hard
+"@yarnpkg/parsers@npm:^3.0.3":
+ version: 3.0.3
+ resolution: "@yarnpkg/parsers@npm:3.0.3"
+ dependencies:
+ js-yaml: ^3.10.0
+ tslib: ^2.4.0
+ checksum: d6f78ec15b36732a88aeb090d012756d03a855a301a29f0f4f725ac05186f2d2e26400ea5636016481bdca7d4a013f70d61141bc1add2048cf1c2e5132b9ecf8
+ languageName: node
+ linkType: hard
+
+"@yarnpkg/shell@npm:^4.1.3":
+ version: 4.1.3
+ resolution: "@yarnpkg/shell@npm:4.1.3"
+ dependencies:
+ "@yarnpkg/fslib": ^3.1.2
+ "@yarnpkg/parsers": ^3.0.3
+ chalk: ^4.1.2
+ clipanion: ^4.0.0-rc.2
+ cross-spawn: ^7.0.3
+ fast-glob: ^3.2.2
+ micromatch: ^4.0.2
+ tslib: ^2.4.0
+ bin:
+ shell: ./lib/cli.js
+ checksum: bb5a122b157d6a1652331542b26d07f63b1f796f264708b0126b3c5a87877150927e8e838bcf631f80469799c4b331b02c62b7ecb19325276590e28e2fe45557
+ languageName: node
+ linkType: hard
+
"@zkochan/js-yaml@npm:0.0.7":
version: 0.0.7
resolution: "@zkochan/js-yaml@npm:0.0.7"
@@ -7463,6 +7620,13 @@ __metadata:
languageName: node
linkType: hard
+"cacheable-lookup@npm:^5.0.3":
+ version: 5.0.4
+ resolution: "cacheable-lookup@npm:5.0.4"
+ checksum: 763e02cf9196bc9afccacd8c418d942fc2677f22261969a4c2c2e760fa44a2351a81557bd908291c3921fe9beb10b976ba8fa50c5ca837c5a0dd945f16468f2d
+ languageName: node
+ linkType: hard
+
"cacheable-lookup@npm:^7.0.0":
version: 7.0.0
resolution: "cacheable-lookup@npm:7.0.0"
@@ -7485,6 +7649,21 @@ __metadata:
languageName: node
linkType: hard
+"cacheable-request@npm:^7.0.2":
+ version: 7.0.4
+ resolution: "cacheable-request@npm:7.0.4"
+ dependencies:
+ clone-response: ^1.0.2
+ get-stream: ^5.1.0
+ http-cache-semantics: ^4.0.0
+ keyv: ^4.0.0
+ lowercase-keys: ^2.0.0
+ normalize-url: ^6.0.1
+ responselike: ^2.0.0
+ checksum: 0de9df773fd4e7dd9bd118959878f8f2163867e2e1ab3575ffbecbe6e75e80513dd0c68ba30005e5e5a7b377cc6162bbc00ab1db019bb4e9cb3c2f3f7a6f1ee4
+ languageName: node
+ linkType: hard
+
"cacheable@npm:^1.10.4":
version: 1.10.4
resolution: "cacheable@npm:1.10.4"
@@ -7544,6 +7723,13 @@ __metadata:
languageName: node
linkType: hard
+"camelcase@npm:^5.3.1":
+ version: 5.3.1
+ resolution: "camelcase@npm:5.3.1"
+ checksum: e6effce26b9404e3c0f301498184f243811c30dfe6d0b9051863bd8e4034d09c8c2923794f280d6827e5aa055f6c434115ff97864a16a963366fb35fd673024b
+ languageName: node
+ linkType: hard
+
"camelcase@npm:^6.2.0":
version: 6.3.0
resolution: "camelcase@npm:6.3.0"
@@ -7734,10 +7920,10 @@ __metadata:
languageName: node
linkType: hard
-"ci-info@npm:^4.2.0":
- version: 4.2.0
- resolution: "ci-info@npm:4.2.0"
- checksum: 0e3726721526f54c5b17cf44ab2ed69b842c756bcb4d2b26ce279e595a80a856aec9fb38a2986a2baca3de73d15895f3a01d2771c4aad93c898aae7e3ca0ceb1
+"ci-info@npm:^4.0.0, ci-info@npm:^4.2.0":
+ version: 4.3.0
+ resolution: "ci-info@npm:4.3.0"
+ checksum: 77a851ec826e1fbcd993e0e3ef402e6a5e499c733c475af056b7808dea9c9ede53e560ed433020489a8efea2d824fd68ca203446c9988a0bac8475210b0d4491
languageName: node
linkType: hard
@@ -7801,20 +7987,13 @@ __metadata:
languageName: node
linkType: hard
-"cli-spinners@npm:2.6.1":
+"cli-spinners@npm:2.6.1, cli-spinners@npm:^2.5.0":
version: 2.6.1
resolution: "cli-spinners@npm:2.6.1"
checksum: 423409baaa7a58e5104b46ca1745fbfc5888bbd0b0c5a626e052ae1387060839c8efd512fb127e25769b3dc9562db1dc1b5add6e0b93b7ef64f477feb6416a45
languageName: node
linkType: hard
-"cli-spinners@npm:^2.5.0":
- version: 2.7.0
- resolution: "cli-spinners@npm:2.7.0"
- checksum: a9afaf73f58d1f951fb23742f503631b3cf513f43f4c7acb1b640100eb76bfa16efbcd1994d149ffc6603a6d75dd3d4a516a76f125f90dce437de9b16fd0ee6f
- languageName: node
- linkType: hard
-
"cli-table3@npm:^0.6.3":
version: 0.6.3
resolution: "cli-table3@npm:0.6.3"
@@ -7838,6 +8017,17 @@ __metadata:
languageName: node
linkType: hard
+"clipanion@npm:^4.0.0-rc.2":
+ version: 4.0.0-rc.4
+ resolution: "clipanion@npm:4.0.0-rc.4"
+ dependencies:
+ typanion: ^3.8.0
+ peerDependencies:
+ typanion: "*"
+ checksum: a92aa03b24eb89292b7bda570973c164fff16a1c5ba4c4abdd1b0dd6110a57651752114ec9f5cfc29e2040213e514b3220142a2316c4fc4e659ba423caa296c7
+ languageName: node
+ linkType: hard
+
"cliui@npm:^8.0.1":
version: 8.0.1
resolution: "cliui@npm:8.0.1"
@@ -7860,6 +8050,15 @@ __metadata:
languageName: node
linkType: hard
+"clone-response@npm:^1.0.2":
+ version: 1.0.3
+ resolution: "clone-response@npm:1.0.3"
+ dependencies:
+ mimic-response: ^1.0.0
+ checksum: 4e671cac39b11c60aa8ba0a450657194a5d6504df51bca3fac5b3bd0145c4f8e8464898f87c8406b83232e3bc5cca555f51c1f9c8ac023969ebfbf7f6bdabb2e
+ languageName: node
+ linkType: hard
+
"clone@npm:^1.0.2":
version: 1.0.4
resolution: "clone@npm:1.0.4"
@@ -8002,6 +8201,13 @@ __metadata:
languageName: node
linkType: hard
+"commander@npm:^9.4.1":
+ version: 9.5.0
+ resolution: "commander@npm:9.5.0"
+ checksum: c7a3e27aa59e913b54a1bafd366b88650bc41d6651f0cbe258d4ff09d43d6a7394232a4dadd0bf518b3e696fdf595db1028a0d82c785b88bd61f8a440cecfade
+ languageName: node
+ linkType: hard
+
"comment-json@npm:^4.2.5":
version: 4.2.5
resolution: "comment-json@npm:4.2.5"
@@ -8890,7 +9096,7 @@ __metadata:
languageName: node
linkType: hard
-"defer-to-connect@npm:^2.0.1":
+"defer-to-connect@npm:^2.0.0, defer-to-connect@npm:^2.0.1":
version: 2.0.1
resolution: "defer-to-connect@npm:2.0.1"
checksum: 8a9b50d2f25446c0bfefb55a48e90afd58f85b21bcf78e9207cd7b804354f6409032a1705c2491686e202e64fc05f147aa5aa45f9aa82627563f045937f5791b
@@ -9026,6 +9232,13 @@ __metadata:
languageName: node
linkType: hard
+"diff@npm:^5.1.0":
+ version: 5.2.0
+ resolution: "diff@npm:5.2.0"
+ checksum: 12b63ca9c36c72bafa3effa77121f0581b4015df18bc16bac1f8e263597735649f1a173c26f7eba17fb4162b073fee61788abe49610e6c70a2641fe1895443fd
+ languageName: node
+ linkType: hard
+
"dir-glob@npm:^3.0.1":
version: 3.0.1
resolution: "dir-glob@npm:3.0.1"
@@ -9177,7 +9390,7 @@ __metadata:
languageName: node
linkType: hard
-"dotenv@npm:^16.4.4, dotenv@npm:~16.4.5":
+"dotenv@npm:^16.3.1, dotenv@npm:^16.4.4, dotenv@npm:~16.4.5":
version: 16.4.5
resolution: "dotenv@npm:16.4.5"
checksum: 301a12c3d44fd49888b74eb9ccf9f07a1f5df43f489e7fcb89647a2edcd84c42d6bc349dc8df099cd18f07c35c7b04685c1a4f3e6a6a9e6b30f8d48c15b7f49c
@@ -9299,12 +9512,12 @@ __metadata:
languageName: node
linkType: hard
-"end-of-stream@npm:^1.4.1":
- version: 1.4.4
- resolution: "end-of-stream@npm:1.4.4"
+"end-of-stream@npm:^1.1.0, end-of-stream@npm:^1.4.1":
+ version: 1.4.5
+ resolution: "end-of-stream@npm:1.4.5"
dependencies:
once: ^1.4.0
- checksum: 530a5a5a1e517e962854a31693dbb5c0b2fc40b46dad2a56a2deec656ca040631124f4795823acc68238147805f8b021abbe221f4afed5ef3c8e8efc2024908b
+ checksum: 1e0cfa6e7f49887544e03314f9dfc56a8cb6dde910cbb445983ecc2ff426fc05946df9d75d8a21a3a64f2cecfe1bf88f773952029f46756b2ed64a24e95b1fb8
languageName: node
linkType: hard
@@ -9526,6 +9739,18 @@ __metadata:
languageName: node
linkType: hard
+"es-toolkit@npm:^1.39.7":
+ version: 1.39.10
+ resolution: "es-toolkit@npm:1.39.10"
+ dependenciesMeta:
+ "@trivago/prettier-plugin-sort-imports@4.3.0":
+ unplugged: true
+ prettier-plugin-sort-re-exports@0.0.1:
+ unplugged: true
+ checksum: 128d018238487ac58da9447c629943178498a4378737aaca3acc6b1948c0b45eb3d5f5a5c0487247b6b7b3d89b44dfd2977f531512dff7c31ec6b12485c9230d
+ languageName: node
+ linkType: hard
+
"esbuild@npm:^0.25.0, esbuild@npm:~0.25.0":
version: 0.25.5
resolution: "esbuild@npm:0.25.5"
@@ -10342,7 +10567,7 @@ __metadata:
languageName: node
linkType: hard
-"fast-glob@npm:^3.2.11, fast-glob@npm:^3.2.9, fast-glob@npm:^3.3.2, fast-glob@npm:^3.3.3":
+"fast-glob@npm:^3.2.11, fast-glob@npm:^3.2.2, fast-glob@npm:^3.2.9, fast-glob@npm:^3.3.2, fast-glob@npm:^3.3.3":
version: 3.3.3
resolution: "fast-glob@npm:3.3.3"
dependencies:
@@ -10412,7 +10637,7 @@ __metadata:
languageName: node
linkType: hard
-"fdir@npm:^6.4.4, fdir@npm:^6.5.0":
+"fdir@npm:^6.4.4":
version: 6.5.0
resolution: "fdir@npm:6.5.0"
peerDependencies:
@@ -10909,6 +11134,15 @@ __metadata:
languageName: node
linkType: hard
+"get-stream@npm:^5.1.0":
+ version: 5.2.0
+ resolution: "get-stream@npm:5.2.0"
+ dependencies:
+ pump: ^3.0.0
+ checksum: 8bc1a23174a06b2b4ce600df38d6c98d2ef6d84e020c1ddad632ad75bac4e092eeb40e4c09e0761c35fc2dbc5e7fff5dab5e763a383582c4a167dd69a905bd12
+ languageName: node
+ linkType: hard
+
"get-stream@npm:^6.0.0, get-stream@npm:^6.0.1":
version: 6.0.1
resolution: "get-stream@npm:6.0.1"
@@ -10975,7 +11209,7 @@ __metadata:
languageName: node
linkType: hard
-"glob@npm:*, glob@npm:^11.0.0, glob@npm:~11.0.2":
+"glob@npm:*, glob@npm:~11.0.2":
version: 11.0.3
resolution: "glob@npm:11.0.3"
dependencies:
@@ -11143,6 +11377,25 @@ __metadata:
languageName: node
linkType: hard
+"got@npm:^11.7.0":
+ version: 11.8.6
+ resolution: "got@npm:11.8.6"
+ dependencies:
+ "@sindresorhus/is": ^4.0.0
+ "@szmarczak/http-timer": ^4.0.5
+ "@types/cacheable-request": ^6.0.1
+ "@types/responselike": ^1.0.0
+ cacheable-lookup: ^5.0.3
+ cacheable-request: ^7.0.2
+ decompress-response: ^6.0.0
+ http2-wrapper: ^1.0.0-beta.5.2
+ lowercase-keys: ^2.0.0
+ p-cancelable: ^2.0.0
+ responselike: ^2.0.0
+ checksum: bbc783578a8d5030c8164ef7f57ce41b5ad7db2ed13371e1944bef157eeca5a7475530e07c0aaa71610d7085474d0d96222c9f4268d41db333a17e39b463f45d
+ languageName: node
+ linkType: hard
+
"got@npm:^12.1.0":
version: 12.6.1
resolution: "got@npm:12.6.1"
@@ -11176,6 +11429,13 @@ __metadata:
languageName: node
linkType: hard
+"grapheme-splitter@npm:^1.0.4":
+ version: 1.0.4
+ resolution: "grapheme-splitter@npm:1.0.4"
+ checksum: 0c22ec54dee1b05cd480f78cf14f732cb5b108edc073572c4ec205df4cd63f30f8db8025afc5debc8835a8ddeacf648a1c7992fe3dcd6ad38f9a476d84906620
+ languageName: node
+ linkType: hard
+
"graphemer@npm:^1.4.0":
version: 1.4.0
resolution: "graphemer@npm:1.4.0"
@@ -11479,6 +11739,13 @@ __metadata:
languageName: node
linkType: hard
+"hpagent@npm:^1.2.0":
+ version: 1.2.0
+ resolution: "hpagent@npm:1.2.0"
+ checksum: b029da695edae438cee4da2a437386f9db4ac27b3ceb7306d02e1b586c9c194741ed2e943c8a222e0cfefaf27ee3f863aca7ba1721b0950a2a19bf25bc0d85e2
+ languageName: node
+ linkType: hard
+
"html-entities@npm:^2.3.2":
version: 2.3.2
resolution: "html-entities@npm:2.3.2"
@@ -11593,10 +11860,10 @@ __metadata:
languageName: node
linkType: hard
-"http-cache-semantics@npm:^4.1.1":
- version: 4.1.1
- resolution: "http-cache-semantics@npm:4.1.1"
- checksum: 83ac0bc60b17a3a36f9953e7be55e5c8f41acc61b22583060e8dedc9dd5e3607c823a88d0926f9150e571f90946835c7fe150732801010845c72cd8bbff1a236
+"http-cache-semantics@npm:^4.0.0, http-cache-semantics@npm:^4.1.1":
+ version: 4.2.0
+ resolution: "http-cache-semantics@npm:4.2.0"
+ checksum: 7a7246ddfce629f96832791176fd643589d954e6f3b49548dadb4290451961237fab8fcea41cd2008fe819d95b41c1e8b97f47d088afc0a1c81705287b4ddbcc
languageName: node
linkType: hard
@@ -11679,6 +11946,16 @@ __metadata:
languageName: node
linkType: hard
+"http2-wrapper@npm:^1.0.0-beta.5.2":
+ version: 1.0.3
+ resolution: "http2-wrapper@npm:1.0.3"
+ dependencies:
+ quick-lru: ^5.1.1
+ resolve-alpn: ^1.0.0
+ checksum: 74160b862ec699e3f859739101ff592d52ce1cb207b7950295bf7962e4aa1597ef709b4292c673bece9c9b300efad0559fc86c71b1409c7a1e02b7229456003e
+ languageName: node
+ linkType: hard
+
"http2-wrapper@npm:^2.1.10":
version: 2.2.1
resolution: "http2-wrapper@npm:2.2.1"
@@ -12867,7 +13144,7 @@ __metadata:
languageName: node
linkType: hard
-"keyv@npm:^4.5.3, keyv@npm:^4.5.4":
+"keyv@npm:^4.0.0, keyv@npm:^4.5.3, keyv@npm:^4.5.4":
version: 4.5.4
resolution: "keyv@npm:4.5.4"
dependencies:
@@ -13224,6 +13501,13 @@ __metadata:
languageName: node
linkType: hard
+"lowercase-keys@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "lowercase-keys@npm:2.0.0"
+ checksum: 24d7ebd56ccdf15ff529ca9e08863f3c54b0b9d1edb97a3ae1af34940ae666c01a1e6d200707bce730a8ef76cb57cc10e65f245ecaaf7e6bc8639f2fb460ac23
+ languageName: node
+ linkType: hard
+
"lowercase-keys@npm:^3.0.0":
version: 3.0.0
resolution: "lowercase-keys@npm:3.0.0"
@@ -13315,14 +13599,7 @@ __metadata:
languageName: node
linkType: hard
-"make-dir@npm:*":
- version: 5.1.0
- resolution: "make-dir@npm:5.1.0"
- checksum: 372abd9cbb2029bead4efe6c369c9af8ae77773d9a31ed5378fd7ae8072f06ea272aec5c7aba7543d3b8578a45b0bf90d86a78ab311afa4bc3446000977095a9
- languageName: node
- linkType: hard
-
-"make-dir@npm:^4.0.0":
+"make-dir@npm:*, make-dir@npm:^4.0.0":
version: 4.0.0
resolution: "make-dir@npm:4.0.0"
dependencies:
@@ -14330,20 +14607,13 @@ __metadata:
languageName: node
linkType: hard
-"mime-db@npm:1.52.0":
+"mime-db@npm:1.52.0, mime-db@npm:>= 1.43.0 < 2":
version: 1.52.0
resolution: "mime-db@npm:1.52.0"
checksum: 0d99a03585f8b39d68182803b12ac601d9c01abfa28ec56204fa330bc9f3d1c5e14beb049bafadb3dbdf646dfb94b87e24d4ec7b31b7279ef906a8ea9b6a513f
languageName: node
linkType: hard
-"mime-db@npm:>= 1.43.0 < 2":
- version: 1.54.0
- resolution: "mime-db@npm:1.54.0"
- checksum: e99aaf2f23f5bd607deb08c83faba5dd25cf2fec90a7cc5b92d8260867ee08dab65312e1a589e60093dc7796d41e5fae013268418482f1db4c7d52d0a0960ac9
- languageName: node
- linkType: hard
-
"mime-db@npm:~1.33.0":
version: 1.33.0
resolution: "mime-db@npm:1.33.0"
@@ -14399,6 +14669,13 @@ __metadata:
languageName: node
linkType: hard
+"mimic-response@npm:^1.0.0":
+ version: 1.0.1
+ resolution: "mimic-response@npm:1.0.1"
+ checksum: 034c78753b0e622bc03c983663b1cdf66d03861050e0c8606563d149bc2b02d63f62ce4d32be4ab50d0553ae0ffe647fc34d1f5281184c6e1e8cf4d85e8d9823
+ languageName: node
+ linkType: hard
+
"mimic-response@npm:^3.1.0":
version: 3.1.0
resolution: "mimic-response@npm:3.1.0"
@@ -14439,7 +14716,7 @@ __metadata:
languageName: node
linkType: hard
-"minimatch@npm:3.0.4":
+"minimatch@npm:3.0.4, minimatch@npm:~3.0.3":
version: 3.0.4
resolution: "minimatch@npm:3.0.4"
dependencies:
@@ -14502,15 +14779,6 @@ __metadata:
languageName: node
linkType: hard
-"minimatch@npm:~3.0.3":
- version: 3.0.8
- resolution: "minimatch@npm:3.0.8"
- dependencies:
- brace-expansion: ^1.1.7
- checksum: 850cca179cad715133132693e6963b0db64ab0988c4d211415b087fc23a3e46321e2c5376a01bf5623d8782aba8bdf43c571e2e902e51fdce7175c7215c29f8b
- languageName: node
- linkType: hard
-
"minimist@npm:^1.2.0, minimist@npm:^1.2.6, minimist@npm:^1.2.8":
version: 1.2.8
resolution: "minimist@npm:1.2.8"
@@ -14809,6 +15077,13 @@ __metadata:
languageName: node
linkType: hard
+"normalize-url@npm:^6.0.1":
+ version: 6.1.0
+ resolution: "normalize-url@npm:6.1.0"
+ checksum: 4a4944631173e7d521d6b80e4c85ccaeceb2870f315584fa30121f505a6dfd86439c5e3fdd8cd9e0e291290c41d0c3599f0cb12ab356722ed242584c30348e50
+ languageName: node
+ linkType: hard
+
"normalize-url@npm:^8.0.0":
version: 8.0.0
resolution: "normalize-url@npm:8.0.0"
@@ -15082,7 +15357,7 @@ __metadata:
languageName: node
linkType: hard
-"once@npm:^1.3.0, once@npm:^1.4.0":
+"once@npm:^1.3.0, once@npm:^1.3.1, once@npm:^1.4.0":
version: 1.4.0
resolution: "once@npm:1.4.0"
dependencies:
@@ -15246,6 +15521,13 @@ __metadata:
languageName: node
linkType: hard
+"p-cancelable@npm:^2.0.0":
+ version: 2.1.1
+ resolution: "p-cancelable@npm:2.1.1"
+ checksum: 3dba12b4fb4a1e3e34524535c7858fc82381bbbd0f247cc32dedc4018592a3950ce66b106d0880b4ec4c2d8d6576f98ca885dc1d7d0f274d1370be20e9523ddf
+ languageName: node
+ linkType: hard
+
"p-cancelable@npm:^3.0.0":
version: 3.0.0
resolution: "p-cancelable@npm:3.0.0"
@@ -15253,7 +15535,7 @@ __metadata:
languageName: node
linkType: hard
-"p-limit@npm:^2.0.0":
+"p-limit@npm:^2.0.0, p-limit@npm:^2.2.0":
version: 2.3.0
resolution: "p-limit@npm:2.3.0"
dependencies:
@@ -16663,6 +16945,16 @@ __metadata:
languageName: node
linkType: hard
+"pump@npm:^3.0.0":
+ version: 3.0.3
+ resolution: "pump@npm:3.0.3"
+ dependencies:
+ end-of-stream: ^1.1.0
+ once: ^1.3.1
+ checksum: 52843fc933b838c0330f588388115a1b28ef2a5ffa7774709b142e35431e8ab0c2edec90de3fa34ebb72d59fef854f151eea7dfc211b6dcf586b384556bd2f39
+ languageName: node
+ linkType: hard
+
"punycode.js@npm:^2.3.1":
version: 2.3.1
resolution: "punycode.js@npm:2.3.1"
@@ -17362,7 +17654,7 @@ __metadata:
languageName: node
linkType: hard
-"resolve-alpn@npm:^1.2.0":
+"resolve-alpn@npm:^1.0.0, resolve-alpn@npm:^1.2.0":
version: 1.2.1
resolution: "resolve-alpn@npm:1.2.1"
checksum: f558071fcb2c60b04054c99aebd572a2af97ef64128d59bef7ab73bd50d896a222a056de40ffc545b633d99b304c259ea9d0c06830d5c867c34f0bfa60b8eae0
@@ -17456,6 +17748,15 @@ __metadata:
languageName: node
linkType: hard
+"responselike@npm:^2.0.0":
+ version: 2.0.1
+ resolution: "responselike@npm:2.0.1"
+ dependencies:
+ lowercase-keys: ^2.0.0
+ checksum: b122535466e9c97b55e69c7f18e2be0ce3823c5d47ee8de0d9c0b114aa55741c6db8bfbfce3766a94d1272e61bfb1ebf0a15e9310ac5629fbb7446a861b4fd3a
+ languageName: node
+ linkType: hard
+
"responselike@npm:^3.0.0":
version: 3.0.0
resolution: "responselike@npm:3.0.0"
@@ -17513,15 +17814,14 @@ __metadata:
languageName: node
linkType: hard
-"rimraf@npm:*":
- version: 6.0.1
- resolution: "rimraf@npm:6.0.1"
+"rimraf@npm:*, rimraf@npm:^5.0.5":
+ version: 5.0.10
+ resolution: "rimraf@npm:5.0.10"
dependencies:
- glob: ^11.0.0
- package-json-from-dist: ^1.0.0
+ glob: ^10.3.7
bin:
rimraf: dist/esm/bin.mjs
- checksum: 8ba5b84131c1344e9417cb7e8c05d8368bb73cbe5dd4c1d5eb49fc0b558209781658d18c450460e30607d0b7865bb067482839a2f343b186b07ae87715837e66
+ checksum: 50e27388dd2b3fa6677385fc1e2966e9157c89c86853b96d02e6915663a96b7ff4d590e14f6f70e90f9b554093aa5dbc05ac3012876be558c06a65437337bc05
languageName: node
linkType: hard
@@ -17536,17 +17836,6 @@ __metadata:
languageName: node
linkType: hard
-"rimraf@npm:^5.0.5":
- version: 5.0.10
- resolution: "rimraf@npm:5.0.10"
- dependencies:
- glob: ^10.3.7
- bin:
- rimraf: dist/esm/bin.mjs
- checksum: 50e27388dd2b3fa6677385fc1e2966e9157c89c86853b96d02e6915663a96b7ff4d590e14f6f70e90f9b554093aa5dbc05ac3012876be558c06a65437337bc05
- languageName: node
- linkType: hard
-
"rollup-plugin-terser@npm:^7.0.0":
version: 7.0.2
resolution: "rollup-plugin-terser@npm:7.0.2"
@@ -17575,7 +17864,7 @@ __metadata:
languageName: node
linkType: hard
-"rollup@npm:^4.34.9, rollup@npm:^4.43.0":
+"rollup@npm:^4.34.9":
version: 4.46.3
resolution: "rollup@npm:4.46.3"
dependencies:
@@ -17707,7 +17996,7 @@ __metadata:
languageName: node
linkType: hard
-"safe-buffer@npm:5.2.1, safe-buffer@npm:>=5.1.0, safe-buffer@npm:^5.1.0, safe-buffer@npm:~5.2.0":
+"safe-buffer@npm:5.2.1, safe-buffer@npm:>=5.1.0, safe-buffer@npm:^5.1.0":
version: 5.2.1
resolution: "safe-buffer@npm:5.2.1"
checksum: b99c4b41fdd67a6aaf280fcd05e9ffb0813654894223afb78a31f14a19ad220bba8aba1cb14eddce1fcfb037155fe6de4e861784eb434f7d11ed58d1e70dd491
@@ -17857,7 +18146,7 @@ __metadata:
languageName: node
linkType: hard
-"semver@npm:^7.0.0, semver@npm:^7.3.2, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.3, semver@npm:^7.7.1, semver@npm:^7.7.2":
+"semver@npm:^7.0.0, semver@npm:^7.1.2, semver@npm:^7.3.2, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.3, semver@npm:^7.7.1, semver@npm:^7.7.2":
version: 7.7.2
resolution: "semver@npm:7.7.2"
bin:
@@ -18589,16 +18878,7 @@ __metadata:
languageName: node
linkType: hard
-"string_decoder@npm:^1.1.1":
- version: 1.3.0
- resolution: "string_decoder@npm:1.3.0"
- dependencies:
- safe-buffer: ~5.2.0
- checksum: 8417646695a66e73aefc4420eb3b84cc9ffd89572861fe004e6aeb13c7bc00e2f616247505d2dbbef24247c372f70268f594af7126f43548565c68c117bdeb56
- languageName: node
- linkType: hard
-
-"string_decoder@npm:~1.1.1":
+"string_decoder@npm:^1.1.1, string_decoder@npm:~1.1.1":
version: 1.1.1
resolution: "string_decoder@npm:1.1.1"
dependencies:
@@ -18936,17 +19216,17 @@ __metadata:
languageName: node
linkType: hard
-"tar@npm:^6.1.11, tar@npm:^6.1.2":
- version: 6.1.11
- resolution: "tar@npm:6.1.11"
+"tar@npm:^6.0.5, tar@npm:^6.1.11, tar@npm:^6.1.2":
+ version: 6.2.1
+ resolution: "tar@npm:6.2.1"
dependencies:
chownr: ^2.0.0
fs-minipass: ^2.0.0
- minipass: ^3.0.0
+ minipass: ^5.0.0
minizlib: ^2.1.1
mkdirp: ^1.0.3
yallist: ^4.0.0
- checksum: a04c07bb9e2d8f46776517d4618f2406fb977a74d914ad98b264fc3db0fe8224da5bec11e5f8902c5b9bcb8ace22d95fbe3c7b36b8593b7dfc8391a25898f32f
+ checksum: f1322768c9741a25356c11373bce918483f40fa9a25c69c59410c8a1247632487edef5fe76c5f12ac51a6356d2f1829e96d2bc34098668a2fc34d76050ac2b6c
languageName: node
linkType: hard
@@ -19068,6 +19348,13 @@ __metadata:
languageName: node
linkType: hard
+"tinylogic@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "tinylogic@npm:2.0.0"
+ checksum: b966cbb41241a048095fb9e685d5e2020475fdea2c65b4ae51e5dee48964860a4505d987503c004b8a76e96b64c7da2f49954dd36c691d559c315d878ce7da29
+ languageName: node
+ linkType: hard
+
"tinypool@npm:^1.1.1":
version: 1.1.1
resolution: "tinypool@npm:1.1.1"
@@ -19151,6 +19438,13 @@ __metadata:
languageName: node
linkType: hard
+"treeify@npm:^1.1.0":
+ version: 1.1.0
+ resolution: "treeify@npm:1.1.0"
+ checksum: aa00dded220c1dd052573bd6fc2c52862f09870851a284f0d3650d72bf913ba9b4f6b824f4f1ab81899bae29375f4266b07fe47cbf82343a1efa13cc09ce87af
+ languageName: node
+ linkType: hard
+
"trim-lines@npm:^3.0.0":
version: 3.0.1
resolution: "trim-lines@npm:3.0.1"
@@ -19197,7 +19491,7 @@ __metadata:
languageName: node
linkType: hard
-"tslib@npm:^2.0.3, tslib@npm:^2.3.0, tslib@npm:^2.4.0, tslib@npm:^2.6.0":
+"tslib@npm:^2.0.3, tslib@npm:^2.3.0, tslib@npm:^2.4.0, tslib@npm:^2.4.1, tslib@npm:^2.6.0":
version: 2.8.1
resolution: "tslib@npm:2.8.1"
checksum: e4aba30e632b8c8902b47587fd13345e2827fa639e7c3121074d5ee0880723282411a8838f830b55100cbe4517672f84a2472667d355b81e8af165a55dc6203a
@@ -19220,6 +19514,13 @@ __metadata:
languageName: node
linkType: hard
+"typanion@npm:^3.8.0":
+ version: 3.14.0
+ resolution: "typanion@npm:3.14.0"
+ checksum: fc0590d02c13c659eb1689e8adf7777e6c00dc911377e44cd36fe1b1271cfaca71547149f12cdc275058c0de5562a14e5273adbae66d47e6e0320e36007f5912
+ languageName: node
+ linkType: hard
+
"type-check@npm:^0.4.0, type-check@npm:~0.4.0":
version: 0.4.0
resolution: "type-check@npm:0.4.0"
@@ -19368,10 +19669,10 @@ __metadata:
version: 0.0.0-use.local
resolution: "typescript-eslint@workspace:packages/typescript-eslint"
dependencies:
- "@typescript-eslint/eslint-plugin": 8.45.0
- "@typescript-eslint/parser": 8.45.0
- "@typescript-eslint/typescript-estree": 8.45.0
- "@typescript-eslint/utils": 8.45.0
+ "@typescript-eslint/eslint-plugin": 8.46.0
+ "@typescript-eslint/parser": 8.46.0
+ "@typescript-eslint/typescript-estree": 8.46.0
+ "@typescript-eslint/utils": 8.46.0
"@vitest/coverage-v8": ^3.1.3
eslint: "*"
rimraf: "*"
@@ -19774,62 +20075,7 @@ __metadata:
languageName: node
linkType: hard
-"vite@npm:^5.0.0 || ^6.0.0 || ^7.0.0-0":
- version: 7.1.3
- resolution: "vite@npm:7.1.3"
- dependencies:
- esbuild: ^0.25.0
- fdir: ^6.5.0
- fsevents: ~2.3.3
- picomatch: ^4.0.3
- postcss: ^8.5.6
- rollup: ^4.43.0
- tinyglobby: ^0.2.14
- peerDependencies:
- "@types/node": ^20.19.0 || >=22.12.0
- jiti: ">=1.21.0"
- less: ^4.0.0
- lightningcss: ^1.21.0
- sass: ^1.70.0
- sass-embedded: ^1.70.0
- stylus: ">=0.54.8"
- sugarss: ^5.0.0
- terser: ^5.16.0
- tsx: ^4.8.1
- yaml: ^2.4.2
- dependenciesMeta:
- fsevents:
- optional: true
- peerDependenciesMeta:
- "@types/node":
- optional: true
- jiti:
- optional: true
- less:
- optional: true
- lightningcss:
- optional: true
- sass:
- optional: true
- sass-embedded:
- optional: true
- stylus:
- optional: true
- sugarss:
- optional: true
- terser:
- optional: true
- tsx:
- optional: true
- yaml:
- optional: true
- bin:
- vite: bin/vite.js
- checksum: 625974a3399d0e9f98e6c06d2ce83b982b5d76e030201809a6bbce03a1cbdb8ff4e0e0dc5e71cd4f402f3858afa8940e091551632a3423fddeb6afd213792d45
- languageName: node
- linkType: hard
-
-"vite@npm:^6.3.5":
+"vite@npm:^5.0.0 || ^6.0.0 || ^7.0.0-0, vite@npm:^6.3.5":
version: 6.3.5
resolution: "vite@npm:6.3.5"
dependencies:
@@ -20760,6 +21006,21 @@ __metadata:
languageName: node
linkType: hard
+"yarn-berry-deduplicate@npm:^6.1.3":
+ version: 6.1.3
+ resolution: "yarn-berry-deduplicate@npm:6.1.3"
+ dependencies:
+ "@yarnpkg/core": ^4.4.1
+ "@yarnpkg/parsers": ^3.0.3
+ commander: ^9.4.1
+ semver: ^7.3.8
+ tslib: ^2.4.1
+ bin:
+ yarn-berry-deduplicate: dist/cli.js
+ checksum: 8f5afa2d51c38629ca01b5c650fdf5bbc43caa8035d4e74cacd607e47596afa0baab1b787c7111997e37ff12991097502ee4371d61f0a4aa94c21b88e53c812f
+ languageName: node
+ linkType: hard
+
"yocto-queue@npm:^0.1.0":
version: 0.1.0
resolution: "yocto-queue@npm:0.1.0"