diff --git a/.eslintrc.js b/.eslintrc.js index 4e14be50f..d4261f82b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -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: { @@ -32,7 +32,6 @@ module.exports = { 'react-hooks', 'react-compiler', '@typescript-eslint', - 'prettier', ], rules: { '@typescript-eslint/explicit-module-boundary-types': 'off', diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml new file mode 100644 index 000000000..917a42789 --- /dev/null +++ b/.github/workflows/prettier.yml @@ -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 }} diff --git a/package.json b/package.json index 157381b61..e1d76fcf1 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 34d360085..07eb22692 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -189,9 +189,6 @@ importers: eslint-plugin-jsx-a11y: specifier: ^6.10.2 version: 6.10.2(eslint@8.57.1) - eslint-plugin-prettier: - specifier: ^5.2.1 - version: 5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.1))(eslint@8.57.1)(prettier@3.4.2) eslint-plugin-react: specifier: ^7.37.2 version: 7.37.2(eslint@8.57.1) @@ -3630,20 +3627,6 @@ packages: peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9 - eslint-plugin-prettier@5.2.1: - resolution: {integrity: sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==} - engines: {node: ^14.18.0 || >=16.0.0} - peerDependencies: - '@types/eslint': '>=8.0.0' - eslint: '>=8.0.0' - eslint-config-prettier: '*' - prettier: '>=3.0.0' - peerDependenciesMeta: - '@types/eslint': - optional: true - eslint-config-prettier: - optional: true - eslint-plugin-react-compiler@19.0.0-beta-37ed2a7-20241206: resolution: {integrity: sha512-5Pex1fUCJwLwwqEJe6NkgTn45kUjjj9TZP6IrW4IcpWM/YaEe+QvcOeF60huDjBq0kz1svGeW2nw8WdY+qszAw==} engines: {node: ^14.17.0 || ^16.0.0 || >= 18.0.0} @@ -3820,9 +3803,6 @@ packages: fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - fast-glob@3.3.2: resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} engines: {node: '>=8.6.0'} @@ -6081,10 +6061,6 @@ packages: resolution: {integrity: sha512-s/46sYeylUfHNjI+sA/78FAHlmIuKqI9wNnzEOGehAlUUYeObv5C2mOinXBjyUyWmJ2SfcS2/ydApH4hTF4WXQ==} engines: {node: '>=0.10.0'} - prettier-linter-helpers@1.0.0: - resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} - engines: {node: '>=6.0.0'} - prettier-plugin-packagejson@2.5.6: resolution: {integrity: sha512-TY7KiLtyt6Tlf53BEbXUWkN0+TRdHKgIMmtXtDCyHH6yWnZ50Lwq6Vb6lyjapZrhDTXooC4EtlY5iLe1sCgi5w==} peerDependencies: @@ -11528,15 +11504,6 @@ snapshots: safe-regex-test: 1.0.3 string.prototype.includes: 2.0.1 - eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.1))(eslint@8.57.1)(prettier@3.4.2): - dependencies: - eslint: 8.57.1 - prettier: 3.4.2 - prettier-linter-helpers: 1.0.0 - synckit: 0.9.2 - optionalDependencies: - eslint-config-prettier: 9.1.0(eslint@8.57.1) - eslint-plugin-react-compiler@19.0.0-beta-37ed2a7-20241206(eslint@8.57.1): dependencies: '@babel/core': 7.26.0 @@ -11866,8 +11833,6 @@ snapshots: fast-deep-equal@3.1.3: {} - fast-diff@1.3.0: {} - fast-glob@3.3.2: dependencies: '@nodelib/fs.stat': 2.0.5 @@ -14463,10 +14428,6 @@ snapshots: preserve@0.2.0: {} - prettier-linter-helpers@1.0.0: - dependencies: - fast-diff: 1.3.0 - prettier-plugin-packagejson@2.5.6(prettier@3.4.2): dependencies: sort-package-json: 2.12.0