You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 23, 2025. It is now read-only.
description: JavaScript and frontend development standards for Phoenix LiveView hooks, formatting, and asset management
globs:
alwaysApply: false
---
- When creating javascript hooks for Phoenix LiveView, you do not need to create an index.js file to import the hook. Simply, update the app.js, import the hook like `import FlatpickrCalendar from './hooks/flatpickr_calendar' at the top and update the `Hooks` variable (e.g. `const Hooks = { FlatpickrCalendar }`).
- Always run `mix prettier` to fix formatting issues.
- Do not leave unnecessary comments in the JS file.
- Variable assignments should be sorted alphabetically in an ascending order.
- Import blocks should be sorted alphabetically in an ascending order.
- Data in objects should also be sorted alphabetically in an ascending order.
- Always run `mix prettier` after generating Javascript code to format the files.
- Assets are built automatically so there's no need to run `npm run build`.