diff --git a/crates/squawk_wasm/src/lib.rs b/crates/squawk_wasm/src/lib.rs index 971f8b63..88e0105c 100644 --- a/crates/squawk_wasm/src/lib.rs +++ b/crates/squawk_wasm/src/lib.rs @@ -179,6 +179,9 @@ impl SquawkDatabase { .map(|(_, ending)| ending) .unwrap_or_default(); let parse = db::parse(&self.db, file); + if !parse.errors().is_empty() { + return Err(Error::new("Cannot format SQL with syntax errors.")); + } squawk_fmt::fmt(&parse.tree(), line_ending).map_err(into_error) } diff --git a/playground/babel.config.js b/playground/babel.config.js new file mode 100644 index 00000000..3e9a0331 --- /dev/null +++ b/playground/babel.config.js @@ -0,0 +1,17 @@ +import styleXPlugin from "@stylexjs/babel-plugin" + +export default { + presets: ["@babel/preset-typescript"], + plugins: [ + [ + styleXPlugin, + { + runtimeInjection: false, + unstable_moduleResolution: { + type: "commonJS", + rootDir: import.meta.dirname, + }, + }, + ], + ], +} diff --git a/playground/index.html b/playground/index.html index a63bf541..c293c145 100644 --- a/playground/index.html +++ b/playground/index.html @@ -6,7 +6,7 @@