Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
### expandableSection-remove-isActive-prop [(#9881)](https://github.com/patternfly/patternfly-react/pull/9881)

The `isActive` prop has been removed from ExpandableSection.

#### Examples

In:

```jsx
%inputExample%
```

Out:

```jsx
%outputExample%
```

Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
const ruleTester = require("../../ruletester");
import * as rule from "./expandableSection-remove-isActive-prop";

ruleTester.run("expandableSection-remove-isActive-prop", rule, {
valid: [
{
code: `<ExpandableSection isActive />`,
},
{
code: `import { ExpandableSection } from '@patternfly/react-core'; <ExpandableSection someOtherProp />`,
},
],
invalid: [
// importing from react-core
{
code: `import { ExpandableSection } from '@patternfly/react-core'; <ExpandableSection isActive />`,
output: `import { ExpandableSection } from '@patternfly/react-core'; <ExpandableSection />`,
errors: [
{
message: `The \`isActive\` prop has been removed from ExpandableSection.`,
type: "JSXOpeningElement",
},
],
},
// importing from dist/dynamic
{
code: `import { ExpandableSection } from '@patternfly/react-core/dist/dynamic/components/ExpandableSection'; <ExpandableSection isActive />`,
output: `import { ExpandableSection } from '@patternfly/react-core/dist/dynamic/components/ExpandableSection'; <ExpandableSection />`,
errors: [
{
message: `The \`isActive\` prop has been removed from ExpandableSection.`,
type: "JSXOpeningElement",
},
],
},
// importing from dist/esm
{
code: `import { ExpandableSection } from '@patternfly/react-core/dist/esm/components/ExpandableSection'; <ExpandableSection isActive />`,
output: `import { ExpandableSection } from '@patternfly/react-core/dist/esm/components/ExpandableSection'; <ExpandableSection />`,
errors: [
{
message: `The \`isActive\` prop has been removed from ExpandableSection.`,
type: "JSXOpeningElement",
},
],
},
// importing from dist/js
{
code: `import { ExpandableSection } from '@patternfly/react-core/dist/js/components/ExpandableSection'; <ExpandableSection isActive />`,
output: `import { ExpandableSection } from '@patternfly/react-core/dist/js/components/ExpandableSection'; <ExpandableSection />`,
errors: [
{
message: `The \`isActive\` prop has been removed from ExpandableSection.`,
type: "JSXOpeningElement",
},
],
},
],
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { renameProps } from "../../helpers";

// https://github.com/patternfly/patternfly-react/pull/9881
module.exports = {
meta: { fixable: "code" },
create: renameProps({
ExpandableSection: {
isActive: {
newName: "",
message: "The `isActive` prop has been removed from ExpandableSection.",
},
},
}),
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { ExpandableSection } from "@patternfly/react-core";

export const ExpandableSectionRemoveIsActivePropInput = () => <ExpandableSection isActive />
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { ExpandableSection } from "@patternfly/react-core";

export const ExpandableSectionRemoveIsActivePropInput = () => (
<ExpandableSection />
);
Loading