-
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.
- Loading branch information
1 parent
f862be6
commit 26549cd
Showing
15 changed files
with
81 additions
and
78 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,3 @@ Out: | |
```jsx | ||
%outputExample% | ||
``` | ||
|
23 changes: 12 additions & 11 deletions
23
...mods/src/rules/v6/pageRenameIsTertiaryNavGrouped/page-rename-isTertiaryNavGrouped.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 |
---|---|---|
@@ -1,24 +1,25 @@ | ||
const ruleTester = require('../../ruletester'); | ||
import * as rule from './page-rename-isTertiaryNavGrouped'; | ||
|
||
ruleTester.run("page-rename-isTertiaryNavGrouped", rule, { | ||
ruleTester.run('page-rename-isTertiaryNavGrouped', rule, { | ||
valid: [ | ||
{ | ||
code: `<Page isTertiaryNavGrouped />` | ||
code: `<Page isTertiaryNavGrouped />`, | ||
}, | ||
{ | ||
code: `import { Page } from '@patternfly/react-core'; <Page someOtherProp />` | ||
} | ||
code: `import { Page } from '@patternfly/react-core'; <Page someOtherProp />`, | ||
}, | ||
], | ||
invalid: [ | ||
{ | ||
code: `import { Page } from '@patternfly/react-core'; <Page isTertiaryNavGrouped />`, | ||
code: `import { Page } from '@patternfly/react-core'; <Page isTertiaryNavGrouped />`, | ||
output: `import { Page } from '@patternfly/react-core'; <Page isHorizontalSubnavGrouped />`, | ||
errors: [{ | ||
message: `We've renamed the \`isTertiaryNavGrouped\` prop to \`isHorizontalSubnavGrouped\`.`, | ||
type: "JSXOpeningElement", | ||
}] | ||
errors: [ | ||
{ | ||
message: `We've renamed the \`isTertiaryNavGrouped\` prop to \`isHorizontalSubnavGrouped\`.`, | ||
type: 'JSXOpeningElement', | ||
}, | ||
], | ||
}, | ||
] | ||
], | ||
}); | ||
|
17 changes: 8 additions & 9 deletions
17
...-codemods/src/rules/v6/pageRenameIsTertiaryNavGrouped/page-rename-isTertiaryNavGrouped.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 |
---|---|---|
@@ -1,16 +1,15 @@ | ||
import { renameProps } from '../../helpers'; | ||
|
||
// https://github.com/patternfly/patternfly-react/pull/9948 | ||
module.exports = { | ||
meta: { fixable: 'code' }, | ||
create: renameProps({ | ||
Page:{ | ||
"isTertiaryNavGrouped":{ | ||
newName:"isHorizontalSubnavGrouped", | ||
message:() => | ||
Page: { | ||
isTertiaryNavGrouped: { | ||
newName: 'isHorizontalSubnavGrouped', | ||
message: () => | ||
`We've renamed the \`isTertiaryNavGrouped\` prop to \`isHorizontalSubnavGrouped\`.`, | ||
} | ||
} | ||
}) | ||
}, | ||
}, | ||
}), | ||
}; | ||
|
6 changes: 4 additions & 2 deletions
6
...emods/src/rules/v6/pageRenameIsTertiaryNavGrouped/pageRenameIsTertiaryNavGroupedInput.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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import { Page } from "@patternfly/react-core"; | ||
import { Page } from '@patternfly/react-core'; | ||
|
||
export const PageRenameIsTertiaryNavGroupedInput = () => <Page isTertiaryNavGrouped /> | ||
export const PageRenameIsTertiaryNavGroupedInput = () => ( | ||
<Page isTertiaryNavGrouped /> | ||
); |
6 changes: 4 additions & 2 deletions
6
...mods/src/rules/v6/pageRenameIsTertiaryNavGrouped/pageRenameIsTertiaryNavGroupedOutput.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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import { Page } from "@patternfly/react-core"; | ||
import { Page } from '@patternfly/react-core'; | ||
|
||
export const PageRenameIsTertiaryNavGroupedInput = () => <Page isHorizontalSubnavGrouped /> | ||
export const PageRenameIsTertiaryNavGroupedInput = () => ( | ||
<Page isHorizontalSubnavGrouped /> | ||
); |
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 |
---|---|---|
|
@@ -15,4 +15,3 @@ Out: | |
```jsx | ||
%outputExample% | ||
``` | ||
|
23 changes: 12 additions & 11 deletions
23
...ules/v6/pageRenameIsTertiaryNavWidthLimited/page-rename-isTertiaryNavWidthLimited.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 |
---|---|---|
@@ -1,24 +1,25 @@ | ||
const ruleTester = require('../../ruletester'); | ||
import * as rule from './page-rename-isTertiaryNavWidthLimited'; | ||
|
||
ruleTester.run("page-rename-isTertiaryNavWidthLimited", rule, { | ||
ruleTester.run('page-rename-isTertiaryNavWidthLimited', rule, { | ||
valid: [ | ||
{ | ||
code: `<Page isTertiaryNavWidthLimited />` | ||
code: `<Page isTertiaryNavWidthLimited />`, | ||
}, | ||
{ | ||
code: `import { Page } from '@patternfly/react-core'; <Page someOtherProp />` | ||
} | ||
code: `import { Page } from '@patternfly/react-core'; <Page someOtherProp />`, | ||
}, | ||
], | ||
invalid: [ | ||
{ | ||
code: `import { Page } from '@patternfly/react-core'; <Page isTertiaryNavWidthLimited />`, | ||
code: `import { Page } from '@patternfly/react-core'; <Page isTertiaryNavWidthLimited />`, | ||
output: `import { Page } from '@patternfly/react-core'; <Page isHorizontalSubnavWidthLimited />`, | ||
errors: [{ | ||
message: `We've renamed the \`isTertiaryNavWidthLimited\` prop to \`isHorizontalSubnavWidthLimited\`.`, | ||
type: "JSXOpeningElement", | ||
}] | ||
errors: [ | ||
{ | ||
message: `We've renamed the \`isTertiaryNavWidthLimited\` prop to \`isHorizontalSubnavWidthLimited\`.`, | ||
type: 'JSXOpeningElement', | ||
}, | ||
], | ||
}, | ||
] | ||
], | ||
}); | ||
|
20 changes: 9 additions & 11 deletions
20
...src/rules/v6/pageRenameIsTertiaryNavWidthLimited/page-rename-isTertiaryNavWidthLimited.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 |
---|---|---|
@@ -1,17 +1,15 @@ | ||
import {renameProps } from '../../helpers'; | ||
import { renameProps } from '../../helpers'; | ||
|
||
// https://github.com/patternfly/patternfly-react/pull/9948 | ||
module.exports = { | ||
meta: { fixable: 'code' }, | ||
create: renameProps({ | ||
Page:{ | ||
"isTertiaryNavWidthLimited":{ | ||
newName:"isHorizontalSubnavWidthLimited", | ||
message:() => | ||
Page: { | ||
isTertiaryNavWidthLimited: { | ||
newName: 'isHorizontalSubnavWidthLimited', | ||
message: () => | ||
`We've renamed the \`isTertiaryNavWidthLimited\` prop to \`isHorizontalSubnavWidthLimited\`.`, | ||
} | ||
|
||
} | ||
}) | ||
}, | ||
}, | ||
}), | ||
}; | ||
|
6 changes: 4 additions & 2 deletions
6
...rules/v6/pageRenameIsTertiaryNavWidthLimited/pageRenameIsTertiaryNavWidthLimitedInput.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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import { Page } from "@patternfly/react-core"; | ||
import { Page } from '@patternfly/react-core'; | ||
|
||
export const PageRenameIsTertiaryNavWidthLimitedInput = () => <Page isTertiaryNavWidthLimited /> | ||
export const PageRenameIsTertiaryNavWidthLimitedInput = () => ( | ||
<Page isTertiaryNavWidthLimited /> | ||
); |
6 changes: 4 additions & 2 deletions
6
...ules/v6/pageRenameIsTertiaryNavWidthLimited/pageRenameIsTertiaryNavWidthLimitedOutput.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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import { Page } from "@patternfly/react-core"; | ||
import { Page } from '@patternfly/react-core'; | ||
|
||
export const PageRenameIsTertiaryNavWidthLimitedInput = () => <Page isHorizontalSubnavWidthLimited /> | ||
export const PageRenameIsTertiaryNavWidthLimitedInput = () => ( | ||
<Page isHorizontalSubnavWidthLimited /> | ||
); |
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 |
---|---|---|
|
@@ -15,4 +15,3 @@ Out: | |
```jsx | ||
%outputExample% | ||
``` | ||
|
23 changes: 12 additions & 11 deletions
23
...int-plugin-pf-codemods/src/rules/v6/pageRenameTertiaryNav/page-rename-tertiaryNav.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 |
---|---|---|
@@ -1,24 +1,25 @@ | ||
const ruleTester = require('../../ruletester'); | ||
import * as rule from './page-rename-tertiaryNav'; | ||
|
||
ruleTester.run("page-rename-tertiaryNav", rule, { | ||
ruleTester.run('page-rename-tertiaryNav', rule, { | ||
valid: [ | ||
{ | ||
code: `<Page tertiaryNav />` | ||
code: `<Page tertiaryNav />`, | ||
}, | ||
{ | ||
code: `import { Page } from '@patternfly/react-core'; <Page someOtherProp />` | ||
} | ||
code: `import { Page } from '@patternfly/react-core'; <Page someOtherProp />`, | ||
}, | ||
], | ||
invalid: [ | ||
{ | ||
code: `import { Page } from '@patternfly/react-core'; <Page tertiaryNav />`, | ||
code: `import { Page } from '@patternfly/react-core'; <Page tertiaryNav />`, | ||
output: `import { Page } from '@patternfly/react-core'; <Page horizontalSubnav />`, | ||
errors: [{ | ||
message: `We've renamed the \`tertiaryNav\` prop to \`horizontalSubnav\`.`, | ||
type: "JSXOpeningElement", | ||
}] | ||
errors: [ | ||
{ | ||
message: `We've renamed the \`tertiaryNav\` prop to \`horizontalSubnav\`.`, | ||
type: 'JSXOpeningElement', | ||
}, | ||
], | ||
}, | ||
] | ||
], | ||
}); | ||
|
18 changes: 8 additions & 10 deletions
18
...s/eslint-plugin-pf-codemods/src/rules/v6/pageRenameTertiaryNav/page-rename-tertiaryNav.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 |
---|---|---|
@@ -1,17 +1,15 @@ | ||
import { getFromPackage, renameProps } from '../../helpers'; | ||
|
||
// https://github.com/patternfly/patternfly-react/pull/9948 | ||
module.exports = { | ||
meta: { fixable: 'code' }, | ||
create: renameProps({ | ||
Page:{ | ||
"tertiaryNav":{ | ||
newName:"horizontalSubnav", | ||
message:() => | ||
Page: { | ||
tertiaryNav: { | ||
newName: 'horizontalSubnav', | ||
message: () => | ||
`We've renamed the \`tertiaryNav\` prop to \`horizontalSubnav\`.`, | ||
} | ||
|
||
} | ||
}) | ||
}, | ||
}, | ||
}), | ||
}; | ||
|
4 changes: 2 additions & 2 deletions
4
...lint-plugin-pf-codemods/src/rules/v6/pageRenameTertiaryNav/pageRenameTertiaryNavInput.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { Page } from "@patternfly/react-core"; | ||
import { Page } from '@patternfly/react-core'; | ||
|
||
export const PageRenameTertiaryNavInput = () => <Page tertiaryNav /> | ||
export const PageRenameTertiaryNavInput = () => <Page tertiaryNav />; |
4 changes: 2 additions & 2 deletions
4
...int-plugin-pf-codemods/src/rules/v6/pageRenameTertiaryNav/pageRenameTertiaryNavOutput.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { Page } from "@patternfly/react-core"; | ||
import { Page } from '@patternfly/react-core'; | ||
|
||
export const PageRenameTertiaryNavInput = () => <Page horizontalSubnav /> | ||
export const PageRenameTertiaryNavInput = () => <Page horizontalSubnav />; |