Skip to content

Commit

Permalink
fix(github): merge group (#2047)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Philibeaux <[email protected]>
  • Loading branch information
philibea authored Jun 17, 2024
1 parent ee846aa commit 6368f70
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 120 deletions.
1 change: 1 addition & 0 deletions .github/workflows/changesets-renovate.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Generate changeset for Renovate

on:
merge_group:
pull_request_target:
paths:
- '.github/workflows/changesets-renovate.yml'
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ jobs:
- run: pnpm run build
- run: pnpm run test:coverage
- uses: codecov/[email protected]
with:
with:
files: packages/**/coverage/cobertura-coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

test-types:
Expand All @@ -75,4 +75,3 @@ jobs:
- run: pnpm install
- run: pnpm run build
- run: pnpm run test:types

29 changes: 14 additions & 15 deletions .github/workflows/pull_request_title.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
- uses: pnpm/[email protected]
- name: Use Node.js
uses: actions/[email protected]
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/[email protected]
- uses: pnpm/[email protected]
- name: Use Node.js
uses: actions/[email protected]
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
84 changes: 42 additions & 42 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -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/',
],
},
{
Expand All @@ -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',
},
},
];
]
41 changes: 10 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"name": "root",
"private": true,
"workspaces": [
"packages/*"
],
"workspaces": ["packages/*"],
"type": "module",
"packageManager": "[email protected]",
"engines": {
Expand Down Expand Up @@ -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": {
Expand All @@ -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)))"
],
Expand Down
8 changes: 4 additions & 4 deletions packages/eslint-config-react/index.mjs
Original file line number Diff line number Diff line change
@@ -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 }
46 changes: 23 additions & 23 deletions packages/eslint-config-react/javascript.mjs
Original file line number Diff line number Diff line change
@@ -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'],
},
],
},
},
]
2 changes: 1 addition & 1 deletion packages/validate-icu-locales/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable eslint-comments/disable-enable-pair */

import { defineConfig, mergeConfig } from 'vite'
import { defaultConfig } from '../../vite.config'

Expand Down
2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
packages:
- 'packages/*'
- 'packages/*'

0 comments on commit 6368f70

Please sign in to comment.