You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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. (#104)
Copy file name to clipboardExpand all lines: README.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,18 @@ Allows you to bind an [Invocable Script](#invocable-scripts) to a hotkey.
41
41
42
42
## Usage/Example
43
43
44
-
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.
44
+
**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.
45
+
46
+
❌ **This will NOT work:**
47
+
-`module.exports = Highlights;`
48
+
- Bare functions like `function myFunction() {}`
49
+
- Variable exports like `export const myVar = "value";`
50
+
- Any code outside of a class definition
51
+
52
+
✅ **Only this works:**
53
+
- A single class definition per file, like `class MyClass { ... }`
54
+
55
+
Imports, constants, and any other code defined outside the class will break CustomJS. Everything must be contained within the class definition.
0 commit comments