Skip to content

Commit

Permalink
Rebased and pulled new fixer into fixer file
Browse files Browse the repository at this point in the history
  • Loading branch information
thatblindgeye committed Jul 18, 2024
1 parent 0f9d014 commit 0f005ae
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
15 changes: 15 additions & 0 deletions packages/eslint-plugin-pf-codemods/src/rules/helpers/fixers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Rule } from "eslint";
import {
JSXElement,
ImportDeclaration,
ExportNamedDeclaration,
ImportSpecifier,
Expand All @@ -8,6 +9,7 @@ import {
ImportNamespaceSpecifier,
} from "estree-jsx";
import { getEndRange } from "./getEndRange";
import { removeElement, removeEmptyLineAfter } from "./index";

export function removeSpecifierFromDeclaration(
fixer: Rule.RuleFixer,
Expand All @@ -33,3 +35,16 @@ export function removeSpecifierFromDeclaration(
}
return [fixer.removeRange([startRange, endRange])];
}

export const getRemoveElementFixes = (
context: Rule.RuleContext,
fixer: Rule.RuleFixer,
elementsToRemove: JSXElement[]
) => {
return elementsToRemove
.map((element) => [
...removeElement(fixer, element),
...removeEmptyLineAfter(context, fixer, element),
])
.flat();
};

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export * from "./findAncestor";
export * from "./fixers";
export * from "./getEndRange";
export * from "./getFromPackage";
export * from "./getRemoveElementFixes";
export * from "./getText";
export * from "./helpers";
export * from "./importAndExport";
Expand Down

0 comments on commit 0f005ae

Please sign in to comment.