From 0a83cfd52356d504dea26ad932b3da56e885461a Mon Sep 17 00:00:00 2001 From: Cole Bemis Date: Wed, 8 Dec 2021 21:03:39 +0000 Subject: [PATCH 1/2] Replaces references to @primer/components with @primer/react --- CHANGELOG.md | 4 +- docs/rules/no-deprecated-colors.md | 10 +-- docs/rules/no-system-props.md | 6 +- package-lock.json | 2 +- .../__tests__/no-deprecated-colors.test.js | 72 +++++++++---------- src/rules/__tests__/no-system-props.test.js | 60 ++++++++-------- src/rules/no-deprecated-colors.js | 6 +- src/utils/is-primer-component.js | 2 +- 8 files changed, 81 insertions(+), 81 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8269d1eb..cf69121c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,7 +36,7 @@ ```js /* eslint primer-react/no-deprecated-colors: ["warn", {"checkAllStrings": true}] */ - import {Box} from '@primer/components' + import {Box} from '@primer/react' function ExampleComponent() { const styles = { @@ -51,7 +51,7 @@ ### Patch Changes -- [#7](https://github.com/primer/eslint-plugin-primer-react/pull/7) [`d9dfb8d`](https://github.com/primer/eslint-plugin-primer-react/commit/d9dfb8de6d6dc42efe606517db7a0dd90d5c5578) Thanks [@colebemis](https://github.com/colebemis)! - Add `skipImportCheck` option. By default, the `no-deprecated-colors` rule will only check for deprecated colors used in functions and components that are imported from `@primer/components`. You can disable this behavior by setting `skipImportCheck` to `true`. This is useful for linting custom components that pass color-related props down to Primer React components. +- [#7](https://github.com/primer/eslint-plugin-primer-react/pull/7) [`d9dfb8d`](https://github.com/primer/eslint-plugin-primer-react/commit/d9dfb8de6d6dc42efe606517db7a0dd90d5c5578) Thanks [@colebemis](https://github.com/colebemis)! - Add `skipImportCheck` option. By default, the `no-deprecated-colors` rule will only check for deprecated colors used in functions and components that are imported from `@primer/react`. You can disable this behavior by setting `skipImportCheck` to `true`. This is useful for linting custom components that pass color-related props down to Primer React components. * [#6](https://github.com/primer/eslint-plugin-primer-react/pull/6) [`dd14594`](https://github.com/primer/eslint-plugin-primer-react/commit/dd14594b05e4d800baa76771f5b911d77352a983) Thanks [@colebemis](https://github.com/colebemis)! - The `no-deprecated-colors` rule can now find deprecated colors in the following cases: diff --git a/docs/rules/no-deprecated-colors.md b/docs/rules/no-deprecated-colors.md index 98468d9f..818282cc 100644 --- a/docs/rules/no-deprecated-colors.md +++ b/docs/rules/no-deprecated-colors.md @@ -12,7 +12,7 @@ This rule disallows references to color variables that are deprecated in [Primer ```jsx /* eslint primer-react/no-deprecated-colors: "error" */ -import {Box, themeGet} from '@primer/components' +import {Box, themeGet} from '@primer/react' import styled from 'styled-components' const SystemPropExample() = () => Incorrect @@ -30,7 +30,7 @@ const ThemeGetExample = styled.div` ```jsx /* eslint primer-react/no-deprecated-colors: "error" */ -import {Box, themeGet} from '@primer/components' +import {Box, themeGet} from '@primer/react' import styled from 'styled-components' const SystemPropExample() = () => Correct @@ -48,11 +48,11 @@ const ThemeGetExample = styled.div` - `skipImportCheck` (default: `false`) - By default, the `no-deprecated-colors` rule will only check for deprecated colors used in functions and components that are imported from `@primer/components`. You can disable this behavior by setting `skipImportCheck` to `true`. This is useful for linting custom components that pass color-related props down to Primer React components. + By default, the `no-deprecated-colors` rule will only check for deprecated colors used in functions and components that are imported from `@primer/react`. You can disable this behavior by setting `skipImportCheck` to `true`. This is useful for linting custom components that pass color-related props down to Primer React components. ```js /* eslint primer-react/no-deprecated-colors: ["warn", {"skipImportCheck": true}] */ - import {Box} from '@primer/components' + import {Box} from '@primer/react' function MyBox({color, children}) { return {children} @@ -70,7 +70,7 @@ const ThemeGetExample = styled.div` ```js /* eslint primer-react/no-deprecated-colors: ["warn", {"checkAllStrings": true}] */ - import {Box} from '@primer/components' + import {Box} from '@primer/react' function ExampleComponent() { const styles = { diff --git a/docs/rules/no-system-props.md b/docs/rules/no-system-props.md index 0bc2f706..957c6599 100644 --- a/docs/rules/no-system-props.md +++ b/docs/rules/no-system-props.md @@ -14,7 +14,7 @@ This rule disallows the use of any styled-system prop on Primer components, as t ```jsx /* eslint primer-react/no-system-props: "error" */ -import {Button} from '@primer/components' +import {Button} from '@primer/react'