Skip to content

Commit

Permalink
Merge branch 'main'
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Nov 17, 2023
2 parents 7390468 + 5ab15ce commit 42e2148
Show file tree
Hide file tree
Showing 412 changed files with 5,321 additions and 2,632 deletions.
2 changes: 2 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"nocheck",
"noninteractive",
"nullish",
"onboarded",
"OOM",
"OOMs",
"parameterised",
Expand All @@ -118,6 +119,7 @@
"serializers",
"Sourcegraph",
"stringification",
"stringly",
"superset",
"thenables",
"transpiled",
Expand Down
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ module.exports = {
'deprecation/deprecation': 'error',

// TODO(#7338): Investigate enabling these soon ✨
'@typescript-eslint/consistent-indexed-object-style': 'off',
'@typescript-eslint/no-unnecessary-condition': 'off',
'@typescript-eslint/no-dynamic-delete': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/01-bug-report-plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: '🐛 Report a Bug With a Rule'
name: '🐛 Rule Bug'
description: 'Report a bug you encountered with a lint rule'
title: 'Bug: [rule name here] <short description of the issue>'
labels:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/02-enhancement-rule-option.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Propose a New Rule Option or Additional Checks'
name: '✨ New Rule Option or Additional Check'
description: 'Propose a new lint rule option or propose that a lint rule checks more cases'
title: 'Enhancement: [rule-name] <a short description of my proposal>'
labels:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/03-enhancement-new-rule.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Propose a New Rule'
name: '✨ New Rule'
description: 'Propose a new lint rule'
title: 'Rule proposal: <a short description of my proposal>'
labels:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Propose a New Base Rule Extension'
name: '✨ New Base Rule Extension'
description: 'Propose a new base lint rule extension'
title: 'Base rule extension: [rule-name] <a short description of my proposal>'
labels:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/05-documentation-request.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: '📝 Documentation Request'
name: '📝 Documentation'
description: 'Request a change in documentation'
title: 'Docs: <a short description of my proposal>'
labels:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/06-bug-report-other.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: '🐛 Report a Bug With Another Package'
name: '🐛 Bug With Another Package'
description: 'Report a bug you encountered with another one of our packages (parser, util, scope-manager, etc)'
title: 'Bug: <short description of the issue>'
labels:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/07-enhancement-other.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Propose an Enhancement With Another Package'
name: 'Enhance Another Package'
description: 'Report an enhancement to another one of our packages (parser, util, scope-manager, etc)'
title: 'Enhancement: <a short description of my proposal>'
labels:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/08-bug-report-complex.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: '🐛 Report a Complex Bug With a Reproduction Repository'
name: '🐛 Complex Bug With a Reproduction Repository'
description: Report a complex bug you encountered by providing an isolated reproduction repository
title: 'Bug: <short description of the issue>'
labels:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/09-config-change.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Propose a Change to Preset Configurations'
name: '♻ Preset Configurations Change'
description: 'Propose an addition, removal, or general change to a preset config'
title: 'Configs: <a short description of my proposal>'
labels:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/10-repo-maintenance.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: '🏗 Suggest an Improvement with Repository Maintenance'
name: '🏗 Improve Repository Maintenance'
description: Report a bug or request a feature related to developing the typescript-eslint monorepo
title: 'Repo: <short description of the issue>'
labels:
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/a11y-alt-bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Accessibility-alt-text-bot
on:
issues:
types: [opened, edited]
pull_request:
types: [opened, edited]
issue_comment:
types: [created, edited]
discussion:
types: [created, edited]
discussion_comment:
types: [created, edited]

permissions:
issues: write
pull-requests: write
discussions: write

jobs:
accessibility_alt_text_bot:
name: Check alt text is set on images
runs-on: ubuntu-latest
steps:
- name: Get action 'github/accessibility-alt-text-bot'
uses: github/accessibility-alt-text-bot@v1.4.0
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ packages/types/src/generated/**/*.ts
# Yarn 3
.pnp.*
.yarn/*
packages/**/.yarn
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

.nx/cache
.nx/cache
46 changes: 46 additions & 0 deletions .yarn/patches/@microsoft-api-extractor-npm-7.38.0-955f1e0725.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
diff --git a/lib/analyzer/ExportAnalyzer.js b/lib/analyzer/ExportAnalyzer.js
index 51f31b4f2f253d82adc9594faa58d8dc031957e0..1fddac54b08665f5a5a717fef740613ae921cb7a 100644
--- a/lib/analyzer/ExportAnalyzer.js
+++ b/lib/analyzer/ExportAnalyzer.js
@@ -193,7 +193,7 @@ class ExportAnalyzer {
const mode = specifier && ts.isStringLiteralLike(specifier)
? TypeScriptInternals_1.TypeScriptInternals.getModeForUsageLocation(importOrExportDeclaration.getSourceFile(), specifier)
: undefined;
- const resolvedModule = TypeScriptInternals_1.TypeScriptInternals.getResolvedModule(importOrExportDeclaration.getSourceFile(), moduleSpecifier, mode);
+ const resolvedModule = TypeScriptInternals_1.TypeScriptInternals.getResolvedModule(this._program, importOrExportDeclaration.getSourceFile(), moduleSpecifier, mode);
if (resolvedModule === undefined) {
// The TS compiler API `getResolvedModule` cannot resolve ambient modules. Thus, to match API Extractor's
// previous behavior, simply treat all ambient modules as external. This bug is tracked by
@@ -666,7 +666,7 @@ class ExportAnalyzer {
ts.isStringLiteralLike(importOrExportDeclaration.moduleSpecifier)
? TypeScriptInternals_1.TypeScriptInternals.getModeForUsageLocation(importOrExportDeclaration.getSourceFile(), importOrExportDeclaration.moduleSpecifier)
: undefined;
- const resolvedModule = TypeScriptInternals_1.TypeScriptInternals.getResolvedModule(importOrExportDeclaration.getSourceFile(), moduleSpecifier, mode);
+ const resolvedModule = TypeScriptInternals_1.TypeScriptInternals.getResolvedModule(this._program, importOrExportDeclaration.getSourceFile(), moduleSpecifier, mode);
if (resolvedModule === undefined) {
// Encountered in https://github.com/microsoft/rushstack/issues/1914.
//
diff --git a/lib/analyzer/TypeScriptInternals.js b/lib/analyzer/TypeScriptInternals.js
index ff13db7709ccf502fe202337869d4024431636c9..217c36b0303c3bf9871edabcd48fbf6e09f18561 100644
--- a/lib/analyzer/TypeScriptInternals.js
+++ b/lib/analyzer/TypeScriptInternals.js
@@ -84,10 +84,16 @@ class TypeScriptInternals {
* Retrieves the (cached) module resolution information for a module name that was exported from a SourceFile.
* The compiler populates this cache as part of analyzing the source file.
*/
- static getResolvedModule(sourceFile, moduleNameText, mode) {
+ static getResolvedModule(program, sourceFile, moduleNameText, mode) {
// Compiler internal:
- // https://github.com/microsoft/TypeScript/blob/v4.7.2/src/compiler/utilities.ts#L161
- return ts.getResolvedModule(sourceFile, moduleNameText, mode);
+ // https://github.com/microsoft/TypeScript/blob/v5.3-beta/src/compiler/types.ts#L4678
+ const result = program.getResolvedModule(
+ sourceFile,
+ moduleNameText,
+ mode
+ );
+ return result?.resolvedModule;
+
}
/**
* Gets the mode required for module resolution required with the addition of Node16/nodenext
12 changes: 0 additions & 12 deletions .yarn/patches/react-split-pane-npm-0.1.92-93dbf51dff.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts
index ead6d07d8fb2af6aa74b790c9fd947f1062f6df4..f8dad7f06e74d7cfccfcd8fc9c5c7038a7fe4164 100644
index d785077fd9e4eb5959c0badb857358fad09d4d3f..54f71344b098e8d46acd8dd77638c60d505bb996 100644
--- a/lib/typescript.d.ts
+++ b/lib/typescript.d.ts
@@ -371,8 +371,8 @@ declare namespace ts {
@@ -4491,8 +4491,8 @@ declare namespace ts {
JSDocFunctionType = 324,
JSDocVariadicType = 325,
JSDocNamepathType = 326,
Expand All @@ -12,7 +12,7 @@ index ead6d07d8fb2af6aa74b790c9fd947f1062f6df4..f8dad7f06e74d7cfccfcd8fc9c5c7038
JSDocComment = 327,
JSDocText = 328,
JSDocTypeLiteral = 329,
@@ -738,6 +738,8 @@ declare namespace ts {
@@ -5066,6 +5066,8 @@ declare namespace ts {
readonly name: PropertyName;
readonly questionToken?: QuestionToken;
readonly type?: TypeNode;
Expand All @@ -21,7 +21,7 @@ index ead6d07d8fb2af6aa74b790c9fd947f1062f6df4..f8dad7f06e74d7cfccfcd8fc9c5c7038
}
interface PropertyDeclaration extends ClassElement, JSDocContainer {
readonly kind: SyntaxKind.PropertyDeclaration;
@@ -763,6 +765,10 @@ declare namespace ts {
@@ -5091,6 +5093,10 @@ declare namespace ts {
readonly parent: ObjectLiteralExpression;
readonly name: PropertyName;
readonly initializer: Expression;
Expand All @@ -32,7 +32,7 @@ index ead6d07d8fb2af6aa74b790c9fd947f1062f6df4..f8dad7f06e74d7cfccfcd8fc9c5c7038
}
interface ShorthandPropertyAssignment extends ObjectLiteralElement, JSDocContainer {
readonly kind: SyntaxKind.ShorthandPropertyAssignment;
@@ -770,6 +776,12 @@ declare namespace ts {
@@ -5098,6 +5104,12 @@ declare namespace ts {
readonly name: Identifier;
readonly equalsToken?: EqualsToken;
readonly objectAssignmentInitializer?: Expression;
Expand All @@ -45,7 +45,7 @@ index ead6d07d8fb2af6aa74b790c9fd947f1062f6df4..f8dad7f06e74d7cfccfcd8fc9c5c7038
}
interface SpreadAssignment extends ObjectLiteralElement, JSDocContainer {
readonly kind: SyntaxKind.SpreadAssignment;
@@ -892,6 +904,8 @@ declare namespace ts {
@@ -5222,6 +5234,8 @@ declare namespace ts {
}
interface FunctionTypeNode extends FunctionOrConstructorTypeNodeBase, LocalsContainer {
readonly kind: SyntaxKind.FunctionType;
Expand All @@ -54,7 +54,7 @@ index ead6d07d8fb2af6aa74b790c9fd947f1062f6df4..f8dad7f06e74d7cfccfcd8fc9c5c7038
}
interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase, LocalsContainer {
readonly kind: SyntaxKind.ConstructorType;
@@ -4584,7 +4598,13 @@ declare namespace ts {
@@ -8978,7 +8992,13 @@ declare namespace ts {
function symbolName(symbol: Symbol): string;
function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | PrivateIdentifier | undefined;
function getNameOfDeclaration(declaration: Declaration | Expression | undefined): DeclarationName | undefined;
Expand All @@ -68,7 +68,7 @@ index ead6d07d8fb2af6aa74b790c9fd947f1062f6df4..f8dad7f06e74d7cfccfcd8fc9c5c7038
function getModifiers(node: HasModifiers): readonly Modifier[] | undefined;
/**
* Gets the JSDoc parameter tags for the node if present.
@@ -5110,7 +5130,13 @@ declare namespace ts {
@@ -9508,7 +9528,13 @@ declare namespace ts {
function isModuleName(node: Node): node is ModuleName;
function isBinaryOperatorToken(node: Node): node is BinaryOperatorToken;
function setTextRange<T extends TextRange>(range: T, location: TextRange | undefined): T;
Expand Down
58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,64 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [6.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v6.10.0...v6.11.0) (2023-11-13)


### Bug Fixes

* **eslint-plugin:** [explicit-function-return-type] support JSX attributes in `allowTypedFunctionExpressions` ([#7553](https://github.com/typescript-eslint/typescript-eslint/issues/7553)) ([be2777c](https://github.com/typescript-eslint/typescript-eslint/commit/be2777c5338669836d786f9a7806f499fd566dcd))
* **eslint-plugin:** [no-unnecessary-qualifier] handle nested namespace id ([#7883](https://github.com/typescript-eslint/typescript-eslint/issues/7883)) ([a668f5b](https://github.com/typescript-eslint/typescript-eslint/commit/a668f5b10e7b1570c732312ad9ccab3431459c1b))


### Features

* add `no-unsafe-unary-minus` rule ([#7390](https://github.com/typescript-eslint/typescript-eslint/issues/7390)) ([c4709c2](https://github.com/typescript-eslint/typescript-eslint/commit/c4709c2861f8ea4e18c289218a75224d6bb76193))
* add types for flat config files ([#7273](https://github.com/typescript-eslint/typescript-eslint/issues/7273)) ([66cd0c0](https://github.com/typescript-eslint/typescript-eslint/commit/66cd0c0535e5de1b46ba337919a9a92748d2b0a6))
* allow typescript@5.3.0-RC as devDependency ([#7821](https://github.com/typescript-eslint/typescript-eslint/issues/7821)) ([b6c40b4](https://github.com/typescript-eslint/typescript-eslint/commit/b6c40b42b68d5567c7468030ee45b9b84bec4c4d))
* **eslint-plugin:** no-unsafe-enum-comparison handles switch cases ([#7898](https://github.com/typescript-eslint/typescript-eslint/issues/7898)) ([72cb9e4](https://github.com/typescript-eslint/typescript-eslint/commit/72cb9e4ed397d35a8d8838d27dedbace6122179c))
* **typescript-estree:** skip `isTTY` version check if user passes `loggerFn` on unsupported TypeScript version warning ([#7739](https://github.com/typescript-eslint/typescript-eslint/issues/7739)) ([9656e13](https://github.com/typescript-eslint/typescript-eslint/commit/9656e135e78d9346d326d0c78ba772a5596c1812))
* **utils:** add ESLint `CodePath` selector types ([#7551](https://github.com/typescript-eslint/typescript-eslint/issues/7551)) ([99a026f](https://github.com/typescript-eslint/typescript-eslint/commit/99a026fe41b4b169914352fe66e7d5d687b300bf))
* **utils:** update types to reflect `RuleContext` and `SourceCode` changes and deprecations ([#7812](https://github.com/typescript-eslint/typescript-eslint/issues/7812)) ([b73d8b2](https://github.com/typescript-eslint/typescript-eslint/commit/b73d8b21dea9c6697a68039ffba848d21b04402c))

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





# [6.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v6.9.1...v6.10.0) (2023-11-06)


### Bug Fixes

* **eslint-plugin:** [no-unused-vars] handle logical assignment ([#7854](https://github.com/typescript-eslint/typescript-eslint/issues/7854)) ([11e57c5](https://github.com/typescript-eslint/typescript-eslint/commit/11e57c5937cc2ad2e6b035f8d3fb25a918490960))
* **eslint-plugin:** [require-await] add support for "await using" ([#7866](https://github.com/typescript-eslint/typescript-eslint/issues/7866)) ([855abea](https://github.com/typescript-eslint/typescript-eslint/commit/855abea2d7ba0235e61430f9481117af5f8f1bf7))


### Features

* **eslint-plugin:** [ban-ts-comments] suggest ts-expect-error over ts-ignore ([#7849](https://github.com/typescript-eslint/typescript-eslint/issues/7849)) ([5e73a48](https://github.com/typescript-eslint/typescript-eslint/commit/5e73a4810add09470426129bc6b267cfaa42c378))

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





## [6.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v6.9.0...v6.9.1) (2023-10-30)


### Bug Fixes

* **eslint-plugin:** [naming-convention] allow PascalCase for imports ([#7841](https://github.com/typescript-eslint/typescript-eslint/issues/7841)) ([7ad86ee](https://github.com/typescript-eslint/typescript-eslint/commit/7ad86eead76fa9e96573ac011376c1cb8c009cee))
* **eslint-plugin:** [no-unused-expressions] handle TSInstantiationExpression expression ([#7831](https://github.com/typescript-eslint/typescript-eslint/issues/7831)) ([31988e0](https://github.com/typescript-eslint/typescript-eslint/commit/31988e0d2e6cf5e6bb9bb287958b1f03ca084259))

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





# [6.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v6.8.0...v6.9.0) (2023-10-23)


Expand Down
2 changes: 1 addition & 1 deletion docs/developers/Custom_Rules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export const rule = createRule({
## Typed Rules

:::tip
Read TypeScript's [Compiler APIs > Using the Type Checker](https://github.com/microsoft/TypeScript/wiki/Using-the-Compiler-API#using-the-type-checker) section for how to use a program's type checker.
Read TypeScript's [Compiler APIs > Type Checker APIs](https://github.com/microsoft/TypeScript/wiki/Using-the-Compiler-API#type-checker-apis) for how to use a program's type checker.
:::

The biggest addition typescript-eslint brings to ESLint rules is the ability to use TypeScript's type checker APIs.
Expand Down
6 changes: 5 additions & 1 deletion docs/linting/Troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,11 @@ Rules such as [`no-unsafe-argument`](/rules/no-unsafe-argument), [`no-unsafe-ass
If you're seeing this warning, it's likely you're using an ESLint plugin (or other tooling) that hasn't been updated for typescript-eslint v6.
Make sure you're using the latest versions of each of your ESLint plugins (and other tooling).

If you've using many ESLint plugins, have updated each to their latest version, and you're not sure which one this complaint is coming from, try disabling half of them at a time to narrow down which plugin it is.
If you've using many ESLint plugins, have updated each to their latest version, and you're not sure which one this complaint is coming from, try either or both of:

- Running with [`--trace-deprecation`](https://nodejs.org/api/cli.html#--trace-deprecation) (e.g. `npx crossenv NODE_OPTIONS=--trace-deprecation npm lint`)
- Disabling half of them at a time to narrow down which plugin it is

Then make sure each of those plugins has a GitHub issue asking that they release a version supporting typescript-eslint v6.

:::tip
Expand Down
2 changes: 1 addition & 1 deletion docs/maintenance/Dependency_Version_Upgrades.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ title: Dependency Version Upgrades
Our published packages only depend on `@babel/*` packages as devDependencies.
You can generally upgrade those dependencies with:

1. `yarn add -DW @babel/code-frame @babel/core @babel/eslint-parser @babel/parser @babel/types`
1. `yarn add -D @babel/code-frame @babel/core @babel/eslint-parser @babel/parser @babel/types`
2. `npx nx run ast-spec:test -u`

The fixtures under `packages/ast-spec/` describe how the files are parsed under both Babel and our (TSESTree) parser.
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "6.9.0",
"version": "6.11.0",
"npmClient": "yarn",
"stream": true,
"command": {
Expand Down
23 changes: 18 additions & 5 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,24 @@
],
"cache": true
},
"package": {
"cache": true
},
"prebuild": {
"cache": true
"@nx/jest:jest": {
"inputs": [
"default",
"{workspaceRoot}/jest.config.js",
"{workspaceRoot}/jest.config.base.js"
],
"outputs": ["{projectRoot}/coverage"],
"cache": true,
"options": {
"jestConfig": "{projectRoot}/jest.config.js",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
}
},
"namedInputs": {
Expand Down

0 comments on commit 42e2148

Please sign in to comment.