The Creative Coding playground enforces consistent code style and commit hygiene through a three-part toolchain.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/hetari/creative-coding/llms.txt
Use this file to discover all available pages before exploring further.
@antfu/eslint-config provides an opinionated, zero-config ESLint setup that covers TypeScript, Vue 3, and formatting in one package. Husky registers Git hooks, and nano-staged runs ESLint auto-fix on every staged file before a commit is recorded — so style issues are corrected automatically rather than blocking the developer. Finally, Commitlint validates every commit message against the Conventional Commits specification, ensuring the project history stays readable and tooling-friendly.
ESLint
Configuration
ESLint is configured ineslint.config.js using the @antfu/eslint-config preset with formatters and Vue support enabled:
formatters: true option activates eslint-plugin-format, which delegates file formatting (indentation, trailing commas, quote style) to Prettier-compatible rules inside ESLint rather than requiring a separate Prettier process. The vue: true option enables Vue single-file-component parsing and Vue-specific lint rules.
Running Lint
Use the following scripts, defined inpackage.json, to check or fix the entire project:
eslint (or eslint --fix) against all *.{js,ts,vue} files matched by the config. Run lint:fix after any bulk refactor or when onboarding to resolve accumulated style drift in one pass.
@antfu/eslint-config is opinionated by design — it enforces single quotes, no semicolons, consistent import ordering, and other stylistic rules out of the box. You do not need a separate .prettierrc or prettier dependency.Pre-commit Hooks (Husky + nano-staged)
How It Works
Husky installs apre-commit Git hook that fires automatically every time you run git commit. The hook delegates to nano-staged, which reads the "nano-staged" key in package.json and runs the configured command against only the files you have staged — not the entire repository.
The pre-commit hook script:
package.json:
- You stage your changes with
git add. - You run
git commit. - Husky fires the
pre-commithook. - nano-staged finds every staged
*.js,*.ts, or*.vuefile and runseslint --fixon each one in-place. - The auto-fixed versions of those files are included in the commit automatically.
- If ESLint encounters an error it cannot fix automatically, the commit is aborted and the error is printed to the terminal.
Benefits
Because only staged files are linted, the pre-commit step is fast even in a large workspace. You never need to runbun run lint:fix manually before committing — nano-staged handles it for you.
If a file has both staged and unstaged changes, nano-staged handles the stash/unstash cycle automatically so your unstaged work is not accidentally included in the commit.
Commitlint (Conventional Commits)
Overview
Thecommit-msg Husky hook validates every commit message using @commitlint/cli against @commitlint/config-conventional before the commit is finalised. Any message that does not conform to the Conventional Commits format causes the commit to be rejected with a clear error message.
The commit-msg hook script:
commitlint.config.js:
Conventional Commits Format
Every commit message must follow this structure:Valid Commit Types
| Type | When to use |
|---|---|
feat | A new sketch, feature, or capability |
fix | A bug fix |
docs | Documentation changes only |
style | Code style changes that do not affect logic (formatting, whitespace) |
refactor | Code restructuring that is neither a fix nor a feature |
perf | A change that improves performance |
test | Adding or updating tests |
build | Changes to the build system or dependencies |
ci | Changes to CI configuration files or scripts |
chore | Routine tasks — dependency bumps, tooling config, etc. |
revert | Reverts a previous commit |
Valid Commit Message Examples
Invalid Commit Message Examples
The following messages will be rejected by commitlint:Setup
Husky and commitlint are already configured and their hook files are committed to the repository under.husky/. No manual setup is required beyond the normal install step.
When you run bun install for the first time, the prepare lifecycle script runs automatically:
.husky/ hook scripts with your local Git configuration. From that point on, both the pre-commit (nano-staged ESLint fix) and commit-msg (commitlint validation) hooks are active for every commit made in the repository.
If you clone the repository and skip
bun install, the hooks will not be registered and neither auto-fix nor commit message validation will run. Always install dependencies before making commits.