Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ export default createRule<Options, MessageIds>({

if (isNoFormatTagged) {
if (literal.parent.type === AST_NODE_TYPES.TaggedTemplateExpression) {
checkForUnnecesaryNoFormat(code, literal.parent);
checkForUnnecessaryNoFormat(code, literal.parent);
}
return;
}
Expand Down Expand Up @@ -455,7 +455,7 @@ export default createRule<Options, MessageIds>({
return tag.type === AST_NODE_TYPES.Identifier && tag.name === 'noFormat';
}

function checkForUnnecesaryNoFormat(
function checkForUnnecessaryNoFormat(
text: string,
expr: TSESTree.TaggedTemplateExpression,
): void {
Expand All @@ -480,7 +480,7 @@ export default createRule<Options, MessageIds>({
): void {
if (isNoFormatTemplateTag(expr.tag)) {
const { cooked } = expr.quasi.quasis[0].value;
checkForUnnecesaryNoFormat(cooked, expr);
checkForUnnecessaryNoFormat(cooked, expr);
} else {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,14 @@ export default createRule<Options, MessageIds>({
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 {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/no-misused-promises.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default createRule<Options, MessageId>({
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:
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin/src/rules/no-misused-spread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,15 @@ export default createRule<Options, MessageIds>({
function getPromiseSpreadSuggestions(
node: TSESTree.Expression,
): TSESLint.ReportSuggestionArray<MessageIds> {
const isHighPrecendence = isHigherPrecedenceThanAwait(
const isHighPrecedence = isHigherPrecedenceThanAwait(
services.esTreeNodeToTSNodeMap.get(node),
);

return [
{
messageId: 'addAwait',
fix: fixer =>
isHighPrecendence
isHighPrecedence
? fixer.insertTextBefore(node, 'await ')
: [
fixer.insertTextBefore(node, 'await ('),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export default createRule<[], MessageId>({
});
}

function isUnncessaryValueInterpolation({
function isUnnecessaryValueInterpolation({
interpolation,
nextQuasi,
prevQuasi,
Expand Down Expand Up @@ -432,7 +432,7 @@ export default createRule<[], MessageId>({
}

const infos = getInterpolationInfos(node).filter(
isUnncessaryValueInterpolation,
isUnnecessaryValueInterpolation,
);

for (const reportDescriptor of getReportDescriptors(infos)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) ||
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin/src/rules/return-await.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand Down
8 changes: 4 additions & 4 deletions packages/eslint-plugin/src/util/collectUnusedVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
) {
Expand Down Expand Up @@ -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,
Expand All @@ -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.
Expand All @@ -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
) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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';
};
`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ if (returnsPromise?.call()) {
`,
'Promise.resolve() ?? false;',
`
function test(a: Promise<void> | undefinded) {
function test(a: Promise<void> | undefined) {
const foo = a ?? Promise.reject();
}
`,
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/tests/util/misc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
6 changes: 3 additions & 3 deletions packages/rule-tester/tests/RuleTester.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
`
Expand Down
4 changes: 2 additions & 2 deletions packages/type-utils/tests/requiresQuoting.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript-eslint/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down