aboutsummaryrefslogtreecommitdiff
path: root/src/frontend
diff options
context:
space:
mode:
authorCopilot <198982749+Copilot@users.noreply.github.com>2025-11-07 19:57:35 +0100
committerGitHub <noreply@github.com>2025-11-07 19:57:35 +0100
commitd08e350a4b44c755f65d50227329e212efafb1b2 (patch)
tree6ef970552b18ce11ae42d2029945fe4363195f65 /src/frontend
parentf7fc0b5a397e4eaa7a604edb97169ee3d5c5f82e (diff)
Add formatting tools and VSCode configuration (#83)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: arielcostas <94913521+arielcostas@users.noreply.github.com> Co-authored-by: Ariel Costas Guerrero <ariel@costas.dev>
Diffstat (limited to 'src/frontend')
-rw-r--r--src/frontend/.prettierignore9
-rw-r--r--src/frontend/.prettierrc10
-rw-r--r--src/frontend/eslint.config.js32
-rw-r--r--src/frontend/package-lock.json1
-rw-r--r--src/frontend/package.json3
5 files changed, 55 insertions, 0 deletions
diff --git a/src/frontend/.prettierignore b/src/frontend/.prettierignore
new file mode 100644
index 0000000..639a305
--- /dev/null
+++ b/src/frontend/.prettierignore
@@ -0,0 +1,9 @@
+node_modules
+dist
+build
+.react-router
+coverage
+*.min.js
+*.min.css
+package-lock.json
+.vscode
diff --git a/src/frontend/.prettierrc b/src/frontend/.prettierrc
new file mode 100644
index 0000000..115ffb9
--- /dev/null
+++ b/src/frontend/.prettierrc
@@ -0,0 +1,10 @@
+{
+ "semi": true,
+ "trailingComma": "es5",
+ "singleQuote": false,
+ "printWidth": 80,
+ "tabWidth": 2,
+ "useTabs": false,
+ "arrowParens": "always",
+ "endOfLine": "lf"
+}
diff --git a/src/frontend/eslint.config.js b/src/frontend/eslint.config.js
new file mode 100644
index 0000000..2439911
--- /dev/null
+++ b/src/frontend/eslint.config.js
@@ -0,0 +1,32 @@
+import js from "@eslint/js";
+import globals from "globals";
+import reactHooks from "eslint-plugin-react-hooks";
+import reactRefresh from "eslint-plugin-react-refresh";
+import tseslint from "typescript-eslint";
+
+export default tseslint.config(
+ { ignores: ["dist", "build", ".react-router", "node_modules"] },
+ {
+ extends: [js.configs.recommended, ...tseslint.configs.recommended],
+ files: ["**/*.{ts,tsx}"],
+ languageOptions: {
+ ecmaVersion: 2020,
+ globals: globals.browser,
+ },
+ plugins: {
+ "react-hooks": reactHooks,
+ "react-refresh": reactRefresh,
+ },
+ rules: {
+ ...reactHooks.configs.recommended.rules,
+ "react-refresh/only-export-components": [
+ "warn",
+ { allowConstantExport: true },
+ ],
+ "@typescript-eslint/no-unused-vars": [
+ "error",
+ { argsIgnorePattern: "^_" },
+ ],
+ },
+ }
+);
diff --git a/src/frontend/package-lock.json b/src/frontend/package-lock.json
index 2c28547..947918b 100644
--- a/src/frontend/package-lock.json
+++ b/src/frontend/package-lock.json
@@ -43,6 +43,7 @@
"jiti": "^2.6.1",
"maplibre-gl": "^5.9.0",
"pmtiles": "^4.3.0",
+ "prettier": "^3.6.2",
"react-map-gl": "^8.1.0",
"typescript": "^5.9.3",
"typescript-eslint": "^8.46.0",
diff --git a/src/frontend/package.json b/src/frontend/package.json
index 367d106..048ee98 100644
--- a/src/frontend/package.json
+++ b/src/frontend/package.json
@@ -8,6 +8,8 @@
"dev": "react-router dev --host",
"start": "react-router-serve ./build/server/index.js",
"typecheck": "react-router typegen && tsc",
+ "lint": "eslint .",
+ "lint:fix": "eslint . --fix",
"format": "prettier --write .",
"checkformat": "prettier --check ."
},
@@ -46,6 +48,7 @@
"jiti": "^2.6.1",
"maplibre-gl": "^5.9.0",
"pmtiles": "^4.3.0",
+ "prettier": "^3.6.2",
"react-map-gl": "^8.1.0",
"typescript": "^5.9.3",
"typescript-eslint": "^8.46.0",