Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
thatblindgeye committed May 28, 2024
1 parent 20b24af commit 909e931
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ module.exports = {
create: function (context: Rule.RuleContext) {
const { imports } = getFromPackage(context, "@patternfly/react-core");

const componentImports = imports.find(
const bannerImport = imports.find(
(specifier) => specifier.imported.name === "Banner"
);

return !componentImports
return !bannerImport
? {}
: {
JSXOpeningElement(node: JSXOpeningElement) {
if (
node.name.type === "JSXIdentifier" &&
componentImports.local.name === node.name.name
bannerImport.local.name === node.name.name
) {
const attribute = getAttribute(node, "variant");
if (!attribute) {
Expand All @@ -37,7 +37,7 @@ module.exports = {
node,
message: `The variant property has been removed from Banner. We recommend using our new color or status properties, depending on the original intent of the variant property. Running the fix for this rule will ${fixMessage}, but additional manual updates may need to be made.`,
fix(fixer) {
if (attributeValue === "default") {
if (isValueDefault) {
return fixer.replaceText(attribute, "");
}

Expand Down

0 comments on commit 909e931

Please sign in to comment.