Skip to content
Draft
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
25 changes: 21 additions & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
#!/bin/sh

# Exit if any command fails
set -e

# Navigate to the root directory of the repository
cd "$(git rev-parse --show-toplevel)"

# Navigate to frontend directory and run linting
(cd frontend && npm run lint:fix)
# Ensure node modules are installed before running linting
if [ ! -d "frontend/node_modules" ]; then
echo "Node modules not found in frontend. Installing..."
cd frontend && npm install
fi

# Navigate to frontend directory and run linting with explicit paths
(cd frontend && ./node_modules/.bin/eslint --fix 'src/**/*.{js,jsx}' && ./node_modules/.bin/prettier --write 'src/**/*.{js,jsx}')

# Ensure node modules are installed in backend if necessary
if [ -d "backend" ] && [ ! -d "backend/node_modules" ]; then
echo "Node modules not found in backend. Installing..."
cd backend && npm install
fi

# Navigate to backend directory and run linting
(cd backend && npm run lint:fix)
# Navigate to backend directory and run linting (if it exists)
if [ -d "backend" ]; then
(cd backend && ./node_modules/.bin/eslint --fix 'src/**/*.{js,jsx}')
fi
38 changes: 38 additions & 0 deletions backend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import globals from "globals";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [...compat.extends("eslint:recommended"), {
languageOptions: {
globals: {
...globals.node,
...globals.jest,
},

ecmaVersion: "latest",
sourceType: "module",
},

rules: {},
}, {
files: ["**/.eslintrc.{js,cjs}"],

languageOptions: {
globals: {
...globals.node,
},

ecmaVersion: 5,
sourceType: "commonjs",
},
}];
131 changes: 96 additions & 35 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@
"mongoose": "^8.1.1"
},
"devDependencies": {
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.14.0",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.0",
"globals": "^15.12.0",
"jest": "^29.7.0",
"nodemon": "^3.1.0",
"prettier": "^3.2.5",
Expand Down
1 change: 1 addition & 0 deletions frontend/assets/icons/aura-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed frontend/assets/icons/baby-changing.png
Binary file not shown.
Loading