Skip to content
Open
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
5 changes: 2 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/sh
#!/usr/bin/env sh
Comment thread
ashleyshaw marked this conversation as resolved.
. "$(dirname "$0")/_/husky.sh"

npm run check
npx lint-staged
3 changes: 3 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh
Comment thread
ashleyshaw marked this conversation as resolved.
. "$(dirname "$0")/_/husky.sh"
npm test
39 changes: 38 additions & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,46 @@ This repository provides linting tools for JavaScript, CSS, and other code stand

## Agents & Shared Scripts

A `scripts/` folder is used to contain shared functions for agents.
A `scripts/` folder is used to contain shared functions for agents.
Agents are written in JavaScript, and reusable logic or utilities should be placed here for maintainability and collaboration across the organization.

## Git Hooks (Husky)

This repository uses [Husky](https://typicode.github.io/husky/) to enforce code quality checks before commits and pushes. Git hooks are automatically installed when you run `npm install`.

### Pre-commit Hook

The pre-commit hook runs `lint-staged` to automatically lint and format only the files you're committing:

- **JavaScript/TypeScript files**: ESLint fixes and Prettier formatting
- **JSON files**: Prettier formatting
- **Markdown files**: markdownlint fixes and Prettier formatting
- **YAML files**: Prettier formatting
- **package.json**: npm-package-json-lint validation

If any linting errors cannot be automatically fixed, the commit will be blocked until you resolve them.

### Pre-push Hook

The pre-push hook runs the test suite to ensure all tests pass before pushing to the remote repository:

```bash
npm test
```

If any tests fail, the push will be blocked until you fix the failing tests.

### Bypassing Hooks (Not Recommended)

In rare cases where you need to bypass the hooks (e.g., work-in-progress commits), you can use:

```bash
git commit --no-verify -m "WIP: Your message"
git push --no-verify
```

**Note:** This is not recommended for production code and should only be used when absolutely necessary.

## Git Workflow

1. Create a feature branch for your work:
Expand Down
File renamed without changes.
Loading
Loading