From aba745dcbb4a9a530d48985ea38d27fa9930d682 Mon Sep 17 00:00:00 2001 From: Evgeny Stepanovych Date: Thu, 6 Nov 2025 18:48:41 +0100 Subject: [PATCH] chore: fix typos --- .../src/rules/plugin-test-formatting.ts | 6 +++--- .../src/rules/explicit-member-accessibility.ts | 6 +++--- packages/eslint-plugin/src/rules/no-misused-promises.ts | 2 +- packages/eslint-plugin/src/rules/no-misused-spread.ts | 4 ++-- .../src/rules/no-unnecessary-template-expression.ts | 4 ++-- .../src/rules/no-unnecessary-type-arguments.ts | 4 ++-- packages/eslint-plugin/src/rules/return-await.ts | 4 ++-- packages/eslint-plugin/src/util/collectUnusedVariables.ts | 8 ++++---- .../docs-eslint-output-snapshots/no-misused-promises.shot | 4 ++-- .../eslint-plugin/tests/rules/init-declarations.test.ts | 2 +- .../rules/naming-convention/naming-convention.test.ts | 2 +- .../eslint-plugin/tests/rules/no-misused-promises.test.ts | 2 +- packages/eslint-plugin/tests/util/misc.test.ts | 2 +- packages/rule-tester/tests/RuleTester.test.ts | 6 +++--- .../tests/eslint-scope/es6-block-scope.test.ts | 2 +- .../tests/eslint-scope/global-return.test.ts | 2 +- packages/type-utils/tests/requiresQuoting.test.ts | 4 ++-- packages/typescript-eslint/src/index.ts | 2 +- .../tests/lib/semanticInfo-singleRun.test.ts | 2 +- 19 files changed, 34 insertions(+), 34 deletions(-) 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 9ca6bd0b6311..aaf4296ca3bf 100644 --- a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts +++ b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts @@ -419,7 +419,7 @@ export default createRule({ if (isNoFormatTagged) { if (literal.parent.type === AST_NODE_TYPES.TaggedTemplateExpression) { - checkForUnnecesaryNoFormat(code, literal.parent); + checkForUnnecessaryNoFormat(code, literal.parent); } return; } @@ -455,7 +455,7 @@ export default createRule({ return tag.type === AST_NODE_TYPES.Identifier && tag.name === 'noFormat'; } - function checkForUnnecesaryNoFormat( + function checkForUnnecessaryNoFormat( text: string, expr: TSESTree.TaggedTemplateExpression, ): void { @@ -480,7 +480,7 @@ export default createRule({ ): void { if (isNoFormatTemplateTag(expr.tag)) { const { cooked } = expr.quasi.quasis[0].value; - checkForUnnecesaryNoFormat(cooked, expr); + checkForUnnecessaryNoFormat(cooked, expr); } else { return; } diff --git a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts index 7fc724bb1e25..d1b6f8ea3422 100644 --- a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts +++ b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts @@ -232,14 +232,14 @@ export default createRule({ token.value === 'public' ) { keywordRange = structuredClone(token.range); - const commensAfterPublicKeyword = + const commentsAfterPublicKeyword = context.sourceCode.getCommentsAfter(token); - if (commensAfterPublicKeyword.length) { + if (commentsAfterPublicKeyword.length) { // public /* Hi there! */ static foo() // ^^^^^^^ rangeToRemove = [ token.range[0], - commensAfterPublicKeyword[0].range[0], + commentsAfterPublicKeyword[0].range[0], ]; break; } else { diff --git a/packages/eslint-plugin/src/rules/no-misused-promises.ts b/packages/eslint-plugin/src/rules/no-misused-promises.ts index b791fe150584..14255875e218 100644 --- a/packages/eslint-plugin/src/rules/no-misused-promises.ts +++ b/packages/eslint-plugin/src/rules/no-misused-promises.ts @@ -88,7 +88,7 @@ export default createRule({ messages: { conditional: 'Expected non-Promise value in a boolean conditional.', predicate: 'Expected a non-Promise value to be returned.', - spread: 'Expected a non-Promise value to be spreaded in an object.', + spread: 'Expected a non-Promise value to be spread in an object.', voidReturnArgument: 'Promise returned in function argument where a void return was expected.', voidReturnAttribute: diff --git a/packages/eslint-plugin/src/rules/no-misused-spread.ts b/packages/eslint-plugin/src/rules/no-misused-spread.ts index fab84902e9e1..34ce3fa9db52 100644 --- a/packages/eslint-plugin/src/rules/no-misused-spread.ts +++ b/packages/eslint-plugin/src/rules/no-misused-spread.ts @@ -154,7 +154,7 @@ export default createRule({ function getPromiseSpreadSuggestions( node: TSESTree.Expression, ): TSESLint.ReportSuggestionArray { - const isHighPrecendence = isHigherPrecedenceThanAwait( + const isHighPrecedence = isHigherPrecedenceThanAwait( services.esTreeNodeToTSNodeMap.get(node), ); @@ -162,7 +162,7 @@ export default createRule({ { messageId: 'addAwait', fix: fixer => - isHighPrecendence + isHighPrecedence ? fixer.insertTextBefore(node, 'await ') : [ fixer.insertTextBefore(node, 'await ('), diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-template-expression.ts b/packages/eslint-plugin/src/rules/no-unnecessary-template-expression.ts index 4f184af39f15..361300e1e3a1 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-template-expression.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-template-expression.ts @@ -193,7 +193,7 @@ export default createRule<[], MessageId>({ }); } - function isUnncessaryValueInterpolation({ + function isUnnecessaryValueInterpolation({ interpolation, nextQuasi, prevQuasi, @@ -432,7 +432,7 @@ export default createRule<[], MessageId>({ } const infos = getInterpolationInfos(node).filter( - isUnncessaryValueInterpolation, + isUnnecessaryValueInterpolation, ); for (const reportDescriptor of getReportDescriptors(infos)) { diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts index 945614ae618f..708879be502f 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts @@ -169,11 +169,11 @@ function getTypeParametersFromType( return undefined; } - const sortedDeclaraions = sortDeclarationsByTypeValueContext( + const sortedDeclarations = sortDeclarationsByTypeValueContext( node, declarations, ); - return findFirstResult(sortedDeclaraions, decl => { + return findFirstResult(sortedDeclarations, decl => { if ( ts.isTypeAliasDeclaration(decl) || ts.isInterfaceDeclaration(decl) || diff --git a/packages/eslint-plugin/src/rules/return-await.ts b/packages/eslint-plugin/src/rules/return-await.ts index 0ee20eea92a8..f1312c9915f5 100644 --- a/packages/eslint-plugin/src/rules/return-await.ts +++ b/packages/eslint-plugin/src/rules/return-await.ts @@ -267,9 +267,9 @@ export default createRule({ function insertAwait( fixer: TSESLint.RuleFixer, node: TSESTree.Expression, - isHighPrecendence: boolean, + isHighPrecedence: boolean, ): TSESLint.RuleFix | TSESLint.RuleFix[] { - if (isHighPrecendence) { + if (isHighPrecedence) { return fixer.insertTextBefore(node, 'await '); } return [ diff --git a/packages/eslint-plugin/src/util/collectUnusedVariables.ts b/packages/eslint-plugin/src/util/collectUnusedVariables.ts index 3e7172e2ca45..c98529f68a63 100644 --- a/packages/eslint-plugin/src/util/collectUnusedVariables.ts +++ b/packages/eslint-plugin/src/util/collectUnusedVariables.ts @@ -188,7 +188,7 @@ class UnusedVarsVisitor extends Visitor { // basic exported variables isExported(variable) || // variables implicitly exported via a merged declaration - isMergableExported(variable) || + isMergeableExported(variable) || // used variables isUsedVariable(variable) ) { @@ -415,7 +415,7 @@ function isSelfReference( return false; } -const MERGABLE_TYPES = new Set([ +const MERGEABLE_TYPES = new Set([ AST_NODE_TYPES.ClassDeclaration, AST_NODE_TYPES.FunctionDeclaration, AST_NODE_TYPES.TSInterfaceDeclaration, @@ -426,7 +426,7 @@ const MERGABLE_TYPES = new Set([ * Determine if the variable is directly exported * @param variable the variable to check */ -function isMergableExported(variable: ScopeVariable): boolean { +function isMergeableExported(variable: ScopeVariable): boolean { // If all of the merged things are of the same type, TS will error if not all of them are exported - so we only need to find one for (const def of variable.defs) { // parameters can never be exported. @@ -437,7 +437,7 @@ function isMergableExported(variable: ScopeVariable): boolean { } if ( - (MERGABLE_TYPES.has(def.node.type) && + (MERGEABLE_TYPES.has(def.node.type) && def.node.parent.type === AST_NODE_TYPES.ExportNamedDeclaration) || def.node.parent.type === AST_NODE_TYPES.ExportDefaultDeclaration ) { diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-promises.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-promises.shot index 3d0a679af53c..4eca533783eb 100644 --- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-promises.shot +++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-promises.shot @@ -130,14 +130,14 @@ Options: { "checksSpreads": true } const getData = () => fetch('/'); console.log({ foo: 42, ...getData() }); - ~~~~~~~~~ Expected a non-Promise value to be spreaded in an object. + ~~~~~~~~~ Expected a non-Promise value to be spread in an object. const awaitData = async () => { await fetch('/'); }; console.log({ foo: 42, ...awaitData() }); - ~~~~~~~~~~~ Expected a non-Promise value to be spreaded in an object. + ~~~~~~~~~~~ Expected a non-Promise value to be spread in an object. Correct Options: { "checksSpreads": true } diff --git a/packages/eslint-plugin/tests/rules/init-declarations.test.ts b/packages/eslint-plugin/tests/rules/init-declarations.test.ts index 3d02f77a2f18..276ba3e9f2bd 100644 --- a/packages/eslint-plugin/tests/rules/init-declarations.test.ts +++ b/packages/eslint-plugin/tests/rules/init-declarations.test.ts @@ -251,7 +251,7 @@ var bar: string = function (): string { }, { code: ` -var bar: string = function (arg1: stirng): string { +var bar: string = function (arg1: string): string { return 'string'; }; `, 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 076534645409..c92479e409b3 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 @@ -2058,7 +2058,7 @@ ruleTester.run('naming-convention', rule, { 'enumMember', ], }, - // making sure the `requoresQuotes` modifier appropriately overrides this + // making sure the `requiresQuotes` modifier appropriately overrides this { format: ['PascalCase'], selector: [ diff --git a/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts b/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts index dc671e8869d6..b75cca2c79bc 100644 --- a/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts +++ b/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts @@ -146,7 +146,7 @@ if (returnsPromise?.call()) { `, 'Promise.resolve() ?? false;', ` -function test(a: Promise | undefinded) { +function test(a: Promise | undefined) { const foo = a ?? Promise.reject(); } `, diff --git a/packages/eslint-plugin/tests/util/misc.test.ts b/packages/eslint-plugin/tests/util/misc.test.ts index 19867077e2fb..e94bca7d05f4 100644 --- a/packages/eslint-plugin/tests/util/misc.test.ts +++ b/packages/eslint-plugin/tests/util/misc.test.ts @@ -65,7 +65,7 @@ describe(misc.findLastIndex, () => { expect(misc.findLastIndex([1, 2, 3], () => true)).toBe(2); }); - it('returns the index of the last occurance of a duplicate element', () => { + it('returns the index of the last occurrence of a duplicate element', () => { expect(misc.findLastIndex([1, 2, 3, 3, 5], n => n === 3)).toBe(3); }); }); diff --git a/packages/rule-tester/tests/RuleTester.test.ts b/packages/rule-tester/tests/RuleTester.test.ts index b7a276c69e4c..83d57fd3eb32 100644 --- a/packages/rule-tester/tests/RuleTester.test.ts +++ b/packages/rule-tester/tests/RuleTester.test.ts @@ -965,7 +965,7 @@ describe(RuleTester, () => { }); describe('constructor constraints', () => { - it('skips all tests if a constructor constraint is not satisifed', () => { + it('skips all tests if a constructor constraint is not satisfied', () => { satisfiesAllDependencyConstraintsMock.mockReturnValueOnce(false); const ruleTester = new RuleTester({ dependencyConstraints: { @@ -998,7 +998,7 @@ describe(RuleTester, () => { `); }); - it('does not skip all tests if a constructor constraint is satisifed', () => { + it('does not skip all tests if a constructor constraint is satisfied', () => { satisfiesAllDependencyConstraintsMock.mockReturnValueOnce(true); const ruleTester = new RuleTester({ dependencyConstraints: { @@ -1646,7 +1646,7 @@ describe('RuleTester - run types', () => { }; describe('infer from `rule` parameter', () => { - it('should correctly infer `options` or `messageIds` types from the `rule` paramter', () => { + it('should correctly infer `options` or `messageIds` types from the `rule` parameter', () => { expect(() => ruleTester.run('my-rule', ruleModule, { invalid: [], diff --git a/packages/scope-manager/tests/eslint-scope/es6-block-scope.test.ts b/packages/scope-manager/tests/eslint-scope/es6-block-scope.test.ts index fae666eae759..e3aabdfdcfc6 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-block-scope.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-block-scope.test.ts @@ -27,7 +27,7 @@ describe('ES6 block scope', () => { expect(scope.references[1].identifier.name).toBe('i'); }); - it('function delaration is materialized in ES6 block scope', () => { + it('function declaration is materialized in ES6 block scope', () => { const { scopeManager } = parseAndAnalyze(` { function test() { diff --git a/packages/scope-manager/tests/eslint-scope/global-return.test.ts b/packages/scope-manager/tests/eslint-scope/global-return.test.ts index 6125d4ccf1e8..4c04f61a63b8 100644 --- a/packages/scope-manager/tests/eslint-scope/global-return.test.ts +++ b/packages/scope-manager/tests/eslint-scope/global-return.test.ts @@ -3,7 +3,7 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; import { DefinitionType, ScopeType } from '../../src/index.js'; import { getRealVariables, parseAndAnalyze } from '../test-utils/index.js'; -describe('gloablReturn option', () => { +describe('globalReturn option', () => { it('creates a function scope following the global scope immediately', () => { const { scopeManager } = parseAndAnalyze( ` diff --git a/packages/type-utils/tests/requiresQuoting.test.ts b/packages/type-utils/tests/requiresQuoting.test.ts index ce7c7c0cdcc3..2c71ebf51352 100644 --- a/packages/type-utils/tests/requiresQuoting.test.ts +++ b/packages/type-utils/tests/requiresQuoting.test.ts @@ -14,12 +14,12 @@ describe(requiresQuoting, () => { expect(result).toBe(false); }); - it('start with dollorSign', () => { + it('start with dollarSign', () => { const name = '$bar'; const result = requiresQuoting(name); expect(result).toBe(false); }); - it('include dollorSign not start position', () => { + it('include dollarSign not start position', () => { const name = 'foo$bar'; const result = requiresQuoting(name); expect(result).toBe(false); diff --git a/packages/typescript-eslint/src/index.ts b/packages/typescript-eslint/src/index.ts index 3f5f47da4b33..04ec5b3094cc 100644 --- a/packages/typescript-eslint/src/index.ts +++ b/packages/typescript-eslint/src/index.ts @@ -30,7 +30,7 @@ require('typescript-eslint').plugin !== require('@typescript-eslint/eslint-plugi This is bad because it means that 3rd party configs would be required to use `typescript-eslint` or else they would break a user's config if the user either -used `tseslint.configs.recomended` et al or +used `tseslint.configs.recommended` et al or ``` { plugins: { diff --git a/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts b/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts index 69789fa2dc3e..47bcf87bf54d 100644 --- a/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts +++ b/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts @@ -128,7 +128,7 @@ describe('semanticInfo - singleRun', () => { expect(createProgramFromConfigFile).not.toHaveBeenCalled(); }); - it('should not create any programs ahead of time when when TSESTREE_SINGLE_RUN=false, even if other inferrence criteria apply', () => { + it('should not create any programs ahead of time when when TSESTREE_SINGLE_RUN=false, even if other inference criteria apply', () => { vi.stubEnv('TSESTREE_SINGLE_RUN', 'false'); // Normally CI=true would be used to infer singleRun=true, but TSESTREE_SINGLE_RUN is explicitly set to false