An ESLint plugin for linting Max/MSP patch files (.maxpat)
⚠️ This is experimental work in progress. Use with caution!
So far tested only here on 30+ maxpat files and 3000+ issues.
Prerequisites: Node.js
npm initnpm i eslintnpm i https://github.com/darosh/eslint-plugin-maxpatLearn about ESLint
https://github.com/darosh/px-stream/blob/main/eslint.config.mjs
eslint ./*.maxpat --rule={"maxpat/ui/annotation-info":"off"}eslint ./*.maxpat --rule={"maxpat/ui/annotation-info":"off"} --fixeslint ./*.maxpat --format node_modules/eslint-plugin-maxpat/lib/formatter.js💼 Configurations enabled in.
✅ Set in the recommended configuration.
⚙️ Has configuration options.
🔧 Automatically fixable by the --fix CLI option.
| Name | Description | 💼 | ⚙️ | 🔧 | |
|---|---|---|---|---|---|
| layout/grid-size | Require specific grid size in Max/MSP patches | ✅ | ⚙️ | 🔧 | |
| layout/no-segmented-cords | Disallow segmented patch cords (midpoints) in Max/MSP patches | ✅ | ⚙️ | 🔧 | |
| layout/patching-overlaps | Check for overlapping objects in patching mode | ✅ | ⚙️ | ||
| layout/position-rounding | Require proper coordinate rounding for patching_rect and presentation_rect in Max/MSP patches | ✅ | ⚙️ | 🔧 | |
| layout/presentation-overlaps | Check for overlapping objects in presentation mode | ✅ | ⚙️ | ||
| layout/snap-to-grid | Require snap to grid to be enabled in Max/MSP patches | ✅ | ⚙️ | 🔧 | |
| layout/snap-to-pixel | Enforce snap to pixel setting in Max/MSP patches | ✅ | ⚙️ | 🔧 |
| Name | Description | 💼 | ⚙️ | 🔧 | |
|---|---|---|---|---|---|
| compatibility/deprecated | Warns against the use of deprecated Max/MSP objects | ✅ | ⚙️ | ||
| debug/connected-print | Check for print objects with active connections that should be disabled in production | ✅ | ⚙️ | 🔧 | |
| flow/disconnected | No disconnected objects | ✅ | ⚙️ | ||
| flow/disconnected-outlets | No disconnected outlets | ✅ | ⚙️ | ||
| flow/global-send-receive | Check for global send/receive names that are not in allowed exceptions list | ✅ | ⚙️ | ||
| flow/local-send-receive | Check for matching send/receive pairs with triple dash prefix | ✅ | ⚙️ | ||
| performance/defer | Check for UI objects that should use defer for thread-safe operation | ✅ | ⚙️ | ||
| performance/speed-limit | Check parameter_speedlim value for specified object types | ✅ | ⚙️ | 🔧 | |
| structure/no-unused-styles | Disallow unused styles in Max/MSP patches | ✅ | ⚙️ | 🔧 | |
| structure/require | Require essential Live objects in Max for Live device patches | ✅ | ⚙️ | ||
| structure/validate | Ensure the .maxpat file has a valid root patcher object | ✅ | |||
| ui/annotation-info | List all UI elements with their names and annotations for review | ✅ | ⚙️ |