diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index 7d7ec6d0f7..c1a347d4db 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -4,7 +4,6 @@ about: Report a component malfunction title: ': ' labels: '' assignees: '' - --- **Description** diff --git a/.github/ISSUE_TEMPLATE/component-request.md b/.github/ISSUE_TEMPLATE/component-request.md index e86e1d4a80..86bac3ca29 100644 --- a/.github/ISSUE_TEMPLATE/component-request.md +++ b/.github/ISSUE_TEMPLATE/component-request.md @@ -4,7 +4,6 @@ about: Suggest an idea for a new component title: '' labels: '' assignees: '' - --- **Describe the behavior** diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index c372e45e71..ac5040554c 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -20,8 +20,8 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: "22.2.0" - cache: "yarn" + node-version: '22.2.0' + cache: 'yarn' - uses: actions/cache@v3 id: yarn-cache with: @@ -66,10 +66,10 @@ jobs: fetch-depth: 0 - uses: actions/setup-node@v3 with: - node-version: "22.2.0" - registry-url: "https://registry.npmjs.org" - scope: "@rocket.chat" - cache: "yarn" + node-version: '22.2.0' + registry-url: 'https://registry.npmjs.org' + scope: '@rocket.chat' + cache: 'yarn' - uses: actions/cache@v3 id: yarn-cache with: @@ -111,7 +111,7 @@ jobs: - build-and-test environment: name: github-pages - url: "https://rocketchat.github.io/fuselage/fuselage/${{ needs.build-and-test.outputs.branch-name }}" + url: 'https://rocketchat.github.io/fuselage/fuselage/${{ needs.build-and-test.outputs.branch-name }}' steps: - uses: actions/checkout@v4 with: @@ -135,7 +135,7 @@ jobs: with: target_branch: gh-pages build_dir: . - commit_message: "Deploy to Github Pages [skip ci]" + commit_message: 'Deploy to Github Pages [skip ci]' jekyll: false env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/ci-pr-closed.yml b/.github/workflows/ci-pr-closed.yml index 3c441576cf..fdd490d85e 100644 --- a/.github/workflows/ci-pr-closed.yml +++ b/.github/workflows/ci-pr-closed.yml @@ -7,7 +7,7 @@ on: jobs: delete-storybook-for-pr: - name: "Delete Storybook for PR #${{ github.event.number }}" + name: 'Delete Storybook for PR #${{ github.event.number }}' runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -18,7 +18,7 @@ jobs: with: target_branch: gh-pages build_dir: . - commit_message: "Deploy to Github Pages [skip ci]" + commit_message: 'Deploy to Github Pages [skip ci]' jekyll: false env: GITHUB_TOKEN: ${{ github.token }} diff --git a/.github/workflows/ci-pr-opened.yml b/.github/workflows/ci-pr-opened.yml index e5d7062f9e..a0c1841106 100644 --- a/.github/workflows/ci-pr-opened.yml +++ b/.github/workflows/ci-pr-opened.yml @@ -2,7 +2,7 @@ name: Continuous Integration (PR opened) on: workflow_run: - workflows: ["Continuous Integration"] + workflows: ['Continuous Integration'] types: - completed @@ -51,7 +51,7 @@ jobs: runs-on: ubuntu-latest environment: name: github-pages - url: "https://rocketchat.github.io/fuselage/fuselage/${{ needs.download-artifact.outputs.pr-number }}" + url: 'https://rocketchat.github.io/fuselage/fuselage/${{ needs.download-artifact.outputs.pr-number }}' steps: - uses: actions/checkout@v2 with: @@ -70,7 +70,7 @@ jobs: with: target_branch: gh-pages build_dir: . - commit_message: "Deploy to Github Pages [skip ci]" + commit_message: 'Deploy to Github Pages [skip ci]' jekyll: false env: GITHUB_TOKEN: ${{ github.token }} diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 8ca41a60e1..1fff290d26 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -22,8 +22,8 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v4 with: - node-version: "22.2.0" - cache: "yarn" + node-version: '22.2.0' + cache: 'yarn' - uses: actions/cache@v3 id: yarn-cache with: @@ -44,7 +44,7 @@ jobs: - run: yarn run ci - uses: actions/upload-artifact@v3 with: - name: "storybooks-${{ github.event.number }}" + name: 'storybooks-${{ github.event.number }}' path: | packages/fuselage/storybook-static packages/onboarding-ui/storybook-static diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 96c9501bc2..d27f46ed3b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,12 +1,12 @@ -name: "CodeQL" +name: 'CodeQL' on: push: - branches: "main" + branches: 'main' pull_request: - branches: "main" + branches: 'main' schedule: - - cron: "54 21 * * 4" + - cron: '54 21 * * 4' jobs: analyze: @@ -38,4 +38,4 @@ jobs: - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 with: - category: "/language:${{ matrix.language }}" + category: '/language:${{ matrix.language }}' diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml index 83c2460e88..bd437cc13a 100644 --- a/.github/workflows/pr-title.yml +++ b/.github/workflows/pr-title.yml @@ -1,4 +1,4 @@ -name: "Pull request title" +name: 'Pull request title' on: pull_request_target: types: [opened, edited] diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..6502b3d8da --- /dev/null +++ b/.prettierignore @@ -0,0 +1,8 @@ +dist +storybook-static +bundle-report-dev.html +bundle-report.html +/.changeset +/.turbo +/.yarn +/README.md diff --git a/.vscode/fuselage.code-snippets b/.vscode/fuselage.code-snippets index 633d45e8de..887d132809 100644 --- a/.vscode/fuselage.code-snippets +++ b/.vscode/fuselage.code-snippets @@ -10,7 +10,7 @@ "", "it('renders without crashing', () => {", " render(<$1 />);", - "});" - ] - } + "});", + ], + }, } diff --git a/.vscode/onboarding-ui.code-snippets b/.vscode/onboarding-ui.code-snippets index 42dda8db8b..b2cdf0611d 100644 --- a/.vscode/onboarding-ui.code-snippets +++ b/.vscode/onboarding-ui.code-snippets @@ -14,9 +14,9 @@ "};", "", "export default $1;", - "" + "", ], - "description": "React component for onboarding-ui" + "description": "React component for onboarding-ui", }, "Storybook story": { "scope": "typescriptreact", @@ -41,8 +41,8 @@ "export const _$1: Story = (args) => (", " <$1 {...args} />", ");", - "_$1.storyName = '$1';" + "_$1.storyName = '$1';", ], - "description": "Storybook story for onboarding-ui" - } + "description": "Storybook story for onboarding-ui", + }, } diff --git a/_templates/create-package/library/files/.prettierignore.t b/_templates/create-package/library/files/.prettierignore.t index f487ec0315..451878f5e3 100644 --- a/_templates/create-package/library/files/.prettierignore.t +++ b/_templates/create-package/library/files/.prettierignore.t @@ -1,5 +1,4 @@ --- to: packages/<%=package%>/.prettierignore --- -/node_modules /dist diff --git a/_templates/create-package/library/prompt.js b/_templates/create-package/library/prompt.js index 76bd8bf419..da1849c534 100644 --- a/_templates/create-package/library/prompt.js +++ b/_templates/create-package/library/prompt.js @@ -1,21 +1,21 @@ module.exports = { prompt: async ({ prompter }) => { const { package: packageName } = await prompter.prompt({ - type: "input", - name: "package", + type: 'input', + name: 'package', message: "What's the package name?", }); const { description } = await prompter.prompt({ - type: "input", - name: "description", + type: 'input', + name: 'description', message: "What's the package description?", }); const { version } = await prompter.prompt({ - type: "input", - name: "version", - default: "0.0.1", + type: 'input', + name: 'version', + default: '0.0.1', message: "What's the package version?", }); diff --git a/package.json b/package.json index e4aba7ac5b..35db155512 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "husky": "~9.1.6", "hygen": "~6.2.11", "pinst": "~3.0.0", + "prettier": "~3.3.3", "turbo": "~2.2.3", "update-readme": "workspace:~" }, @@ -31,7 +32,8 @@ "create-package": "hygen create-package", "release": "yarn changeset publish", "changeset": "changeset", - "release-next": "yarn workspaces foreach --no-private -v npm publish --tag next --tolerate-republish" + "release-next": "yarn workspaces foreach --no-private -v npm publish --tag next --tolerate-republish", + "prettier": "prettier --plugin=@prettier/plugin-xml" }, "engines": { "node": "22.9.0" diff --git a/packages/css-supports/.prettierignore b/packages/css-supports/.prettierignore index 8225baa4a7..9b1c8b133c 100644 --- a/packages/css-supports/.prettierignore +++ b/packages/css-supports/.prettierignore @@ -1,2 +1 @@ -/node_modules /dist diff --git a/packages/emitter/.prettierignore b/packages/emitter/.prettierignore index 8225baa4a7..9b1c8b133c 100644 --- a/packages/emitter/.prettierignore +++ b/packages/emitter/.prettierignore @@ -1,2 +1 @@ -/node_modules /dist diff --git a/packages/eslint-config-alt/.prettierignore b/packages/eslint-config-alt/.prettierignore deleted file mode 100644 index 07e6e472cc..0000000000 --- a/packages/eslint-config-alt/.prettierignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules diff --git a/packages/fuselage-hooks/.prettierignore b/packages/fuselage-hooks/.prettierignore index 8225baa4a7..9b1c8b133c 100644 --- a/packages/fuselage-hooks/.prettierignore +++ b/packages/fuselage-hooks/.prettierignore @@ -1,2 +1 @@ -/node_modules /dist diff --git a/packages/fuselage-toastbar/.prettierignore b/packages/fuselage-toastbar/.prettierignore index d4b5909e36..e0baa61095 100644 --- a/packages/fuselage-toastbar/.prettierignore +++ b/packages/fuselage-toastbar/.prettierignore @@ -1,3 +1,2 @@ /dist -/node_modules /storybook-static diff --git a/packages/fuselage-tokens/.prettierignore b/packages/fuselage-tokens/.prettierignore deleted file mode 100644 index 4d64059f69..0000000000 --- a/packages/fuselage-tokens/.prettierignore +++ /dev/null @@ -1,2 +0,0 @@ -/node_modules - diff --git a/packages/fuselage-tokens/.stylelintrc b/packages/fuselage-tokens/.stylelintrc index d1c42d5122..f4084bae2e 100644 --- a/packages/fuselage-tokens/.stylelintrc +++ b/packages/fuselage-tokens/.stylelintrc @@ -1,13 +1,7 @@ { - "plugins": [ - "stylelint-order", - "stylelint-scss", - "stylelint-prettier" - ], + "plugins": ["stylelint-order", "stylelint-scss", "stylelint-prettier"], "customSyntax": "postcss-scss", - "ignoreFiles": [ - "src/**/*.js" - ], + "ignoreFiles": ["src/**/*.js"], "rules": { "prettier/prettier": true, "block-no-empty": true, @@ -17,9 +11,7 @@ "declaration-block-no-duplicate-properties": [ true, { - "ignore": [ - "consecutive-duplicates-with-different-values" - ] + "ignore": ["consecutive-duplicates-with-different-values"] } ], "declaration-block-no-redundant-longhand-properties": true, @@ -37,12 +29,8 @@ "rule-empty-line-before": [ "always", { - "except": [ - "first-nested" - ], - "ignore": [ - "after-comment" - ] + "except": ["first-nested"], + "ignore": ["after-comment"] } ], "scss/at-mixin-pattern": "^-?([a-z][a-z0-9]+-)*[a-z][a-z0-9]+$", @@ -51,9 +39,7 @@ "selector-pseudo-class-no-unknown": [ true, { - "ignorePseudoClasses": [ - "global" - ] + "ignorePseudoClasses": ["global"] } ], "selector-pseudo-element-colon-notation": "double", diff --git a/packages/fuselage/.prettierignore b/packages/fuselage/.prettierignore index e7253e50b8..0f06159076 100644 --- a/packages/fuselage/.prettierignore +++ b/packages/fuselage/.prettierignore @@ -1,4 +1,5 @@ /dist -/node_modules /storybook-static /**/*.mdx +/bundle-report-dev.html +/bundle-report.html diff --git a/packages/fuselage/.stylelintrc b/packages/fuselage/.stylelintrc index d1c42d5122..f4084bae2e 100644 --- a/packages/fuselage/.stylelintrc +++ b/packages/fuselage/.stylelintrc @@ -1,13 +1,7 @@ { - "plugins": [ - "stylelint-order", - "stylelint-scss", - "stylelint-prettier" - ], + "plugins": ["stylelint-order", "stylelint-scss", "stylelint-prettier"], "customSyntax": "postcss-scss", - "ignoreFiles": [ - "src/**/*.js" - ], + "ignoreFiles": ["src/**/*.js"], "rules": { "prettier/prettier": true, "block-no-empty": true, @@ -17,9 +11,7 @@ "declaration-block-no-duplicate-properties": [ true, { - "ignore": [ - "consecutive-duplicates-with-different-values" - ] + "ignore": ["consecutive-duplicates-with-different-values"] } ], "declaration-block-no-redundant-longhand-properties": true, @@ -37,12 +29,8 @@ "rule-empty-line-before": [ "always", { - "except": [ - "first-nested" - ], - "ignore": [ - "after-comment" - ] + "except": ["first-nested"], + "ignore": ["after-comment"] } ], "scss/at-mixin-pattern": "^-?([a-z][a-z0-9]+-)*[a-z][a-z0-9]+$", @@ -51,9 +39,7 @@ "selector-pseudo-class-no-unknown": [ true, { - "ignorePseudoClasses": [ - "global" - ] + "ignorePseudoClasses": ["global"] } ], "selector-pseudo-element-colon-notation": "double", diff --git a/packages/icons/.stylelintrc b/packages/icons/.stylelintrc index 14dad838c1..232494dce1 100644 --- a/packages/icons/.stylelintrc +++ b/packages/icons/.stylelintrc @@ -1,12 +1,6 @@ { - "plugins": [ - "stylelint-order", - "stylelint-scss", - "stylelint-prettier" - ], - "ignoreFiles": [ - "src/**/*.js" - ], + "plugins": ["stylelint-order", "stylelint-scss", "stylelint-prettier"], + "ignoreFiles": ["src/**/*.js"], "rules": { "prettier/prettier": true, "block-no-empty": true, @@ -16,9 +10,7 @@ "declaration-block-no-duplicate-properties": [ true, { - "ignore": [ - "consecutive-duplicates-with-different-values" - ] + "ignore": ["consecutive-duplicates-with-different-values"] } ], "declaration-block-no-redundant-longhand-properties": true, @@ -36,12 +28,8 @@ "rule-empty-line-before": [ "always", { - "except": [ - "first-nested" - ], - "ignore": [ - "after-comment" - ] + "except": ["first-nested"], + "ignore": ["after-comment"] } ], "scss/at-mixin-pattern": "^-?([a-z][a-z0-9]+-)*[a-z][a-z0-9]+$", @@ -50,9 +38,7 @@ "selector-pseudo-class-no-unknown": [ true, { - "ignorePseudoClasses": [ - "global" - ] + "ignorePseudoClasses": ["global"] } ], "selector-pseudo-element-colon-notation": "double", diff --git a/packages/icons/glyphsMapping.json b/packages/icons/glyphsMapping.json index 9abf68d9fb..891da0c221 100644 --- a/packages/icons/glyphsMapping.json +++ b/packages/icons/glyphsMapping.json @@ -986,4 +986,4 @@ "question-mark": { "start": "\ue15d" } -} \ No newline at end of file +} diff --git a/packages/layout/.prettierignore b/packages/layout/.prettierignore index d4b5909e36..e0baa61095 100644 --- a/packages/layout/.prettierignore +++ b/packages/layout/.prettierignore @@ -1,3 +1,2 @@ /dist -/node_modules /storybook-static diff --git a/packages/logo/.prettierignore b/packages/logo/.prettierignore index 8225baa4a7..9b1c8b133c 100644 --- a/packages/logo/.prettierignore +++ b/packages/logo/.prettierignore @@ -1,2 +1 @@ -/node_modules /dist diff --git a/packages/memo/.prettierignore b/packages/memo/.prettierignore index 8225baa4a7..9b1c8b133c 100644 --- a/packages/memo/.prettierignore +++ b/packages/memo/.prettierignore @@ -1,2 +1 @@ -/node_modules /dist diff --git a/packages/mp3-encoder/.prettierignore b/packages/mp3-encoder/.prettierignore index 8225baa4a7..9b1c8b133c 100644 --- a/packages/mp3-encoder/.prettierignore +++ b/packages/mp3-encoder/.prettierignore @@ -1,2 +1 @@ -/node_modules /dist diff --git a/packages/onboarding-ui/.jest/ResizeObserverMock.ts b/packages/onboarding-ui/.jest/ResizeObserverMock.ts index b64c30f906..c086f31a07 100644 --- a/packages/onboarding-ui/.jest/ResizeObserverMock.ts +++ b/packages/onboarding-ui/.jest/ResizeObserverMock.ts @@ -1,7 +1,7 @@ import type { CSSProperties } from 'react'; export const createBoxSizes = ( - style: CSSProperties + style: CSSProperties, ): { borderBoxSize: ResizeObserverSize; contentBoxSize: ResizeObserverSize; @@ -127,10 +127,10 @@ export class ResizeObserverMock implements ResizeObserver { devicePixelContentBoxSize: [], }, ], - this + this, ); } - } + }, ); mutationObserver.observe(target, { diff --git a/packages/onboarding-ui/.prettierignore b/packages/onboarding-ui/.prettierignore index d4b5909e36..e0baa61095 100644 --- a/packages/onboarding-ui/.prettierignore +++ b/packages/onboarding-ui/.prettierignore @@ -1,3 +1,2 @@ /dist -/node_modules /storybook-static diff --git a/packages/peggy-loader/.prettierignore b/packages/peggy-loader/.prettierignore index 8225baa4a7..9b1c8b133c 100644 --- a/packages/peggy-loader/.prettierignore +++ b/packages/peggy-loader/.prettierignore @@ -1,2 +1 @@ -/node_modules /dist diff --git a/packages/prettier-config/.prettierignore b/packages/prettier-config/.prettierignore deleted file mode 100644 index 07e6e472cc..0000000000 --- a/packages/prettier-config/.prettierignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules diff --git a/packages/string-helpers/.prettierignore b/packages/string-helpers/.prettierignore index 8225baa4a7..9b1c8b133c 100644 --- a/packages/string-helpers/.prettierignore +++ b/packages/string-helpers/.prettierignore @@ -1,2 +1 @@ -/node_modules /dist diff --git a/packages/styled/.prettierignore b/packages/styled/.prettierignore index 8225baa4a7..9b1c8b133c 100644 --- a/packages/styled/.prettierignore +++ b/packages/styled/.prettierignore @@ -1,2 +1 @@ -/node_modules /dist diff --git a/packages/stylis-logical-props-middleware/.prettierignore b/packages/stylis-logical-props-middleware/.prettierignore index 8225baa4a7..9b1c8b133c 100644 --- a/packages/stylis-logical-props-middleware/.prettierignore +++ b/packages/stylis-logical-props-middleware/.prettierignore @@ -1,2 +1 @@ -/node_modules /dist diff --git a/tools/build-design-tokens/index.mjs b/tools/build-design-tokens/index.mjs index 7ae8f04219..0225e520fe 100755 --- a/tools/build-design-tokens/index.mjs +++ b/tools/build-design-tokens/index.mjs @@ -16,7 +16,7 @@ const buildBreakpoints = async () => { toCommonJsModule(entries).then(writeSource('./breakpoints.js')), toEsmModule(entries).then(writeSource('./breakpoints.mjs')), toScssVariables({ breakpoints: entries }).then( - writeSource('./breakpoints.scss') + writeSource('./breakpoints.scss'), ), ]); }; diff --git a/tools/build-icons/build.mjs b/tools/build-icons/build.mjs index d8293a17c9..93550b3bb7 100644 --- a/tools/build-icons/build.mjs +++ b/tools/build-icons/build.mjs @@ -19,10 +19,10 @@ export const buildSvgImages = (icons) => createSvgIcons(icons).then((svgIcons) => Promise.all([ ...svgIcons.map(({ name, xml }) => - writeSource(`./dist/svg/${name}.svg`)(xml) + writeSource(`./dist/svg/${name}.svg`)(xml), ), createSvgSprite(svgIcons).then(writeSource('./dist/icons.svg')), - ]) + ]), ); export const buildCss = () => @@ -42,7 +42,7 @@ export const buildCss = () => url('./font/rocketchat.ttf') format('truetype'), url('./font/rocketchat.svg#RocketChat') format('svg'); } - ` + `, ) .then(runStylelint('rocketchat.css')) .then(writeSource('dist/rocketchat.css')); @@ -52,7 +52,7 @@ const fromIconDescriptorsToCharacters = (icons) => .then((glyphsMapping) => icons .filter(({ name }) => !!glyphsMapping[name]) - .map(({ name }) => [name, glyphsMapping[name].start]) + .map(({ name }) => [name, glyphsMapping[name].start]), ) .then(Object.fromEntries); @@ -80,15 +80,15 @@ export const buildFont = (icons) => .then((ttfBuffer) => Promise.all([ createWoffBuffer(ttfBuffer).then( - writeBinary('./dist/font/rocketchat.woff') + writeBinary('./dist/font/rocketchat.woff'), ), createWoff2Buffer(ttfBuffer).then( - writeBinary('./dist/font/rocketchat.woff2') + writeBinary('./dist/font/rocketchat.woff2'), ), createEotBuffer(ttfBuffer).then( - writeBinary('./dist/font/rocketchat.eot') + writeBinary('./dist/font/rocketchat.eot'), ), - ]) + ]), ); export const buildDefinition = (icons) => { @@ -97,7 +97,7 @@ export const buildDefinition = (icons) => { .then( (characters) => `declare const Icons: ${encodeJson(characters)}; export default Icons; -export type Keys = keyof typeof Icons;` +export type Keys = keyof typeof Icons;`, ) // .then(runEslint('index.d.ts')) .then(writeSource('dist/index.d.ts')) diff --git a/tools/build-icons/font.mjs b/tools/build-icons/font.mjs index 3299833ecd..4bca8efbb1 100644 --- a/tools/build-icons/font.mjs +++ b/tools/build-icons/font.mjs @@ -48,7 +48,7 @@ export const createSvgBuffer = async (icons) => { fontStream.write(stream); } - }) + }), ); return new Promise((resolve, reject) => { @@ -71,7 +71,7 @@ export const createTtfBuffer = async (svgBuffer) => { description: pkg.description, url: pkg.homepage, version: pkg.version.split('.').slice(0, 2).join('.'), - }).buffer + }).buffer, ); }; diff --git a/tools/build-icons/glyphs.mjs b/tools/build-icons/glyphs.mjs index baf1c496bc..f9521a9da7 100644 --- a/tools/build-icons/glyphs.mjs +++ b/tools/build-icons/glyphs.mjs @@ -33,7 +33,7 @@ export const nextCharactersFor = async (name, type) => { Math.max( ...Object.values(glyphsMapping) .map(({ start }) => startCharacters.indexOf(start)) - .filter((index) => index > -1) + .filter((index) => index > -1), ) + 2; if (startCharacters.length <= i) { @@ -51,7 +51,7 @@ export const nextCharactersFor = async (name, type) => { Math.max( ...Object.values(glyphsMapping) .map(({ start }) => start.codePointAt(0)) - .filter((codePoint) => codePoint >= 0xe000) + .filter((codePoint) => codePoint >= 0xe000), ) - 0xe000 + 2; diff --git a/tools/build-icons/svg.mjs b/tools/build-icons/svg.mjs index 978443270e..e58d71d1f5 100644 --- a/tools/build-icons/svg.mjs +++ b/tools/build-icons/svg.mjs @@ -37,7 +37,7 @@ export const createSvgIcons = (icons) => }); return { name, type, viewBox, elements, xml }; - }) + }), ); export const createSvgSprite = async (svgIcons) => @@ -54,7 +54,7 @@ export const createSvgSprite = async (svgIcons) => }, ...elements, }, - }) + }), ), '', ].join('\n'); diff --git a/tools/scripts/.prettierignore b/tools/scripts/.prettierignore deleted file mode 100644 index c8745947de..0000000000 --- a/tools/scripts/.prettierignore +++ /dev/null @@ -1,2 +0,0 @@ -/node_modules -!.* diff --git a/tools/testing-utils/mocks/withClipboardMock.d.ts b/tools/testing-utils/mocks/withClipboardMock.d.ts index 4f1c3d01cd..7e589fb5ab 100644 --- a/tools/testing-utils/mocks/withClipboardMock.d.ts +++ b/tools/testing-utils/mocks/withClipboardMock.d.ts @@ -1,3 +1,3 @@ export declare const withClipboardMock: () => ( - writeText: () => Promise + writeText: () => Promise, ) => void; diff --git a/tools/testing-utils/mocks/withResizeObserverMock.js b/tools/testing-utils/mocks/withResizeObserverMock.js index 6499111082..8d66b5baa5 100644 --- a/tools/testing-utils/mocks/withResizeObserverMock.js +++ b/tools/testing-utils/mocks/withResizeObserverMock.js @@ -7,29 +7,29 @@ const getNormalizedStyle = (style) => ({ boxSizing: style.boxSizing === 'border-box' ? 'border-box' : 'content-box', inlineSize: getSizeInPixels(style.inlineSize || style.width), borderInlineStartWidth: getSizeInPixels( - style.borderInlineStartWidth || style.borderRightWidth + style.borderInlineStartWidth || style.borderRightWidth, ), borderInlineEndWidth: getSizeInPixels( - style.borderInlineEndWidth || style.borderRightWidth + style.borderInlineEndWidth || style.borderRightWidth, ), paddingInlineStart: getSizeInPixels( - style.paddingInlineStart || style.paddingLeft + style.paddingInlineStart || style.paddingLeft, ), paddingInlineEnd: getSizeInPixels( - style.paddingInlineEnd || style.paddingRight + style.paddingInlineEnd || style.paddingRight, ), blockSize: getSizeInPixels(style.blockSize || style.height), borderBlockStartWidth: getSizeInPixels( - style.borderBlockStartWidth || style.borderTopWidth + style.borderBlockStartWidth || style.borderTopWidth, ), borderBlockEndWidth: getSizeInPixels( - style.borderBlockEndWidth || style.borderBottomWidth + style.borderBlockEndWidth || style.borderBottomWidth, ), paddingBlockStart: getSizeInPixels( - style.paddingBlockStart || style.paddingTop + style.paddingBlockStart || style.paddingTop, ), paddingBlockEnd: getSizeInPixels( - style.paddingBlockEnd || style.paddingBottom + style.paddingBlockEnd || style.paddingBottom, ), }); @@ -243,7 +243,7 @@ class ResizeObserverMock { contentBoxSize: [contentBoxSize], }, ], - this + this, ); } }); diff --git a/tools/tools-utils/files.mjs b/tools/tools-utils/files.mjs index c5b8b68e43..63396b93b5 100644 --- a/tools/tools-utils/files.mjs +++ b/tools/tools-utils/files.mjs @@ -42,7 +42,7 @@ export const removeFile = (path) => promisify(rimraf)(path); export const listFiles = (patterns, cwd) => fg(patterns, { cwd }).then((paths) => - Promise.all(paths.map((path) => join(path))) + Promise.all(paths.map((path) => join(path))), ); export const resolveLink = async (path) => { diff --git a/tools/tools-utils/json.mjs b/tools/tools-utils/json.mjs index 173d5787c6..fea9f5bb47 100644 --- a/tools/tools-utils/json.mjs +++ b/tools/tools-utils/json.mjs @@ -3,5 +3,5 @@ export const decodeJson = (source) => JSON.parse(source); export const encodeJson = (data) => JSON.stringify(data, null, 2).replace( /[\u007f-\uffff]/g, - (c) => `\\u${`0000${c.charCodeAt(0).toString(16)}`.slice(-4)}` + (c) => `\\u${`0000${c.charCodeAt(0).toString(16)}`.slice(-4)}`, ); diff --git a/tools/tools-utils/json5.mjs b/tools/tools-utils/json5.mjs index 3657f31839..46d3d11637 100644 --- a/tools/tools-utils/json5.mjs +++ b/tools/tools-utils/json5.mjs @@ -7,5 +7,5 @@ export const encodeJson5 = (data) => .stringify(data, null, 2) .replace( /[\u007f-\uffff]/g, - (c) => `\\u${`0000${c.charCodeAt(0).toString(16)}`.slice(-4)}` + (c) => `\\u${`0000${c.charCodeAt(0).toString(16)}`.slice(-4)}`, ); diff --git a/tools/tools-utils/source.mjs b/tools/tools-utils/source.mjs index c0fe9c36ea..f274f7113d 100644 --- a/tools/tools-utils/source.mjs +++ b/tools/tools-utils/source.mjs @@ -88,7 +88,7 @@ export const toScssVariables = async (data) => { const code = Object.entries(data) .map( ([varName, value]) => - `\$${toScssIdentifier(varName)}:${toScssValue(value)};` + `\$${toScssIdentifier(varName)}:${toScssValue(value)};`, ) .join(''); diff --git a/tools/update-readme/templates/rootReadme.mjs b/tools/update-readme/templates/rootReadme.mjs index 3ae1626bda..5fbaaec210 100644 --- a/tools/update-readme/templates/rootReadme.mjs +++ b/tools/update-readme/templates/rootReadme.mjs @@ -25,7 +25,7 @@ export const rootReadme = (pkgs) => outdent` pkg.description ?? '', npmVersionBadge(pkg), depsBadge(pkg), - ].join(' | ')} |` + ].join(' | ')} |`, ) .join('\n')} diff --git a/tools/update-readme/templates/section/header.mjs b/tools/update-readme/templates/section/header.mjs index 55dc26ad02..df94d2a761 100644 --- a/tools/update-readme/templates/section/header.mjs +++ b/tools/update-readme/templates/section/header.mjs @@ -27,7 +27,7 @@ export const header = (pkg) => pkg.peerDependencies?.react && npmPeerDepVersionBadge(pkg, 'react'), pkg.devDependencies?.['@storybook/react'] && storybookBadge(pkg), npmDownloadsBadge(pkg), - licenseBadge(pkg) + licenseBadge(pkg), )} ${badges(depsBadge(pkg), bundleSizeBadge(pkg))} diff --git a/tools/update-readme/update-readme.mjs b/tools/update-readme/update-readme.mjs index 36d58c92e7..9c60f57f42 100755 --- a/tools/update-readme/update-readme.mjs +++ b/tools/update-readme/update-readme.mjs @@ -12,7 +12,7 @@ const pkgs = await Promise.all( pkgDirs.map(async (dirPath) => ({ ...(await fs.readJSON(`${dirPath}/package.json`)), dirname: path.basename(dirPath), - })) + })), ); await fs.writeFile('README.md', rootReadme(pkgs)); @@ -25,9 +25,9 @@ await Promise.all( .readFile(readmePath, 'utf-8') .then(replaceSections(pkg), () => pkgReadme(pkg)) .then((content) => fs.writeFile(readmePath, content)); - }) + }), ); await $`git add -vA README.md ${pkgs.map( - (pkg) => `packages/${pkg.dirname}/README.md` + (pkg) => `packages/${pkg.dirname}/README.md`, )}`; diff --git a/yarn.lock b/yarn.lock index 185945d80e..a9904ff097 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4054,6 +4054,7 @@ __metadata: husky: "npm:~9.1.6" hygen: "npm:~6.2.11" pinst: "npm:~3.0.0" + prettier: "npm:~3.3.3" turbo: "npm:~2.2.3" update-readme: "workspace:~" languageName: unknown