diff --git a/crates/turborepo-lib/src/turbo_json/parser.rs b/crates/turborepo-lib/src/turbo_json/parser.rs index d46e0a0f0f10a..c5dac9d2046f0 100644 --- a/crates/turborepo-lib/src/turbo_json/parser.rs +++ b/crates/turborepo-lib/src/turbo_json/parser.rs @@ -295,7 +295,9 @@ impl RawTurboJson { pub fn parse(text: &str, file_path: &str) -> Result { let result = deserialize_from_json_str::( text, - JsonParserOptions::default().with_allow_comments(), + JsonParserOptions::default() + .with_allow_comments() + .with_allow_trailing_commas(), file_path, ); diff --git a/turborepo-tests/integration/fixtures/turbo-configs/syntax-error.json b/turborepo-tests/integration/fixtures/turbo-configs/syntax-error.json index 991c4b3b5d97f..9f228db6d8845 100644 --- a/turborepo-tests/integration/fixtures/turbo-configs/syntax-error.json +++ b/turborepo-tests/integration/fixtures/turbo-configs/syntax-error.json @@ -1,5 +1,5 @@ { - "$schema": "https://turborepo.com/schema.json",, + "$schema": "https://turborepo.com/schema.json", "globalDependencies": ["foo.txt"], "globalEnv": ["SOME_ENV_VAR"], "tasks": { diff --git a/turborepo-tests/integration/tests/bad-turbo-json.t b/turborepo-tests/integration/tests/bad-turbo-json.t index 9598002cf1ab9..cf0aae71ac581 100644 --- a/turborepo-tests/integration/tests/bad-turbo-json.t +++ b/turborepo-tests/integration/tests/bad-turbo-json.t @@ -93,13 +93,6 @@ Run build with syntax errors in turbo.json turbo_json_parse_error x Failed to parse turbo.json. - |-> x Expected a property but instead found ','. - | ,-[turbo.json:2:50] - | 1 | { - | 2 | "$schema": "https://turborepo.com/schema.json",, - | : ^ - | 3 | "globalDependencies": ["foo.txt"], - | `---- |-> x expected `,` but instead found `42` | ,-[turbo.json:12:46] | 11 | "my-app#build": {