Luxel compiler diagnostics
luxel build reports problems in two formats with the same content:
- Text, for people: file:line:column - severity CODE (rule): message, the source line with a caret, and a suggestion: line.
- JSON, for tools and AI agents: luxel build --json prints { ok, errors, warnings, diagnostics: [...], outputs }. Each diagnostic is { code, severity, file, line, column, rule, message, suggestion }.
Rules for both formats:
- file is relative to the project, with forward slashes.
- line and column are 1-based.
- code is stable: a code is never renumbered or reused. A new check gets a new code.
- The exit code is 0 when there are no errors, 1 when there are errors, and 2 for a usage error.
Codes
| Code | Rule | Severity | When | What to write instead |
|---|---|---|---|---|
| LUXEL-E000 | syntax | error | TypeScript/JSX syntax error | Fix the syntax at the position |
| LUXEL-E001 | no-function-handler | error | A prop is a function (onClick={…}, onMouseEnter, any on*) | Logic runs on the server: ‹Action event="…"> and defineEvent; local changes in onSuccess |
| LUXEL-E002 | no-react-import | error | Import of react, react-dom or a client component library | Components from @luxel-framework/ui; your own helpers and data are fine |
| LUXEL-E003 | no-hooks | error | A hook (useState, useEffect…) imported from React or @luxel-framework/ui | Server state with bind, changes with ‹Action event>, local presentation with onSuccess |
| LUXEL-E004 | unknown-component | error | An HTML element (‹div>, ‹button>), a class component or a value that is not a component | ‹Stack as="div">, ‹Action>, ‹Field>… or a function component |
| LUXEL-E005 | duplicate-id | error | Two zones share an id in one view | Rename one: zone ids are unique per view |
| LUXEL-E006 | unknown-bind | error | bind names a path the server contract does not declare | A declared path (the message lists them and suggests the closest) |
| LUXEL-E007 | unknown-event | error | An ‹Action event> that the server contract does not handle | A declared event, or declare it in server/contract.ts |
| LUXEL-E008 | collection-without-key | error | ‹Collection> without itemKey | itemKey="‹the key the contract declares>" |
| LUXEL-E009 | missing-id | error | Static ‹Text>, ‹Action> or ‹Status> without id | id="…" (a suggestion is derived from the text) |
| LUXEL-E010 | unknown-prop | error | A prop the component does not have (style, class, dangerouslySetInnerHTML…) | className and your stylesheet; text is always text |
| LUXEL-E011 | invalid-prop-value | error | A value outside what the prop accepts (type="email", a bad class list, maxLength out of range…) | One of the values the message lists |
| LUXEL-E012 | missing-prop | error | A required prop is missing (title, dataClass, event, name, label…) | Add it; dataClass has no default on purpose |
| LUXEL-E013 | unknown-reference | error | status, onSuccess.clear, onSuccess.focus or fields names a zone that is missing or of the wrong kind | A ‹Status> id, ‹Field> names, an ‹Action> id |
| LUXEL-E014 | bind-type-mismatch | error | ‹Text> bound to a collection, or ‹Collection> bound to a single value | The matching component |