Skip to content

Commit 29b44c3

Browse files
committed
fixes from core review comments
1 parent d1796ba commit 29b44c3

11 files changed

+114
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const ruleTester = require("../../ruletester");
2+
import * as rule from "./dataListAction-remove-isPlainButtonAction-prop";
3+
4+
ruleTester.run("dataListAction-remove-isPlainButtonAction-prop", rule, {
5+
valid: [
6+
{
7+
code: `<DataListAction isPlainButtonAction />`,
8+
},
9+
{
10+
code: `import { DataListAction } from '@patternfly/react-core'; <DataListAction someOtherProp />`,
11+
},
12+
],
13+
invalid: [
14+
{
15+
code: `import { DataListAction } from '@patternfly/react-core'; <DataListAction isPlainButtonAction />`,
16+
output: `import { DataListAction } from '@patternfly/react-core'; <DataListAction />`,
17+
errors: [
18+
{
19+
message: `The \`isPlainButtonAction\` prop has been removed from DataListAction as a wrapper is no longer needed .`,
20+
type: "JSXOpeningElement",
21+
},
22+
],
23+
},
24+
],
25+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const ruleTester = require("../../ruletester");
2+
import * as rule from "./dataListAction-remove-isPlainButtonAction-prop";
3+
4+
ruleTester.run("dataListAction-remove-isPlainButtonAction-prop", rule, {
5+
valid: [
6+
{
7+
code: `<DataListAction isPlainButtonAction />`,
8+
},
9+
{
10+
code: `import { DataListAction } from '@patternfly/react-core'; <DataListAction someOtherProp />`,
11+
},
12+
],
13+
invalid: [
14+
{
15+
code: `import { DataListAction } from '@patternfly/react-core'; <DataListAction isPlainButtonAction />`,
16+
output: `import { DataListAction } from '@patternfly/react-core'; <DataListAction />`,
17+
errors: [
18+
{
19+
message: `The \`isPlainButtonAction\` prop has been removed from DataListAction as a wrapper is no longer needed.`,
20+
type: "JSXOpeningElement",
21+
},
22+
],
23+
},
24+
],
25+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
### dataListAction-remove-isPlainButtonAction-prop [(#10939)](https://github.com/patternfly/patternfly-react/pull/10939)
2+
3+
The `isPlainButtonAction` prop has been removed from DataListAction as a wrapper is no longer needed when there is a plain button action.
4+
5+
#### Examples
6+
7+
In:
8+
9+
```jsx
10+
%inputExample%
11+
```
12+
13+
Out:
14+
15+
```jsx
16+
%outputExample%
17+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
### dataListAction-remove-isPlainButtonAction-prop [(#10939)](https://github.com/patternfly/patternfly-react/pull/10939)
2+
3+
The `isPlainButtonAction` prop has been removed from DataListAction as a wrapper is no longer needed.
4+
5+
#### Examples
6+
7+
In:
8+
9+
```jsx
10+
%inputExample%
11+
```
12+
13+
Out:
14+
15+
```jsx
16+
%outputExample%
17+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { renameProps } from "../../helpers";
2+
3+
// https://github.com/patternfly/patternfly-react/pull/10939
4+
module.exports = {
5+
meta: { fixable: "code" },
6+
create: renameProps({
7+
DataListAction: {
8+
isPlainButtonAction: {
9+
newName: "",
10+
message:
11+
"The `isPlainButtonAction` prop has been removed from DataListAction as a wrapper is no longer needed.",
12+
},
13+
},
14+
}),
15+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { DataListAction } from "@patternfly/react-core";
2+
3+
export const DataListActionRemoveIsPlainButtonActionPropInput = () => (
4+
<DataListAction isPlainButtonAction/>
5+
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { DataListAction } from "@patternfly/react-core";
2+
3+
export const DataListActionRemoveIsPlainButtonActionPropInput = () => (
4+
<DataListAction isPlainButtonAction/>
5+
);

packages/eslint-plugin-pf-codemods/src/rules/v6/dataListActionRemoveIsPlainButtonActionProp/dataListAction-remove-isPlainButtonAction-prop.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
### dataListAction-remove-isPlainButtonAction-prop [(#10939)](https://github.com/patternfly/patternfly-react/pull/10934)
1+
### dataListAction-remove-isPlainButtonAction-prop [(#10939)](https://github.com/patternfly/patternfly-react/pull/10939)
22

3-
The `isPlainButtonAction` prop has been removed from DataListAction as a wrapper is no longer needed when there is a plain button action.
3+
The `isPlainButtonAction` prop has been removed from DataListAction as a wrapper is no longer needed.
44

55
#### Examples
66

packages/eslint-plugin-pf-codemods/src/rules/v6/dataListActionRemoveIsPlainButtonActionProp/dataListAction-remove-isPlainButtonAction-prop.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ruleTester.run("dataListAction-remove-isPlainButtonAction-prop", rule, {
1616
output: `import { DataListAction } from '@patternfly/react-core'; <DataListAction />`,
1717
errors: [
1818
{
19-
message: `The \`isPlainButtonAction\` prop has been removed from DataListAction as a wrapper is no longer needed when there is a plain button action.`,
19+
message: `The \`isPlainButtonAction\` prop has been removed from DataListAction as a wrapper is no longer needed.`,
2020
type: "JSXOpeningElement",
2121
},
2222
],

packages/eslint-plugin-pf-codemods/src/rules/v6/dataListActionRemoveIsPlainButtonActionProp/dataListAction-remove-isPlainButtonAction-prop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
isPlainButtonAction: {
99
newName: "",
1010
message:
11-
"The `isPlainButtonAction` prop has been removed from DataListAction as a wrapper is no longer needed when there is a plain button action.",
11+
"The `isPlainButtonAction` prop has been removed from DataListAction as a wrapper is no longer needed.",
1212
},
1313
},
1414
}),
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { DataListAction } from "@patternfly/react-core";
22

33
export const DataListActionRemoveIsPlainButtonActionPropInput = () => (
4-
<DataListAction />
4+
<DataListAction isPlainButtonAction/>
55
);

0 commit comments

Comments
 (0)