Skip to content

darosh/eslint-plugin-maxpat

Repository files navigation

eslint-plugin-maxpat [WIP]

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.

Install

Prerequisites: Node.js

npm init
npm i eslint
npm i https://github.com/darosh/eslint-plugin-maxpat

Usage

Learn about ESLint

Example config

https://github.com/darosh/px-stream/blob/main/eslint.config.mjs

Run

eslint ./*.maxpat --rule={"maxpat/ui/annotation-info":"off"}

Run with fix (use with caution!)

eslint ./*.maxpat --rule={"maxpat/ui/annotation-info":"off"} --fix

List UI elements and their annotation

eslint ./*.maxpat --format node_modules/eslint-plugin-maxpat/lib/formatter.js

Rules

💼 Configurations enabled in.
⚠️ Configurations set to warn in.
✅ Set in the recommended configuration.
⚙️ Has configuration options.
🔧 Automatically fixable by the --fix CLI option.

Layout

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 ⚙️ 🔧

Misc

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 ⚙️

About

An ESLint plugin for linting Max/MSP patch files (.maxpat)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published