Skip to content

Commit

Permalink
fixup! Fix Biome lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
connor-baer committed Jun 24, 2024
1 parent 98c4a14 commit 7610618
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 41 deletions.
58 changes: 29 additions & 29 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ This change might break tests that use `@testing-library/jest-dom`'s [`toBeDisab

```js
// jest.setup.js
import { toBeDisabled, toBeEnabled } from "@testing-library/jest-dom/matchers";
import { toBeDisabled, toBeEnabled } from '@testing-library/jest-dom/matchers';

function isAriaDisabled(element) {
return (
element.hasAttribute("aria-disabled") &&
element.getAttribute("aria-disabled") === "true"
element.hasAttribute('aria-disabled') &&
element.getAttribute('aria-disabled') === 'true'
);
}

Expand All @@ -152,17 +152,17 @@ expect.extend({
return {
pass: isDisabled,
message: () => {
const is = isDisabled ? "is" : "is not";
const is = isDisabled ? 'is' : 'is not';
return [
this.utils.matcherHint(
`${this.isNot ? ".not" : ""}.toBeDisabled`,
"element",
""
`${this.isNot ? '.not' : ''}.toBeDisabled`,
'element',
''
),
"",
'',
`Received element ${is} disabled:`,
` ${this.utils.printReceived(element.cloneNode(false))}`,
].join("\n");
].join('\n');
},
};
},
Expand All @@ -173,17 +173,17 @@ expect.extend({
return {
pass: isEnabled,
message: () => {
const is = isEnabled ? "is" : "is not";
const is = isEnabled ? 'is' : 'is not';
return [
this.utils.matcherHint(
`${this.isNot ? ".not" : ""}.toBeEnabled`,
"element",
""
`${this.isNot ? '.not' : ''}.toBeEnabled`,
'element',
''
),
"",
'',
`Received element ${is} enabled:`,
` ${this.utils.printReceived(element.cloneNode(false))}`,
].join("\n");
].join('\n');
},
};
},
Expand Down Expand Up @@ -331,7 +331,7 @@ For applications that don’t use Emotion.js, Circuit UI exports a new, smaller
<summary>Example</summary>

```tsx
import { clsx, utilClasses } from "@sumup/circuit-ui";
import { clsx, utilClasses } from '@sumup/circuit-ui';

function Component() {
return <div className={clsx(utilClasses.center, utilClasses.hideVisually)} />;
Expand Down Expand Up @@ -793,8 +793,8 @@ Previously, many apps would use `CreateStyled`:

```ts
// utils/styled.ts
import styled, { CreateStyled } from "@emotion/styled";
import { Theme } from "@sumup/design-tokens";
import styled, { CreateStyled } from '@emotion/styled';
import { Theme } from '@sumup/design-tokens';
export default styled as CreateStyled<Theme>;
```
Expand All @@ -803,9 +803,9 @@ export default styled as CreateStyled<Theme>;
```tsx
// components/RedCard.tsx
import { css } from "@emotion/core";
import { css } from '@emotion/core';
import styled from "util/styled";
import styled from 'util/styled';
const RedCard = styled(Card)(
({ theme }) => css`
Expand All @@ -818,10 +818,10 @@ Now, you can type the theme by adding it to `@emotion/react`'s declaration:
```ts
// types/emotion.d.ts (don't forget to include this file in tsconfig.json under `typeRoots`)
import { Theme as CircuitTheme } from "@sumup/design-tokens";
import {} from "@emotion/react/types/css-prop"; // See https://github.com/emotion-js/emotion/pull/1941
import { Theme as CircuitTheme } from '@sumup/design-tokens';
import {} from '@emotion/react/types/css-prop'; // See https://github.com/emotion-js/emotion/pull/1941
declare module "@emotion/react" {
declare module '@emotion/react' {
export interface Theme extends CircuitTheme {}
}
```
Expand All @@ -830,8 +830,8 @@ declare module "@emotion/react" {
```tsx
// components/RedCard.tsx
import { css } from "@emotion/core";
import styled from "@emotion/styled";
import { css } from '@emotion/core';
import styled from '@emotion/styled';
const RedCard = styled(Card)(
({ theme }) => css`
Expand All @@ -849,17 +849,17 @@ Make sure that references to Emotion packages inside Storybook are pointing to t
```js
// .storybook/main.js
const path = require("path");
const path = require('path');
const toPath = (_path) => path.join(process.cwd(), _path);
module.exports = {
webpackFinal: async (config) => {
// Add compatibility with Emotion 11
config.resolve.alias = {
...config.resolve.alias,
"@emotion/core": toPath("node_modules/@emotion/react"),
"@emotion/styled": toPath("node_modules/@emotion/styled"),
"emotion-theming": toPath("node_modules/@emotion/react"),
'@emotion/core': toPath('node_modules/@emotion/react'),
'@emotion/styled': toPath('node_modules/@emotion/styled'),
'emotion-theming': toPath('node_modules/@emotion/react'),
};
return config;
},
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
"name": "circuit-ui-web",
"description": "The web implementation of Circuit UI, SumUp's design system",
"private": true,
"workspaces": ["packages/*", "packages/cna-template/template"],
"workspaces": [
"packages/*",
"packages/cna-template/template"
],
"repository": {
"type": "git",
"url": "git+https://github.com/sumup-oss/circuit-ui.git"
Expand Down
2 changes: 1 addition & 1 deletion packages/circuit-ui/components/Calendar/CalendarService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* limitations under the License.
*/

// biome-ignore lint/suspicious/noShadowRestrictedNames: <explanation>
// biome-ignore lint/suspicious/noShadowRestrictedNames: Necessary to add support for Temporal objects to the`Intl` APIs
import { Temporal, Intl } from 'temporal-polyfill';

import type { Locale } from '../../util/i18n.js';
Expand Down
12 changes: 9 additions & 3 deletions packages/circuit-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@
},
"typesVersions": {
"*": {
"legacy": ["./dist/legacy.d.ts"],
"experimental": ["./dist/experimental.d.ts"]
"legacy": [
"./dist/legacy.d.ts"
],
"experimental": [
"./dist/experimental.d.ts"
]
}
},
"sideEffects": false,
"files": ["dist"],
"files": [
"dist"
],
"repository": {
"type": "git",
"directory": "packages/circuit-ui",
Expand Down
1 change: 0 additions & 1 deletion packages/circuit-ui/util/promises.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
/**
* Forces any function to be asynchronous in a type-safe manner.
*/
// biome-ignore lint/suspicious/useAwait: <explanation>
export async function promisify<T>(fn: () => T | Promise<T>): Promise<T> {
return fn();
}
5 changes: 4 additions & 1 deletion packages/design-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"module": "dist/es/index.js",
"types": "dist/es/index.d.ts",
"sideEffects": false,
"files": ["dist", "*.css"],
"files": [
"dist",
"*.css"
],
"repository": {
"type": "git",
"directory": "packages/design-tokens",
Expand Down
11 changes: 9 additions & 2 deletions packages/eslint-plugin-circuit-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
"name": "@sumup/eslint-plugin-circuit-ui",
"version": "4.1.0",
"description": "ESLint rules to lint Circuit UI.",
"keywords": ["sumup", "circuit-ui", "eslint", "eslint-plugin"],
"keywords": [
"sumup",
"circuit-ui",
"eslint",
"eslint-plugin"
],
"main": "dist/index.js",
"files": ["dist"],
"files": [
"dist"
],
"repository": {
"type": "git",
"directory": "packages/eslint-plugin-circuit-ui",
Expand Down
6 changes: 5 additions & 1 deletion packages/icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
"./*.svg": "./web/v2/*.svg"
},
"sideEffects": false,
"files": ["dist", "web", "manifest.json"],
"files": [
"dist",
"web",
"manifest.json"
],
"repository": {
"type": "git",
"directory": "packages/icons",
Expand Down
11 changes: 9 additions & 2 deletions packages/stylelint-plugin-circuit-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@
"description": "Stylelint rules to lint Circuit UI.",
"exports": "./dist/index.js",
"type": "module",
"keywords": ["sumup", "circuit-ui", "stylelint", "stylelint-plugin"],
"keywords": [
"sumup",
"circuit-ui",
"stylelint",
"stylelint-plugin"
],
"main": "./dist/index.js",
"files": ["dist"],
"files": [
"dist"
],
"repository": {
"type": "git",
"directory": "packages/stylelint-plugin-circuit-ui",
Expand Down

0 comments on commit 7610618

Please sign in to comment.