Skip to content

Commit

Permalink
Fix compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
SamWilsn committed Jun 6, 2024
1 parent a736a88 commit beef0c9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
2 changes: 1 addition & 1 deletion eipw-lint-js/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ pub async fn lint(sources: Vec<JsValue>, options: Option<Object>) -> Result<JsVa

#[wasm_bindgen]
pub fn format(snippet: &JsValue) -> Result<String, JsError> {
let value: serde_json::Value = serde_wasm_bindgen::from_value(snippet.deref().clone())?;
let value: serde_json::Value = serde_wasm_bindgen::from_value(snippet.clone())?;

let obj = match value {
serde_json::Value::Object(o) => o,
Expand Down
35 changes: 30 additions & 5 deletions eipw-lint/tests/lint_markdown_relative_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ header: value1

let reports = Linter::<Text<String>>::default()
.clear_lints()
.deny("markdown-rel", RelativeLinks { exceptions: &[] })
.deny(
"markdown-rel",
RelativeLinks {
exceptions: Vec::<&str>::new(),
},
)
.check_slice(None, src)
.run()
.await
Expand Down Expand Up @@ -109,7 +114,12 @@ header: value1

let reports = Linter::<Text<String>>::default()
.clear_lints()
.deny("markdown-rel", RelativeLinks { exceptions: &[] })
.deny(
"markdown-rel",
RelativeLinks {
exceptions: Vec::<&str>::new(),
},
)
.check_slice(None, src)
.run()
.await
Expand Down Expand Up @@ -294,7 +304,12 @@ Hello [hi][hello]!

let reports = Linter::<Text<String>>::default()
.clear_lints()
.deny("markdown-rel", RelativeLinks { exceptions: &[] })
.deny(
"markdown-rel",
RelativeLinks {
exceptions: Vec::<&str>::new(),
},
)
.check_slice(None, src)
.run()
.await
Expand Down Expand Up @@ -424,7 +439,12 @@ header: value1

let reports = Linter::<Text<String>>::default()
.clear_lints()
.deny("markdown-rel", RelativeLinks { exceptions: &[] })
.deny(
"markdown-rel",
RelativeLinks {
exceptions: Vec::<&str>::new(),
},
)
.check_slice(None, src)
.run()
.await
Expand Down Expand Up @@ -538,7 +558,12 @@ header: value1

let reports = Linter::<Text<String>>::default()
.clear_lints()
.deny("markdown-rel", RelativeLinks { exceptions: &[] })
.deny(
"markdown-rel",
RelativeLinks {
exceptions: Vec::<&str>::new(),
},
)
.check_slice(None, src)
.run()
.await
Expand Down

0 comments on commit beef0c9

Please sign in to comment.