Skip to content

Commit

Permalink
components: Restrict imports of @emotion/css (#33051)
Browse files Browse the repository at this point in the history
* Add @emotion/css to restricted imports list

* Temporarily disable no-restricted-imports for @emotion/css
  • Loading branch information
sarayourfriend authored Jun 29, 2021
1 parent 24bf362 commit b6a8a28
Show file tree
Hide file tree
Showing 48 changed files with 149 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ module.exports = {
message:
'`puppeteer-testing-library` is still experimental.',
},
{
name: '@emotion/css',
message:
'Please use `@emotion/react` and `@emotion/styled` in order to maintain iframe support',
},
],
},
],
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/base-field/hook.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { cx } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/base-field/styles.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/card/card-body/hook.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { cx } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/card/card-divider/hook.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { cx } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/card/card-footer/hook.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { cx } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/card/card-header/hook.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { cx } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/card/card-media/hook.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { cx } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/card/card/component.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/card/card/hook.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { cx } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/card/styles.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/divider/component.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css, cx } from '@emotion/css';
// eslint-disable-next-line no-restricted-imports
import { Separator } from 'reakit';
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/divider/styles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/elevation/hook.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css, cx } from '@emotion/css';
import { isNil } from 'lodash';

Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/elevation/styles.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css } from '@emotion/css';

export const Elevation = css`
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/flex/flex-item/hook.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css, cx } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/flex/flex/hook.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css, cx } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/flex/styles.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css } from '@emotion/css';

export const Flex = css`
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/grid/hook.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css, cx } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/scrollable/hook.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { cx } from '@emotion/css';

/**
Expand Down
4 changes: 4 additions & 0 deletions packages/components/src/scrollable/styles.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css } from '@emotion/css';

/**
* Internal dependencies
*/
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/spacer/hook.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css, cx } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/surface/hook.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { cx } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/surface/styles.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/text/hook.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css, cx } from '@emotion/css';
import { isPlainObject } from 'lodash';

Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/text/styles.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/truncate/hook.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css, cx } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/truncate/styles.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css } from '@emotion/css';

export const Truncate = css`
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/ui/context/use-context-system.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { cx } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/ui/control-group/hook.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { cx } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/ui/control-group/styles.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css } from '@emotion/css';

export const first = css`
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/ui/control-label/hook.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { cx } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/ui/control-label/styles.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/ui/form-group/form-group-styles.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css } from '@emotion/css';

export const FormGroup = css`
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/ui/form-group/use-form-group.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { cx } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/ui/item-group/styles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/ui/item-group/use-item-group.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { cx } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/ui/item-group/use-item.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { cx } from '@emotion/css';

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/ui/popover/content.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* External dependencies
*/
// Disable reason: Temporarily disable for existing usages
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css
// eslint-disable-next-line no-restricted-imports
import { css, cx } from '@emotion/css';
// eslint-disable-next-line no-restricted-imports
import { Popover as ReakitPopover } from 'reakit';
Expand Down
Loading

0 comments on commit b6a8a28

Please sign in to comment.