diff --git a/.github/workflows/changesets-renovate.yml b/.github/workflows/changesets-renovate.yml index fa08987a6..13da76e76 100644 --- a/.github/workflows/changesets-renovate.yml +++ b/.github/workflows/changesets-renovate.yml @@ -1,6 +1,7 @@ name: Generate changeset for Renovate on: + merge_group: pull_request_target: paths: - '.github/workflows/changesets-renovate.yml' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56eb1b605..6854a4909 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,9 +53,9 @@ jobs: - run: pnpm run build - run: pnpm run test:coverage - uses: codecov/codecov-action@v4.4.1 - with: + with: files: packages/**/coverage/cobertura-coverage.xml - token: ${{ secrets.CODECOV_TOKEN }} + token: ${{ secrets.CODECOV_TOKEN }} verbose: true test-types: @@ -75,4 +75,3 @@ jobs: - run: pnpm install - run: pnpm run build - run: pnpm run test:types - diff --git a/.github/workflows/pull_request_title.yml b/.github/workflows/pull_request_title.yml index b4b5a4c9f..3aec2a2f0 100644 --- a/.github/workflows/pull_request_title.yml +++ b/.github/workflows/pull_request_title.yml @@ -1,24 +1,23 @@ - name: Pull Request on: pull_request: types: ['opened', 'edited', 'reopened', 'synchronize'] + merge_group: jobs: check-title: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4.1.6 - - uses: pnpm/action-setup@v4.0.0 - - name: Use Node.js - uses: actions/setup-node@v4.0.2 - with: - node-version: 20 - check-latest: true - cache: 'pnpm' - - run: pnpm install - - name: Check PR title - env: - TITLE: ${{ github.event.pull_request.title }} - run: echo "$TITLE" | pnpm commitlint - + - uses: actions/checkout@v4.1.6 + - uses: pnpm/action-setup@v4.0.0 + - name: Use Node.js + uses: actions/setup-node@v4.0.2 + with: + node-version: 20 + check-latest: true + cache: 'pnpm' + - run: pnpm install + - name: Check PR title + env: + TITLE: ${{ github.event.pull_request.title }} + run: echo "$TITLE" | pnpm commitlint diff --git a/eslint.config.mjs b/eslint.config.mjs index 87f5f02e8..e056b9ac4 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,17 +1,17 @@ -import babelParser from "@babel/eslint-parser"; -import scw from "@scaleway/eslint-config-react/javascript"; -import scwTypescript from "@scaleway/eslint-config-react/typescript"; -import globals from "globals"; +import babelParser from '@babel/eslint-parser' +import scw from '@scaleway/eslint-config-react/javascript' +import scwTypescript from '@scaleway/eslint-config-react/typescript' +import globals from 'globals' export default [ { ignores: [ - "**/node_modules/", - "**/dist/", - "**/build/", - "**/__typetests__/", - "**/packages_deprecated/", - "**/coverage/", + '**/node_modules/', + '**/dist/', + '**/build/', + '**/__typetests__/', + '**/packages_deprecated/', + '**/coverage/', ], }, { @@ -21,89 +21,89 @@ export default [ }, }, }, - ...scw.map((config) => ({ ...config, files: ["**/*.js"] })), + ...scw.map(config => ({ ...config, files: ['**/*.js'] })), { - files: ["**/*.js"], + files: ['**/*.js'], languageOptions: { parser: babelParser, parserOptions: { - configFile: "./babel.config.json", + configFile: './babel.config.json', }, }, }, - ...scwTypescript.map((config) => ({ + ...scwTypescript.map(config => ({ ...config, - files: ["**/*.ts", "**/*.tsx"], + files: ['**/*.ts', '**/*.tsx'], })), { - files: ["**/*.ts", "**/*.tsx"], + files: ['**/*.ts', '**/*.tsx'], languageOptions: { ecmaVersion: 5, - sourceType: "script", + sourceType: 'script', parserOptions: { - project: ["tsconfig.json"], + project: ['tsconfig.json'], }, }, }, - ...scwTypescript.map((config) => ({ + ...scwTypescript.map(config => ({ ...config, files: [ - "packages/changesets-renovate/**/*.ts{x,}", - "packages/validate-icu-locales/**/*.ts{x,}", - "**/__tests__/**/*.ts{x,}", + 'packages/changesets-renovate/**/*.ts{x,}', + 'packages/validate-icu-locales/**/*.ts{x,}', + '**/__tests__/**/*.ts{x,}', ], languageOptions: { ecmaVersion: 5, - sourceType: "script", + sourceType: 'script', parserOptions: { - project: ["tsconfig.json"], + project: ['tsconfig.json'], }, }, })), - ...scwTypescript.map((config) => ({ + ...scwTypescript.map(config => ({ ...config, files: [ - "packages/changesets-renovate/**/*.ts{x,}", - "packages/validate-icu-locales/**/*.ts{x,}", - "**/__tests__/**/*.ts{x,}", + 'packages/changesets-renovate/**/*.ts{x,}', + 'packages/validate-icu-locales/**/*.ts{x,}', + '**/__tests__/**/*.ts{x,}', ], languageOptions: { ecmaVersion: 5, - sourceType: "script", + sourceType: 'script', parserOptions: { - project: ["tsconfig.json"], + project: ['tsconfig.json'], }, }, rules: { ...config.rules, - "no-console": "off", - "@typescript-eslint/no-explicit-any": "warn", - "@typescript-eslint/no-floating-promises": "warn", + 'no-console': 'off', + '@typescript-eslint/no-explicit-any': 'warn', + '@typescript-eslint/no-floating-promises': 'warn', }, })), { files: [ - "packages/jest-helpers/**/*.ts{x,}", - "**/__tests__/**/*.ts{x,}", - "**/vitest.setup.ts", - "**/*.config.ts", - "**/__mocks__/**/*.ts{x,}", + 'packages/jest-helpers/**/*.ts{x,}', + '**/__tests__/**/*.ts{x,}', + '**/vitest.setup.ts', + '**/*.config.ts', + '**/__mocks__/**/*.ts{x,}', ], rules: { - "import/no-extraneous-dependencies": "off", - "react/jsx-key": "off", - "import/no-relative-packages": "off", + 'import/no-extraneous-dependencies': 'off', + 'react/jsx-key': 'off', + 'import/no-relative-packages': 'off', }, }, -]; +] diff --git a/package.json b/package.json index 9a7760afe..f54726179 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,7 @@ { "name": "root", "private": true, - "workspaces": [ - "packages/*" - ], + "workspaces": ["packages/*"], "type": "module", "packageManager": "pnpm@9.2.0", "engines": { @@ -74,21 +72,13 @@ } }, "commitlint": { - "extends": [ - "@commitlint/config-conventional" - ] + "extends": ["@commitlint/config-conventional"] }, "lint-staged": { - "*.(j|t)s?(x)": [ - "biome format --write .", - "eslint --fix" - ], - "*.json": [ - "biome format --write ." - ], - "*.mdx": [ - "biome format --write ." - ] + "*.(j|t)s?(x)": ["biome format --write .", "eslint --fix"], + "*.json": ["biome format --write ."], + "*.y(a)ml,": ["pnpm dlx prettier --write '**/*.{yml,yaml}' --single-quote"], + "*.mdx": ["biome format --write ."] }, "config": { "commitizen": { @@ -97,21 +87,10 @@ }, "jest": { "testEnvironment": "jsdom", - "setupFiles": [ - "jest-localstorage-mock" - ], - "collectCoverageFrom": [ - "packages/*/src/**/*.{ts,tsx,js,jsx}" - ], - "modulePathIgnorePatterns": [ - "locales", - "__typetests__", - "dist" - ], - "coverageReporters": [ - "text", - "cobertura" - ], + "setupFiles": ["jest-localstorage-mock"], + "collectCoverageFrom": ["packages/*/src/**/*.{ts,tsx,js,jsx}"], + "modulePathIgnorePatterns": ["locales", "__typetests__", "dist"], + "coverageReporters": ["text", "cobertura"], "transformIgnorePatterns": [ "node_modules/(?!(.*(query-string|decode-uri-component|split-on-first|filter-obj)))" ], diff --git a/packages/eslint-config-react/index.mjs b/packages/eslint-config-react/index.mjs index ae7517dbe..cd9e5566f 100644 --- a/packages/eslint-config-react/index.mjs +++ b/packages/eslint-config-react/index.mjs @@ -1,5 +1,5 @@ -import emotion from "./emotion.mjs"; -import javascript from "./javascript.mjs"; -import typescript from "./typescript.mjs"; +import emotion from './emotion.mjs' +import javascript from './javascript.mjs' +import typescript from './typescript.mjs' -export { emotion, javascript, typescript }; +export { emotion, javascript, typescript } diff --git a/packages/eslint-config-react/javascript.mjs b/packages/eslint-config-react/javascript.mjs index 6c130c659..825c245ca 100644 --- a/packages/eslint-config-react/javascript.mjs +++ b/packages/eslint-config-react/javascript.mjs @@ -1,28 +1,28 @@ -import { fixupConfigRules } from "@eslint/compat"; -import { FlatCompat } from "@eslint/eslintrc"; -import airbnb from "eslint-config-airbnb"; -import path from "node:path"; -import { fileURLToPath } from "node:url"; -import shared from "./shared.mjs"; +import { fixupConfigRules } from '@eslint/compat' +import { FlatCompat } from '@eslint/eslintrc' +import airbnb from 'eslint-config-airbnb' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import shared from './shared.mjs' -const filename = fileURLToPath(import.meta.url); -const dirname = path.dirname(filename); +const filename = fileURLToPath(import.meta.url) +const dirname = path.dirname(filename) const compat = new FlatCompat({ - baseDirectory: dirname, -}); + baseDirectory: dirname, +}) export default [ - ...fixupConfigRules(compat.config(airbnb)), - ...shared, - { - rules: { - "react/jsx-filename-extension": [ - "error", - { - extensions: [".js"], - }, - ], - }, - }, -]; + ...fixupConfigRules(compat.config(airbnb)), + ...shared, + { + rules: { + 'react/jsx-filename-extension': [ + 'error', + { + extensions: ['.js'], + }, + ], + }, + }, +] diff --git a/packages/validate-icu-locales/vite.config.ts b/packages/validate-icu-locales/vite.config.ts index b901684d0..e80befde4 100644 --- a/packages/validate-icu-locales/vite.config.ts +++ b/packages/validate-icu-locales/vite.config.ts @@ -1,5 +1,5 @@ /* eslint-disable eslint-comments/disable-enable-pair */ - + import { defineConfig, mergeConfig } from 'vite' import { defaultConfig } from '../../vite.config' diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 4340350e1..18ec407ef 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,2 +1,2 @@ packages: - - 'packages/*' \ No newline at end of file + - 'packages/*'