-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(EmptyState): Add auto fix support for some child components (#703)
- Loading branch information
1 parent
8f471b4
commit f80f157
Showing
6 changed files
with
333 additions
and
88 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
packages/eslint-plugin-pf-codemods/src/rules/helpers/getRemoveElementFixes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Rule } from "eslint"; | ||
import { JSXElement } from "estree-jsx"; | ||
import { removeElement, removeEmptyLineAfter } from "./index"; | ||
|
||
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 contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.