Skip to content
Merged
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@ npm test

### Tools

- ESLint with TypeScript and React Hooks rules, and Prettier for formatting.
- Strict TypeScript in both frontend and backend.
- ESLint and Prettier in both frontend and backend, with the same settings. The frontend also has the React Hooks rules.
- Strict TypeScript in both frontend and backend. Both use TypeScript 6, because typescript-eslint does not support TypeScript 7 yet.

<!--
When added, write: "eslint-plugin-jsx-a11y checks accessibility rules in JSX."
Expand Down Expand Up @@ -444,7 +444,7 @@ Claude and ChatGPT are the main models used. The usecases for the AI tools are a
- [x] Measure sustainability and fill in the budget table.
- [ ] Compress API responses and set cache header in Apache.
- [ ] Screen reader test and a written reflection on the use of AI.
- [ ] Prettier and ESLint in the backend, like in the frontend.
- [x] Prettier and ESLint in the backend, like in the frontend.

### Done

Expand Down
2 changes: 2 additions & 0 deletions backend/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Always LF in the working copy, also on Windows, so Prettier (endOfLine: lf) agrees everywhere.
* text=auto eol=lf
6 changes: 6 additions & 0 deletions backend/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
package-lock.json
dist
coverage
# X-Wines test data
data
6 changes: 6 additions & 0 deletions backend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"semi": true,
"printWidth": 100,
"trailingComma": "all"
}
19 changes: 19 additions & 0 deletions backend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import js from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import { defineConfig, globalIgnores } from 'eslint/config';
import prettier from 'eslint-config-prettier';

// The same rules as the frontend, without the React ones. .mjs because package.json says
// "commonjs", and this file uses import (the same reason vitest.config is .mts).
export default defineConfig([
globalIgnores(['dist', 'coverage']),
{
files: ['**/*.{ts,mts}'],
extends: [js.configs.recommended, tseslint.configs.recommended],
languageOptions: {
globals: globals.node,
},
},
prettier,
]);
Loading