-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
kind: bugSomething isn't workingSomething isn't working
Description
Verify canary release
- I verified that the issue exists in the latest Turborepo canary release.
Which canary version will you have in your reproduction?
2.5.3
Environment information
node 22.15.0
npm 10.9.2
prettier 3.5.3
Expected behavior
turbo.jsonc can be formatted with prettier defaults and is accepted by turbo.
Actual behavior
turbo.jsonc formatted with prettier defaults is not accepted by turbo.
To Reproduce
$ npx create-turbo@latest -e with-shell-commands -m npm test
$ cd test
$ npm i -D prettier
$ npx prettier --write .
$ turbo build
...
Tasks: 5 successful, 5 total
Cached: 0 cached, 5 total
Time: 1.934s$ mv turbo.json turbo.jsonc
$ npx prettier --write .
$ turbo build
turbo_json_parse_error
× Failed to parse turbo.json.
├─▶ × Expected a property but instead found '}'.
│ ╭─[turbo.jsonc:7:5]
│ 6 │ "outputs": ["output-file.txt", "dist/**"],
│ 7 │ },
│ · ─
│ 8 │ "prebuild": {},
│ ╰────
├─▶ × Expected a property but instead found '}'.
│ ╭─[turbo.jsonc:11:3]
│ 10 │ "check-types": {},
│ 11 │ },
│ · ─
│ 12 │ }
│ ╰────
╰─▶ × Expected a property but instead found '}'.
╭─[turbo.jsonc:12:1]
11 │ },
12 │ }
· ─
╰────
$ cat turbo.jsonc
{
"$schema": "https://turborepo.com/schema.json",
"tasks": {
"build": {
"dependsOn": ["prebuild", "^build"],
"outputs": ["output-file.txt", "dist/**"],
},
"prebuild": {},
"lint": {},
"check-types": {},
},
}Additional context
JSONC doesn’t allow trailing commas; however, we encourage parsers to be lenient and handle trailing commas gracefully where possible to reduce the risk of human edits introducing parsing errors.
Metadata
Metadata
Assignees
Labels
kind: bugSomething isn't workingSomething isn't working