-
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(Masthead): Remove backgroundColor prop
- Loading branch information
1 parent
18edec9
commit 15df1ac
Showing
12 changed files
with
68 additions
and
80 deletions.
There are no files selected for viewing
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
18 changes: 0 additions & 18 deletions
18
packages/eslint-plugin-pf-codemods/src/rules/v6/exampleRule/example-rule.md
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
packages/eslint-plugin-pf-codemods/src/rules/v6/exampleRule/example-rule.test.ts
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
packages/eslint-plugin-pf-codemods/src/rules/v6/exampleRule/example-rule.ts
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
packages/eslint-plugin-pf-codemods/src/rules/v6/exampleRule/exampleRuleInput.tsx
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
packages/eslint-plugin-pf-codemods/src/rules/v6/exampleRule/exampleRuleOutput.tsx
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
.../src/rules/v6/mastheadRemoveBackgroundColor/masthead-remove-background-color.md
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,18 @@ | ||
### masthead-remove-background-color [(#9744)](https://github.com/patternfly/patternfly-react/pull/9744) | ||
|
||
We've removed the `backgroundColor` prop from Masthead as theming is no longer handled React-side. | ||
|
||
#### Examples | ||
|
||
In: | ||
|
||
```jsx | ||
%inputExample% | ||
``` | ||
|
||
Out: | ||
|
||
```jsx | ||
%outputExample% | ||
``` | ||
|
21 changes: 21 additions & 0 deletions
21
...emods/src/rules/v6/mastheadRemoveBackgroundColor/masthead-remove-background-color.test.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,21 @@ | ||
const ruleTester = require('../../ruletester'); | ||
import * as rule from './masthead-remove-background-color'; | ||
|
||
ruleTester.run("masthead-remove-background-color", rule, { | ||
valid: [ | ||
{ | ||
code: `<Masthead backgroundColor />` | ||
} | ||
], | ||
invalid: [ | ||
{ | ||
code: `import { Masthead } from '@patternfly/react-core'; <Masthead backgroundColor />`, | ||
output: `import { Masthead } from '@patternfly/react-core'; <Masthead />`, | ||
errors: [{ | ||
message: `We've removed the \`backgroundColor\` prop from Masthead as theming is no longer handled React-side.`, | ||
type: "JSXOpeningElement", | ||
}] | ||
}, | ||
] | ||
}); | ||
|
16 changes: 16 additions & 0 deletions
16
...f-codemods/src/rules/v6/mastheadRemoveBackgroundColor/masthead-remove-background-color.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 { renameProps } from '../../helpers'; | ||
|
||
// https://github.com/patternfly/patternfly-react/pull/9744 | ||
module.exports = { | ||
meta: { fixable: 'code' }, | ||
create: renameProps({ | ||
Masthead: { | ||
"backgroundColor": { | ||
newName: "", | ||
message: () => | ||
"We've removed the `backgroundColor` prop from Masthead as theming is no longer handled React-side.", | ||
}, | ||
}, | ||
}), | ||
}; | ||
|
3 changes: 3 additions & 0 deletions
3
...odemods/src/rules/v6/mastheadRemoveBackgroundColor/mastheadRemoveBackgroundColorInput.tsx
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,3 @@ | ||
import { Masthead } from "@patternfly/react-core"; | ||
|
||
export const MastheadRemoveBackgroundColorInput = () => <Masthead backgroundColor /> |
3 changes: 3 additions & 0 deletions
3
...demods/src/rules/v6/mastheadRemoveBackgroundColor/mastheadRemoveBackgroundColorOutput.tsx
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,3 @@ | ||
import { Masthead } from "@patternfly/react-core"; | ||
|
||
export const MastheadRemoveBackgroundColorInput = () => <Masthead /> |
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