Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6586d98

Browse files
committed
chore: fix bad merge
1 parent 6397be8 commit 6586d98

File tree

7 files changed

+30
-23
lines changed

7 files changed

+30
-23
lines changed

packages/eslint-plugin/src/rules/no-misused-promises.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,8 @@ export default util.createRule<Options, MessageId>({
378378
const contextualType = checker.getContextualType(value);
379379
if (
380380
contextualType !== undefined &&
381-
isVoidReturningFunctionType(checker, value, contextualType)
381+
isVoidReturningFunctionType(checker, value, contextualType) &&
382+
returnsThenable(checker, value)
382383
) {
383384
context.report({
384385
messageId: 'voidReturnAttribute',

packages/typescript-estree/src/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ function parseAndGenerateServices<T extends TSESTreeOptions = TSESTreeOptions>(
200200
const hasFullTypeInformation =
201201
parseSettings.programs != null || parseSettings.projects?.length > 0;
202202

203-
if (typeof options !== 'undefined') {
203+
if (options !== undefined) {
204204
if (
205205
typeof options.errorOnTypeScriptSyntacticAndSemanticIssues ===
206206
'boolean' &&

packages/website-eslint/types/index.d.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

packages/website/src/components/ASTViewerESTree.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,19 @@ import { createESTreeSerializer } from './ast/serializer/serializerESTree';
88
import type { ASTViewerBaseProps } from './ast/types';
99

1010
export interface ASTESTreeViewerProps extends ASTViewerBaseProps {
11-
readonly value: TSESTree.BaseNode | TSESTree.Program;
11+
readonly value: TSESTree.Node | TSESTree.Program;
1212
readonly filter?: ESQuery.Selector;
1313
}
1414

15-
function tryToApplyFilter<T extends TSESTree.BaseNode>(
15+
function tryToApplyFilter<T extends TSESTree.Node>(
1616
value: T,
1717
filter?: ESQuery.Selector,
1818
): T | T[] {
1919
try {
2020
if (window.esquery && filter) {
21-
// @ts-expect-error - esquery requires js ast types
22-
return window.esquery.match(value, filter);
21+
return window.esquery.match(value, filter) as T[];
2322
}
2423
} catch (e: unknown) {
25-
// eslint-disable-next-line no-console
2624
console.error(e);
2725
}
2826
return value;

packages/website/src/components/linter/WebLinter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { ParserOptions } from '@typescript-eslint/types';
55
import type { astConverter } from '@typescript-eslint/typescript-estree/use-at-your-own-risk/ast-converter';
66
import type { getScriptKind } from '@typescript-eslint/typescript-estree/use-at-your-own-risk/getScriptKind';
77
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
8+
import type esquery from 'esquery';
89
import type {
910
CompilerHost,
1011
CompilerOptions,
@@ -20,6 +21,7 @@ export interface LintUtils {
2021
visitorKeys: TSESLint.SourceCode.VisitorKeys;
2122
astConverter: typeof astConverter;
2223
getScriptKind: typeof getScriptKind;
24+
esquery: typeof esquery;
2325
}
2426

2527
export class WebLinter {

packages/website/src/globals.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import type * as SandboxFactory from '@site/src/vendor/sandbox';
22
import type * as TsWorker from '@site/src/vendor/tsWorker';
3-
import type { LintUtils } from '@typescript-eslint/website-eslint';
43
import type esquery from 'esquery';
54
import type MonacoType from 'monaco-editor';
65
import type * as TSType from 'typescript';
76

7+
import type { LintUtils } from './components/linter/WebLinter';
8+
89
declare global {
910
type WindowRequireCb = (
1011
main: typeof MonacoType,

patches/@types+esquery+1.0.2.patch

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
diff --git a/node_modules/@types/esquery/index.d.ts b/node_modules/@types/esquery/index.d.ts
2+
index ba54dba..c101712 100755
3+
--- a/node_modules/@types/esquery/index.d.ts
4+
+++ b/node_modules/@types/esquery/index.d.ts
5+
@@ -4,12 +4,14 @@
6+
// Brad Zacher <https://github.com/bradzacher>
7+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
8+
9+
-import { Node } from 'estree';
10+
+import { TSESTree } from '@typescript-eslint/types';
11+
12+
export as namespace esquery;
13+
14+
export = query;
15+
16+
+type Node = TSESTree.Node;
17+
+
18+
/** Query the code AST using the selector string. */
19+
declare function query(ast: Node, selector: string): Node[];
20+

0 commit comments

Comments
 (0)