Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions docs/error-codes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# Facetpack CLI Doctor – Error Codes

This document explains the error codes generated by the Facetpack CLI Doctor.
Each error code helps identify a specific syntax or usage issue and provides
guidance on how to resolve it.

---

## E0000 – Unknown parsing error

**Description:**
An unspecified parsing error occurred.

**Common causes:**
- Unsupported or malformed syntax
- Incomplete or corrupted source file

**How to fix:**
- Review the reported line and surrounding code
- Ensure the file contains valid JavaScript/TypeScript syntax

---

## E0001 – Expected token not found

**Description:**
The parser expected a specific token but encountered a different one.

**Common causes:**
- Missing closing braces `}`, parentheses `)`, or brackets `]`
- Missing semicolons or punctuation

**How to fix:**
- Check for unclosed blocks or expressions
- Ensure all syntax elements are properly closed

---

## E0002 – Unexpected token

**Description:**
An unexpected token was encountered during parsing.

**Common causes:**
- Typographical errors
- Invalid syntax for the current context

**How to fix:**
- Verify the syntax near the reported location
- Remove or correct the unexpected token

---

## E0003 – Unterminated construct

**Description:**
A string, comment, or other construct was not properly terminated.

**Common causes:**
- Missing closing quotes (`'`, `"`, `` ` ``)
- Unclosed block comments

**How to fix:**
- Ensure all strings and comments are properly closed

---

## E0004 – Reserved word usage

**Description:**
A reserved keyword was used incorrectly.

**Common causes:**
- Using JavaScript reserved words as variable or function names

**How to fix:**
- Rename the identifier to a non-reserved word

---

## E0005 – Invalid `return` usage

**Description:**
The `return` keyword was used in an invalid context.

**Common causes:**
- Using `return` outside of a function body

**How to fix:**
- Ensure `return` statements are only used inside functions

---

## E0006 – Invalid `await` usage

**Description:**
The `await` keyword was used where it is not allowed.

**Common causes:**
- Using `await` outside of an `async` function

**How to fix:**
- Wrap the code in an `async` function or remove `await`

---

## E0007 – Invalid `import` or `export` usage

**Description:**
The `import` or `export` statement was used incorrectly.

**Common causes:**
- Using `import`/`export` in non-module files
- Incorrect module syntax

**How to fix:**
- Ensure the file is treated as a module
- Verify correct usage of `import` and `export` statements




Loading