From 7610618358c9736bfc3b2c2266bd186db963b5ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Connor=20B=C3=A4r?= Date: Mon, 24 Jun 2024 14:58:04 +0200 Subject: [PATCH] fixup! Fix Biome lint issues --- MIGRATION.md | 58 +++++++++---------- package.json | 5 +- .../components/Calendar/CalendarService.ts | 2 +- packages/circuit-ui/package.json | 12 +++- packages/circuit-ui/util/promises.ts | 1 - packages/design-tokens/package.json | 5 +- .../eslint-plugin-circuit-ui/package.json | 11 +++- packages/icons/package.json | 6 +- .../stylelint-plugin-circuit-ui/package.json | 11 +++- 9 files changed, 70 insertions(+), 41 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index 5c9fc883ef..7f4ad7fa73 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -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' ); } @@ -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'); }, }; }, @@ -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'); }, }; }, @@ -331,7 +331,7 @@ For applications that don’t use Emotion.js, Circuit UI exports a new, smaller Example ```tsx -import { clsx, utilClasses } from "@sumup/circuit-ui"; +import { clsx, utilClasses } from '@sumup/circuit-ui'; function Component() { return
; @@ -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; ``` @@ -803,9 +803,9 @@ export default styled as CreateStyled; ```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` @@ -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 {} } ``` @@ -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` @@ -849,7 +849,7 @@ 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 = { @@ -857,9 +857,9 @@ module.exports = { // 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; }, diff --git a/package.json b/package.json index 41d8331a6a..5228c5c682 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/packages/circuit-ui/components/Calendar/CalendarService.ts b/packages/circuit-ui/components/Calendar/CalendarService.ts index 955b17d9a2..2bdbc71770 100644 --- a/packages/circuit-ui/components/Calendar/CalendarService.ts +++ b/packages/circuit-ui/components/Calendar/CalendarService.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -// biome-ignore lint/suspicious/noShadowRestrictedNames: +// 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'; diff --git a/packages/circuit-ui/package.json b/packages/circuit-ui/package.json index 04a79cf378..03cb0e943b 100644 --- a/packages/circuit-ui/package.json +++ b/packages/circuit-ui/package.json @@ -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", diff --git a/packages/circuit-ui/util/promises.ts b/packages/circuit-ui/util/promises.ts index 698c4b3af3..32105b7112 100644 --- a/packages/circuit-ui/util/promises.ts +++ b/packages/circuit-ui/util/promises.ts @@ -16,7 +16,6 @@ /** * Forces any function to be asynchronous in a type-safe manner. */ -// biome-ignore lint/suspicious/useAwait: export async function promisify(fn: () => T | Promise): Promise { return fn(); } diff --git a/packages/design-tokens/package.json b/packages/design-tokens/package.json index ff9c5e908d..39a426e685 100644 --- a/packages/design-tokens/package.json +++ b/packages/design-tokens/package.json @@ -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", diff --git a/packages/eslint-plugin-circuit-ui/package.json b/packages/eslint-plugin-circuit-ui/package.json index 09b2d1cb02..0cd777ddd9 100644 --- a/packages/eslint-plugin-circuit-ui/package.json +++ b/packages/eslint-plugin-circuit-ui/package.json @@ -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", diff --git a/packages/icons/package.json b/packages/icons/package.json index 9d7827b5f0..10af533ab1 100644 --- a/packages/icons/package.json +++ b/packages/icons/package.json @@ -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", diff --git a/packages/stylelint-plugin-circuit-ui/package.json b/packages/stylelint-plugin-circuit-ui/package.json index 8a5d4747ad..00d40d857c 100644 --- a/packages/stylelint-plugin-circuit-ui/package.json +++ b/packages/stylelint-plugin-circuit-ui/package.json @@ -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",