Skip to content
This repository was archived by the owner on Mar 10, 2025. It is now read-only.

Commit 9d40e4b

Browse files
committed
Separate eslint and prettier
- Dan Abramov did it: bluesky-social/social-app#3373 - Prettier recommends it: https://prettier.io/docs/en/comparison - Eslint has deprecated its formatting rules: https://eslint.org/blog/2023/10/deprecating-formatting-rules/ - This person wrote a blog post about it: https://www.joshuakgoldberg.com/blog/you-probably-dont-need-eslint-config-prettier-or-eslint-plugin-prettier/
1 parent f9a2056 commit 9d40e4b

7 files changed

Lines changed: 25 additions & 102 deletions

File tree

.eslintrc.cjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ module.exports = {
88
version: 29,
99
},
1010
},
11-
plugins: ['prettier'],
1211
extends: [
1312
'@remix-run/eslint-config',
1413
'@remix-run/eslint-config/node',
1514
'plugin:jsx-a11y/recommended',
16-
'plugin:prettier/recommended',
1715
],
1816
reportUnusedDisableDirectives: true,
1917
ignorePatterns: ['build/'],

.github/workflows/build.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ concurrency:
88

99
jobs:
1010
lint:
11-
name: 👖 ESLint
11+
name: 👖 Lint
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: ⬇️ Checkout repo
@@ -27,8 +27,11 @@ jobs:
2727
- name: 👖 Lint
2828
run: npm run lint
2929

30-
typecheck:
31-
name: 🔎 TypeScript
30+
- name: 💄 Prettier
31+
run: npm run prettier
32+
33+
types:
34+
name: 🔎 Types
3235
runs-on: ubuntu-latest
3336
steps:
3437
- name: ⬇️ Checkout repo

.prettierignore

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@ postgres-data
33

44
/build
55
/playwright-report
6-
/playwright/.cache
76
/public/build
87
/storybook-static
98
/test-results
109

11-
.env
12-
*.md
10+
# Ignore everything except JS/TS files.
11+
# Based on https://stackoverflow.com/a/70715829/458193
12+
*
13+
!*.cjs
14+
!*.js
15+
!*.jsx
16+
!*.mjs
17+
!*.ts
18+
!*.tsx
19+
!*/

.vscode/extensions.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
{
2-
"recommendations": ["dbaeumer.vscode-eslint", "bradlc.vscode-tailwindcss"]
2+
"recommendations": [
3+
"bradlc.vscode-tailwindcss",
4+
"dbaeumer.vscode-eslint",
5+
"esbenp.prettier-vscode"
6+
]
37
}

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
"editor.codeActionsOnSave": {
33
"source.fixAll.eslint": "explicit"
44
},
5+
"editor.defaultFormatter": "esbenp.prettier-vscode",
6+
"editor.formatOnSave": true,
57
"eslint.run": "onSave"
68
}

package-lock.json

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

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"docker": "docker compose up --detach",
1111
"docker:down": "docker compose down",
1212
"lint": "eslint --max-warnings 0 .",
13+
"prettier": "prettier . --cache --check",
1314
"prod": "NODE_ENV=production node --enable-source-maps ./build/server.js",
1415
"routes": "remix routes",
1516
"setup": "prisma generate && prisma migrate deploy && prisma db seed",
@@ -22,7 +23,7 @@
2223
"test:axeOnly": "axe-storybook --build-dir ./storybook-static",
2324
"test:e2e": "npm run setup:e2e && DATABASE_URL=postgresql://postgres:postgres@localhost:5432/test npx playwright test",
2425
"types": "tsc --noEmit",
25-
"validate": "run-p \"test -- --run\" lint types"
26+
"validate": "run-p \"test -- --run\" lint prettier types"
2627
},
2728
"eslintIgnore": [
2829
"/build",
@@ -88,8 +89,6 @@
8889
"dotenv": "^16.4.5",
8990
"esbuild": "^0.20.1",
9091
"eslint": "^8.57.0",
91-
"eslint-config-prettier": "^9.1.0",
92-
"eslint-plugin-prettier": "^5.1.3",
9392
"happy-dom": "^13.6.2",
9493
"npm-run-all": "^4.1.5",
9594
"null-loader": "^4.0.1",

0 commit comments

Comments
 (0)