Skip to content

Commit

Permalink
update message, add rule to setup rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik-Petrik committed Feb 28, 2024
1 parent af0b791 commit 223e2e8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const warningRules = [
// rules that will run before other rules (move to deprecated?)
export const setupRules = [
"applicationLauncher-deprecated",
"chip-deprecated",
"contextSelector-update-deprecatedPath",
"dropdown-update-deprecatedPath",
"datalist-remove-selectableRow",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### chip-deprecated [(#)](https://github.com/patternfly/patternfly-react/pull/10049)

Chip has been deprecated. Running the fix flag will update your imports to our deprecated package, but we suggest using Label.
Chip has been deprecated. Running the fix flag will update your imports to our deprecated package, but we suggest using Label instead.

#### Examples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@ import * as rule from './chip-deprecated';
ruleTester.run('chip-deprecated', rule, {
valid: [
{
code: `<Chip />`,
},
{
code: `import { Chip } from '@patternfly/react-core'; <Chip someOtherProp />`,
code: `import { Chip } from '@someOtherPackage';`,
},
],
invalid: [
{
code: `import { Chip } from '@patternfly/react-core'; <Chip />`,
output: `import { Chip } from '@patternfly/react-core/deprecated'; <Chip />`,
code: `import { Chip } from '@patternfly/react-core';`,
output: `import { Chip } from '@patternfly/react-core/deprecated';`,
errors: [
{
message: `Chip has been deprecated. Running the fix flag will update your imports to our deprecated package, but we suggest using Label.`,
type: 'JSXOpeningElement',
message: `Chip has been deprecated. Running the fix flag will update your imports to our deprecated package, but we suggest using Label instead.`,
type: 'ImportDeclaration',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
import { Chip } from '@patternfly/react-core';

export const ChipDeprecatedInput = () => <Chip />;
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
import { Chip } from '@patternfly/react-core/deprecated';

export const ChipDeprecatedInput = () => <Chip />;

0 comments on commit 223e2e8

Please sign in to comment.