Skip to content

Commit 82560d2

Browse files
committed
chore: add better prettier automation
1 parent 872c36b commit 82560d2

File tree

4 files changed

+40
-42
lines changed

4 files changed

+40
-42
lines changed

.eslintrc.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ module.exports = {
1111
'plugin:react/recommended',
1212
'plugin:react/jsx-runtime',
1313
'eslint:recommended',
14-
'plugin:prettier/recommended',
1514
'plugin:@typescript-eslint/eslint-recommended',
1615
'plugin:@typescript-eslint/recommended',
1716
'plugin:storybook/recommended',
17+
'prettier',
1818
],
1919
parser: '@typescript-eslint/parser',
2020
parserOptions: {
@@ -32,7 +32,6 @@ module.exports = {
3232
'react-hooks',
3333
'react-compiler',
3434
'@typescript-eslint',
35-
'prettier',
3635
],
3736
rules: {
3837
'@typescript-eslint/explicit-module-boundary-types': 'off',

.github/workflows/prettier.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Prettier
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref_name }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
run:
14+
name: Can the code be prettier? 🤔
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: pnpm/action-setup@v4
19+
- uses: actions/setup-node@v4
20+
with:
21+
cache: pnpm
22+
node-version: lts/*
23+
- run: pnpm install
24+
- run: pnpm format
25+
- run: git restore .github/workflows pnpm-lock.yaml
26+
- uses: actions/create-github-app-token@v1
27+
id: generate-token
28+
with:
29+
app-id: ${{ secrets.ECOSPARK_APP_ID }}
30+
private-key: ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }}
31+
- uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7
32+
with:
33+
body: I ran `pnpm format` 🧑‍💻
34+
branch: actions/prettier
35+
commit-message: "chore(prettier): 🤖 ✨"
36+
labels: 🤖 bot
37+
sign-commits: true
38+
title: "chore(prettier): 🤖 ✨"
39+
token: ${{ steps.generate-token.outputs.token }}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@
164164
"eslint-plugin-boundaries": "^5.0.1",
165165
"eslint-plugin-import": "^2.31.0",
166166
"eslint-plugin-jsx-a11y": "^6.10.2",
167-
"eslint-plugin-prettier": "^5.2.1",
168167
"eslint-plugin-react": "^7.37.2",
169168
"eslint-plugin-react-compiler": "19.0.0-beta-37ed2a7-20241206",
170169
"eslint-plugin-react-hooks": "^5.1.0",

pnpm-lock.yaml

Lines changed: 0 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)