Skip to content

Commit

Permalink
fix: typos in function names
Browse files Browse the repository at this point in the history
  • Loading branch information
robvdl committed Aug 28, 2023
1 parent b619e1a commit 05b2f9c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions src/rules/immutable-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
} from "#eslint-plugin-functional/utils/rule";
import {
findRootIdentifier,
isDefinedByMutableVaraible,
isDefinedByMutableVariable,
isInConstructor,
} from "#eslint-plugin-functional/utils/tree";
import {
Expand Down Expand Up @@ -199,7 +199,7 @@ function checkAssignmentExpression(
const rootIdentifier = findRootIdentifier(node.left.object);
if (
rootIdentifier !== undefined &&
isDefinedByMutableVaraible(rootIdentifier, context)
isDefinedByMutableVariable(rootIdentifier, context)
) {
return {
context,
Expand Down Expand Up @@ -252,7 +252,7 @@ function checkUnaryExpression(
const rootIdentifier = findRootIdentifier(node.argument.object);
if (
rootIdentifier !== undefined &&
isDefinedByMutableVaraible(rootIdentifier, context)
isDefinedByMutableVariable(rootIdentifier, context)
) {
return {
context,
Expand Down Expand Up @@ -304,7 +304,7 @@ function checkUpdateExpression(
const rootIdentifier = findRootIdentifier(node.argument.object);
if (
rootIdentifier !== undefined &&
isDefinedByMutableVaraible(rootIdentifier, context)
isDefinedByMutableVariable(rootIdentifier, context)
) {
return {
context,
Expand Down Expand Up @@ -400,7 +400,7 @@ function checkCallExpression(
const rootIdentifier = findRootIdentifier(node.callee.object);
if (
rootIdentifier === undefined ||
!isDefinedByMutableVaraible(rootIdentifier, context)
!isDefinedByMutableVariable(rootIdentifier, context)
) {
return {
context,
Expand Down Expand Up @@ -434,7 +434,7 @@ function checkCallExpression(
const rootIdentifier = findRootIdentifier(node.callee.object);
if (
rootIdentifier === undefined ||
!isDefinedByMutableVaraible(rootIdentifier, context)
!isDefinedByMutableVariable(rootIdentifier, context)
) {
return {
context,
Expand Down
14 changes: 7 additions & 7 deletions src/rules/prefer-immutable-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,20 +342,20 @@ function getAllFixers(
const fix =
fixerConfigs === false
? null
: getConfiuredFixer(node, nodeText, fixerConfigs);
: getConfiguredFixer(node, nodeText, fixerConfigs);

const suggestionFixers =
suggestionsConfigs === false
? null
: getConfiuredSuggestionFixers(node, nodeText, suggestionsConfigs);
: getConfiguredSuggestionFixers(node, nodeText, suggestionsConfigs);

return { fix, suggestionFixers };
}

/**
* Get a fixer that uses the user config.
*/
function getConfiuredFixer(
function getConfiguredFixer(
node: TSESTree.Node,
text: string,
configs: FixerConfig[],
Expand All @@ -371,7 +371,7 @@ function getConfiuredFixer(
/**
* Get a fixer that uses the user config.
*/
function getConfiuredSuggestionFixers(
function getConfiguredSuggestionFixers(
node: TSESTree.Node,
text: string,
suggestionsConfigs: SuggestionsConfig[],
Expand Down Expand Up @@ -751,7 +751,7 @@ function checkFunction(
/**
* Check if the given function node violates this rule.
*/
function checkVarible(
function checkVariable(
node: TSESTree.VariableDeclarator | TSESTree.PropertyDefinition,
context: Readonly<RuleContext<keyof typeof errorMessages, Options>>,
options: Readonly<Options>,
Expand Down Expand Up @@ -931,7 +931,7 @@ export const rule = createRule<keyof typeof errorMessages, Options>(
TSEmptyBodyFunctionExpression: checkFunction,
TSFunctionType: checkFunction,
TSMethodSignature: checkFunction,
PropertyDefinition: checkVarible,
VariableDeclarator: checkVarible,
PropertyDefinition: checkVariable,
VariableDeclarator: checkVariable,
},
);
4 changes: 2 additions & 2 deletions src/rules/type-declaration-immutability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ function getRuleToApply(
/**
* Get a fixer that uses the user config.
*/
function getConfiuredFixer<T extends TSESTree.Node>(
function getConfiguredFixer<T extends TSESTree.Node>(
node: T,
context: Readonly<RuleContext<keyof typeof errorMessages, Options>>,
configs: FixerConfig[],
Expand Down Expand Up @@ -329,7 +329,7 @@ function getResults(
const fix =
rule.fixers === false || isTSInterfaceDeclaration(node)
? null
: getConfiuredFixer(node.typeAnnotation, context, rule.fixers);
: getConfiguredFixer(node.typeAnnotation, context, rule.fixers);

return {
context,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export function getKeyOfValueInObjectExpression(
/**
* Is the given identifier defined by a mutable variable (let or var)?
*/
export function isDefinedByMutableVaraible<
export function isDefinedByMutableVariable<
Context extends RuleContext<string, BaseOptions>,
>(node: TSESTree.Identifier, context: Context) {
const services = getParserServices(context);
Expand Down

0 comments on commit 05b2f9c

Please sign in to comment.