From d08e350a4b44c755f65d50227329e212efafb1b2 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 7 Nov 2025 19:57:35 +0100 Subject: 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 --- src/frontend/.prettierignore | 9 +++++++++ src/frontend/.prettierrc | 10 ++++++++++ src/frontend/eslint.config.js | 32 ++++++++++++++++++++++++++++++++ src/frontend/package-lock.json | 1 + src/frontend/package.json | 3 +++ 5 files changed, 55 insertions(+) create mode 100644 src/frontend/.prettierignore create mode 100644 src/frontend/.prettierrc create mode 100644 src/frontend/eslint.config.js (limited to 'src/frontend') 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", -- cgit v1.3