From b724c2a37f2fa424ccbfae41c066589a4b98ab10 Mon Sep 17 00:00:00 2001 From: "Jean Z. SORDES" Date: Thu, 2 Oct 2025 19:38:39 +0200 Subject: [PATCH] Update README.md to emphasize that CustomJS only supports single class definitions per file. Added examples of incorrect and correct usage to clarify the requirements for file structure. --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9912320..a22216d 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,18 @@ Allows you to bind an [Invocable Script](#invocable-scripts) to a hotkey. ## Usage/Example -CustomJS works by writing javascript classes. Each file can contain one class _and only one class_. Imports, constants, etc defined outside the class will break CustomJS. +**Important:** CustomJS **only** works with JavaScript classes. Each file must contain exactly one class - no more, no less. Any other code structure will not work. + +❌ **This will NOT work:** +- `module.exports = Highlights;` +- Bare functions like `function myFunction() {}` +- Variable exports like `export const myVar = "value";` +- Any code outside of a class definition + +✅ **Only this works:** +- A single class definition per file, like `class MyClass { ... }` + +Imports, constants, and any other code defined outside the class will break CustomJS. Everything must be contained within the class definition. ### Accessing your classes