Skip to content

Commit

Permalink
Remove unused error reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoespeon committed Oct 30, 2024
1 parent 79a68b7 commit 0865ddd
Showing 1 changed file with 0 additions and 46 deletions.
46 changes: 0 additions & 46 deletions src/editor/error-reason.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,11 @@ export enum ErrorReason {
DidNotFindIdentifiersToRename,
DidNotFindStatementToToggleBraces,
DidNotFindTypeToExtract,
CantImportReferences,
DidNotFindOtherFiles,
CanNotExtractClass,
DidNotFindFunctionDeclarationToConvert,
CantConvertFunctionDeclarationBecauseUsedBefore,
DidNotFindLetToConvertToConst,
DidNotFindSwitchToConvert,
DidNotFindJsxAttributeToAddBracesTo,
DidNotFindBracesToRemove,
DidNotFindClassToExtractInterface,
DidNotFindReactComponent,
DidNotFindIfStatementToAddBraces,
DidNotFindDeadCode,
DidNotFindForEachToConvertToForOf,
DidNotFindForLoopToConvert,
Expand All @@ -38,9 +31,6 @@ export enum ErrorReason {
DidNotFindIfElseToConvert,
DidNotFindTernaryToConvert,
CantConvertTernaryWithOtherDeclarations,
DidNotFindArrowFunctionToAddBraces,
DidNotFindBracesToRemoveFromArrowFunction,
DidNotFindBracesToRemoveFromIfStatement,
DidNotFindIfStatementToSplit,
DidNotFindIfStatementsToMerge,
DidNotFindDeclarationToSplit,
Expand All @@ -51,7 +41,6 @@ export enum ErrorReason {
CantMoveMultiLinesStatementDown,
CantInlineExportedVariables,
CantInlineRedeclaredVariables,
CantRemoveBracesFromArrowFunction,
CantRemoveExportedFunction,
CantInlineFunctionWithMultipleReturns,
CantInlineAssignedFunctionWithoutReturn,
Expand Down Expand Up @@ -90,17 +79,6 @@ export function toString(reason: ErrorReason): string {
case ErrorReason.DidNotFindTypeToExtract:
return didNotFind("a type to extract");

case ErrorReason.CantImportReferences:
return cantDoIt(
"move this, it has references that can't be imported (circular reference)"
);

case ErrorReason.DidNotFindOtherFiles:
return didNotFind("other files in the workspace");

case ErrorReason.CanNotExtractClass:
return didNotFind("a class to extract");

case ErrorReason.DidNotFindFunctionDeclarationToConvert:
return didNotFind("a function declaration to convert");

Expand All @@ -115,21 +93,9 @@ export function toString(reason: ErrorReason): string {
case ErrorReason.DidNotFindSwitchToConvert:
return didNotFind("a switch statement to convert");

case ErrorReason.DidNotFindJsxAttributeToAddBracesTo:
return didNotFind("a jsx attribute to add braces to");

case ErrorReason.DidNotFindBracesToRemove:
return didNotFind("braces to remove from jsx attribute");

case ErrorReason.DidNotFindClassToExtractInterface:
return didNotFind("a class to extract the interface");

case ErrorReason.DidNotFindReactComponent:
return didNotFind("a React component to convert");

case ErrorReason.DidNotFindIfStatementToAddBraces:
return didNotFind("a valid if statement to add braces to");

case ErrorReason.DidNotFindDeadCode:
return didNotFind("dead code to delete");

Expand Down Expand Up @@ -181,15 +147,6 @@ export function toString(reason: ErrorReason): string {
case ErrorReason.CantConvertTernaryWithOtherDeclarations:
return cantDoIt("convert a ternary declared along other variables");

case ErrorReason.DidNotFindArrowFunctionToAddBraces:
return didNotFind("an arrow function to add braces");

case ErrorReason.DidNotFindBracesToRemoveFromArrowFunction:
return didNotFind("braces to remove");

case ErrorReason.DidNotFindBracesToRemoveFromIfStatement:
return didNotFind("braces to remove");

case ErrorReason.DidNotFindIfStatementToSplit:
return didNotFind("an if statement that can be split");

Expand Down Expand Up @@ -220,9 +177,6 @@ export function toString(reason: ErrorReason): string {
case ErrorReason.CantInlineRedeclaredVariables:
return cantDoIt("inline redeclared variables yet");

case ErrorReason.CantRemoveBracesFromArrowFunction:
return cantDoIt("remove braces from this arrow function");

case ErrorReason.CantRemoveExportedFunction:
return "I didn't remove the function because it's exported 🤓";

Expand Down

0 comments on commit 0865ddd

Please sign in to comment.