Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik-Petrik committed Feb 27, 2024
1 parent f862be6 commit 26549cd
Show file tree
Hide file tree
Showing 15 changed files with 81 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ Out:
```jsx
%outputExample%
```

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',
},
],
},
]
],
});

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\`.`,
}
}
})
},
},
}),
};

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 />
);
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 />
);
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ Out:
```jsx
%outputExample%
```

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',
},
],
},
]
],
});

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\`.`,
}

}
})
},
},
}),
};

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 />
);
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 />
);
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ Out:
```jsx
%outputExample%
```

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',
},
],
},
]
],
});

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\`.`,
}

}
})
},
},
}),
};

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 />;
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 />;

0 comments on commit 26549cd

Please sign in to comment.