Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5cddf5d
Fix lint issues and setup husky and lint workflow
vickystickz Jul 6, 2025
abaf8fd
Fix lint issue
vickystickz Jul 6, 2025
001af61
fix: resolve all eslint errors
vickystickz Jul 12, 2025
add689e
enhancement: Improve mobile performance to 50%
vickystickz Jul 12, 2025
417b456
fix: cta image
vickystickz Jul 12, 2025
5791448
fix: Return HOT-UI cdn link
vickystickz Jul 20, 2025
c12289b
formatted files by eslint
vickystickz Jul 20, 2025
d1402f9
fix: Revert HOTOSM UI script tag
vickystickz Aug 10, 2025
f3cdf3f
fix: revert header
vickystickz Aug 10, 2025
38cfdf1
fix: auth test file
vickystickz Aug 16, 2025
59867ec
fix: Lint warnings for tailwind class order
vickystickz Aug 16, 2025
5e3bd9b
chore: pr fixes
jeafreezy Aug 16, 2025
2364f2a
Merge branch 'august-enhancement' of https://github.com/jeafreezy/fAI…
jeafreezy Aug 16, 2025
835e812
Add: Lint and Precommit section to readme file
vickystickz Aug 17, 2025
826a5e7
remove 1. from command
vickystickz Aug 18, 2025
6a7bc31
chore: prevent undefined in tile server form name
jeafreezy Aug 22, 2025
367d973
chore: formatting
jeafreezy Aug 22, 2025
6b23f56
Merge pull request #6 from jeafreezy/enhancement/fix-lint-issue
jeafreezy Aug 22, 2025
9e53e2a
Revert "Enhancement/fix lint issue"
jeafreezy Aug 22, 2025
e8bd327
Merge pull request #7 from jeafreezy/revert-6-enhancement/fix-lint-issue
jeafreezy Aug 22, 2025
424c5de
Revert "Revert "Enhancement/fix lint issue""
jeafreezy Aug 22, 2025
17900c4
chore: formatting
jeafreezy Aug 22, 2025
9b0702f
Merge pull request #9 from jeafreezy/revert-7-revert-6-enhancement/fi…
jeafreezy Aug 22, 2025
d4fbae8
updated workflow
jeafreezy Aug 22, 2025
56e8617
chore: removed mapswipe
jeafreezy Aug 22, 2025
2b7b44a
updated workflow directory
jeafreezy Aug 22, 2025
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
8 changes: 8 additions & 0 deletions .github/workflows/frontend_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ jobs:
if: steps.pnpm-cache.outputs.cache-hit != 'true'
working-directory: ./frontend
run: pnpm install --frozen-lockfile

- name: Run Eslint
working-directory: ./frontend
run: pnpm lint

- name: Run Prettier check
working-directory: ./frontend
run: pnpm format:check

- name: Build
working-directory: ./frontend
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/frontend_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ jobs:
if: steps.pnpm-cache.outputs.cache-hit != 'true'
working-directory: ./frontend
run: pnpm install --frozen-lockfile

- name: Run Eslint
working-directory: ./frontend
run: pnpm lint

- name: Run Prettier check
working-directory: ./frontend
run: pnpm format:check

- name: Build frontend
working-directory: ./frontend
Expand Down
7 changes: 7 additions & 0 deletions frontend/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
echo "===== Navigating to project directory ====="
cd frontend

echo "===== Running precommit script ====="
pnpm precommit

echo "===== Pre-commit hook finished ====="
20 changes: 18 additions & 2 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,30 @@ The project standards are crucial for maintaining code quality, consistency, and

ESLint is used to maintain code quality and adhering to coding standards.

#### Lint

You can run linting to automatically check and fix code style issues. Run the following command in your terminal:

```bash
pnpm lint
```

#### Precommit

The precommit script is used to automatically check code style, run tests, and format code before commits are made. To run it manually, use:

```bash
pnpm precommit
```

#### Prettier

Prettier is a used to maintain consistent code formatting in the project. To format run the code below in the terminal.

```bash
1. pnpm/npm/yarn format
1. pnpm format

2. pnpm/npm/yarn format:check
2. pnpm format:check
```

#### TypeScript
Expand Down
59 changes: 42 additions & 17 deletions frontend/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,36 @@ 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/eslint-plugin';
import prettierPlugin from 'eslint-plugin-prettier';
import prettierConfig from 'eslint-config-prettier';
import tseslint from 'typescript-eslint'
import react from 'eslint-plugin-react'
import TypeScriptParser from '@typescript-eslint/parser'
import pluginQuery from '@tanstack/eslint-plugin-query'
import tailwind from "eslint-plugin-tailwindcss";


export default [

export default tseslint.config(
{ ignores: ['dist'] },

{
ignores: ['dist'],
extends: [
// Js
js.configs.recommended,
// Ts
...tseslint.configs.recommended,
// React
react.configs.flat.recommended,
// Prettier
...pluginQuery.configs['flat/recommended'],
...tailwind.configs["flat/recommended"],
prettierConfig,
],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
globals: globals.browser,
parser: '@typescript-eslint/parser',
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
'@tanstack/query': '@tanstack/query',
'prettier': prettierPlugin,
},
rules: {
Expand All @@ -31,12 +41,27 @@ export default [
{ allowConstantExport: true },
],
'prettier/prettier': 'error',
// To avoid the need to import React
'react/react-in-jsx-scope': 'off',
// To avoid the need to specify prop types
'react/prop-types': 'off',
'tailwindcss/no-custom-classname': 'off',
},
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
globals: globals.browser,
parser: TypeScriptParser,
},

settings: {
// For eslint-plugin-react to auto detect react version
react: {
version: 'detect'
},
},
},
js.configs.recommended,
...tseslint.configs.recommended,
'plugin:@tanstack/eslint-plugin-query/recommended',
'plugin:tailwindcss/recommended',
prettierConfig,
];

}
)


1 change: 0 additions & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<!-- HOT OSM UI -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@hotosm/[email protected]/dist/style.css" />
<script type="module" src="https://cdn.jsdelivr.net/npm/@hotosm/[email protected]/dist/hotosm-ui.js"></script>
<!-- HOT OSM UI -->
<title>HOT fAIr</title>
</head>

Expand Down
15 changes: 13 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,17 @@
"preview": "vite preview",
"format": "prettier --write 'src/**/*.{js,jsx,ts,tsx,json,css,scss,md}'",
"format:check": "prettier --check 'src/**/*.{js,jsx,ts,tsx,json,css,scss,md}'",
"test": "vitest",
"coverage": "vitest run --coverage"
"test": "vitest run --passWithNoTests",
"coverage": "vitest run --coverage",
"precommit": "lint-staged",
"prepare": "cd .. && husky frontend/.husky"
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx,json,css,scss,md,test.ts}": [
"pnpm format",
"pnpm test",
"pnpm lint"
]
},
"dependencies": {
"@reactour/tour": "^3.7.0",
Expand Down Expand Up @@ -71,7 +80,9 @@
"eslint-plugin-react-refresh": "^0.4.12",
"eslint-plugin-tailwindcss": "^3.17.5",
"globals": "^15.10.0",
"husky": "^9.1.7",
"jsdom": "^26.0.0",
"lint-staged": "^16.1.2",
"postcss": "^8.4.47",
"prettier": "3.3.3",
"tailwindcss": "^3.4.13",
Expand Down
Loading