Re-style the Ruff playground (#1438)

This commit is contained in:
Charlie Marsh 2022-12-29 11:47:27 -05:00 committed by GitHub
parent 057414ddd4
commit acf0b82f19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 2218 additions and 398 deletions

View file

@ -16,6 +16,8 @@ use crate::settings::{flags, Settings};
use crate::source_code_locator::SourceCodeLocator;
use crate::source_code_style::SourceCodeStyleDetector;
const VERSION: &str = env!("CARGO_PKG_VERSION");
#[wasm_bindgen(typescript_custom_section)]
const TYPES: &'static str = r#"
export interface Check {
@ -59,6 +61,11 @@ pub fn run() {
console_log::init_with_level(Level::Debug).expect("Initializing logger went wrong.");
}
#[wasm_bindgen]
pub fn current_version() -> JsValue {
JsValue::from(VERSION)
}
#[wasm_bindgen]
pub fn check(contents: &str, options: JsValue) -> Result<JsValue, JsValue> {
let options: Options = serde_wasm_bindgen::from_value(options).map_err(|e| e.to_string())?;