Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: replace eslint and prettier with biome #126

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 0 additions & 49 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
- name: Install dependencies
run: npm ci
- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

steps:
- name: 🛎️ Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 🔐 Login to Docker Registry
uses: docker/login-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.*
v20.17.0
7 changes: 0 additions & 7 deletions .prettierrc

This file was deleted.

3 changes: 3 additions & 0 deletions .vim/coc-settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"prettier.formatterPriority": -1
}
12 changes: 6 additions & 6 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint"
],
"unwantedRecommendations": []
}
"recommendations": ["biomejs.biome"],
"unwantedRecommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint"
]
}
10 changes: 4 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
},
"editor.formatOnSave": true,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "biomejs.biome"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
"editor.defaultFormatter": "biomejs.biome"
},
"prettier.enable": false
}
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18-slim as BUILDER
FROM node:20-slim as BUILDER

WORKDIR /home/app

Expand All @@ -14,7 +14,7 @@ ENV NODE_ENV production
RUN npm prune --production

# A slimmed down runner image with only the bare necessities
FROM node:18-slim AS runner
FROM node:20-slim AS runner
WORKDIR /home/app
COPY --from=BUILDER /home/app/node_modules ./node_modules
COPY --from=BUILDER /home/app/package* ./
Expand All @@ -25,4 +25,4 @@ COPY ./migrations ./migrations
ENV PORT 80
EXPOSE 80

CMD ["npm", "run", "start"]
CMD ["npm", "run", "start"]
64 changes: 64 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.2/schema.json",
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
"files": { "ignoreUnknown": false, "ignore": [] },
"formatter": {
"enabled": true,
"useEditorconfig": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 80,
"attributePosition": "auto",
"bracketSpacing": true
},
"organizeImports": { "enabled": false },
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"useImportType": "off",
"useTemplate": "off",
"noUselessElse": "off",
"noUnusedTemplateLiteral": "off",
"useNumberNamespace": "off",
"noParameterAssign": "off",
"useNodejsImportProtocol": "off"
},
"suspicious": { "noDoubleEquals": "warn", "noExplicitAny": "warn" },
"complexity": { "useLiteralKeys": "off", "noForEach": "off" },
"performance": { "noAccumulatingSpread": "off" },
"correctness": {
"noUnusedVariables": "warn",
"noUnusedFunctionParameters": "warn",
"noUnusedImports": "warn"
}
}
},
"overrides": [
{
"include": ["**/*.test.ts"],
"linter": {
"rules": {
"suspicious": {
"noThenProperty": "off"
}
}
}
}
],
"javascript": {
"formatter": {
"quoteProperties": "asNeeded",
"trailingCommas": "es5",
"semicolons": "asNeeded",
"arrowParentheses": "always",
"bracketSameLine": false,
"quoteStyle": "single",
"attributePosition": "auto",
"bracketSpacing": true
}
}
}
Loading