Skip to content

Commit

Permalink
chore: add better prettier automation
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Dec 10, 2024
1 parent 872c36b commit 82560d2
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 42 deletions.
3 changes: 1 addition & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ module.exports = {
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'eslint:recommended',
'plugin:prettier/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:storybook/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
Expand All @@ -32,7 +32,6 @@ module.exports = {
'react-hooks',
'react-compiler',
'@typescript-eslint',
'prettier',
],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Prettier

on:
push:
branches: [main]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
run:
name: Can the code be prettier? 🤔
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
cache: pnpm
node-version: lts/*
- run: pnpm install
- run: pnpm format
- run: git restore .github/workflows pnpm-lock.yaml
- uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ secrets.ECOSPARK_APP_ID }}
private-key: ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }}
- uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7
with:
body: I ran `pnpm format` 🧑‍💻
branch: actions/prettier
commit-message: "chore(prettier): 🤖 ✨"
labels: 🤖 bot
sign-commits: true
title: "chore(prettier): 🤖 ✨"
token: ${{ steps.generate-token.outputs.token }}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@
"eslint-plugin-boundaries": "^5.0.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-compiler": "19.0.0-beta-37ed2a7-20241206",
"eslint-plugin-react-hooks": "^5.1.0",
Expand Down
39 changes: 0 additions & 39 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 82560d2

Please sign in to comment.