Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
37 changes: 37 additions & 0 deletions crates/biome_cli/tests/cases/handle_vue_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1363,3 +1363,40 @@ fn fails_for_ts_grammar_when_lang_is_not_ts() {
result,
));
}

#[test]
fn lint_vue_should_not_add_extra_newlines_in_embedded_snippet() {
let fs = MemoryFileSystem::default();
let mut console = BufferConsole::default();

fs.insert(
"biome.json".into(),
r#"{ "html": { "linter": {"enabled": true}, "experimentalFullSupportEnabled": true } }"#
.as_bytes(),
);

let file = Utf8Path::new("file.vue");
fs.insert(
file.into(),
r#"<script>
import { computed } from "vue";
</script>"#
.as_bytes(),
);

let (fs, result) = run_cli(
fs,
&mut console,
Args::from(["lint", "--write", file.as_str()].as_slice()),
);

assert!(result.is_ok(), "run_cli returned {result:?}");

assert_cli_snapshot(SnapshotPayload::new(
module_path!(),
"lint_vue_should_not_add_extra_newlines_in_embedded_snippet",
fs,
console,
result,
));
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: content
expression: redactor(content)
---
## `biome.json`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: redactor(content)
snapshot_kind: text
---
## `biome.json`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: content
expression: redactor(content)
---
## `biome.json`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: content
expression: redactor(content)
---
## `biome.json`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: content
expression: redactor(content)
---
## `biome.json`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: content
expression: redactor(content)
---
## `biome.json`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: content
expression: redactor(content)
---
## `biome.json`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: content
expression: redactor(content)
---
## `biome.json`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: content
expression: redactor(content)
---
## `biome.json`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: content
snapshot_kind: text
expression: redactor(content)
---
## `biome.json`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: content
expression: redactor(content)
---
## `config/biome.json`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: content
expression: redactor(content)
---
## `biome.json`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: redactor(content)
snapshot_kind: text
---
## `file.js`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: redactor(content)
snapshot_kind: text
---
## `biome.yml`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: content
snapshot_kind: text
expression: redactor(content)
---
## `config/a.jsonc`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: content
expression: redactor(content)
---
## `a.cts`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: redactor(content)
snapshot_kind: text
---
## `biome.json`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: redactor(content)
snapshot_kind: text
---
## `biome.json`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: content
expression: redactor(content)
---
## `src/file.js`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: redactor(content)
snapshot_kind: text
---
## `.editorconfig`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: redactor(content)
snapshot_kind: text
---
## `.editorconfig`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: content
expression: redactor(content)
---
## `.editorconfig`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: redactor(content)
snapshot_kind: text
---
## `biome.json`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: redactor(content)
snapshot_kind: text
---
## `.editorconfig`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: redactor(content)
snapshot_kind: text
---
## `.editorconfig`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: redactor(content)
snapshot_kind: text
---
## `biome.json`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: redactor(content)
snapshot_kind: text
---
## `biome.json`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: content
expression: redactor(content)
---
## `file.graphql`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: content
expression: redactor(content)
---
## `file.graphql`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: content
expression: redactor(content)
---
## `file.astro`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,39 +60,39 @@ check ━━━━━━━━━━━━━━━━━━━━━━━━
# Emitted Messages

```block
file.astro:10:1 lint/a11y/useHtmlLang ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
file.astro:9:1 lint/a11y/useHtmlLang ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Provide a lang attribute when using the html element.

8 │ ---
9
> 10 │ <html>
7 │ ---
8
> 9 │ <html>
│ ^^^^^^
> 11 │ <head>
> 12 │ <title>Astro</title>
> 13 │ </head>
> 14 │ <body></body>
> 15 │ </html>
> 10 │ <head>
> 11 │ <title>Astro</title>
> 12 │ </head>
> 13 │ <body></body>
> 14 │ </html>
│ ^^^^^^^
16
17 │ <style>
15
16 │ <style>

i Setting a lang attribute on HTML document elements configures the language used by screen readers when no user default is specified.


```

```block
file.astro:19:15 lint/a11y/useGenericFontNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
file.astro:18:15 lint/a11y/useGenericFontNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Generic font family missing.

17 │ <style>
18 │ #id {
> 19 │ font-family: comic-sans;
16 │ <style>
17 │ #id {
> 18 │ font-family: comic-sans;
│ ^^^^^^^^^^
20 │ }
21 │ .class {
19 │ }
20 │ .class {

i Consider adding a generic font family as a fallback.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ expression: redactor(content)

```astro
---

const title = "Hello World";

---

<html>
Expand All @@ -35,5 +33,5 @@ expression: redactor(content)
# Emitted Messages

```block
Checked 1 file in <TIME>. Fixed 1 file.
Checked 1 file in <TIME>. No fixes applied.
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: content
expression: redactor(content)
---
## `input.css`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: content
expression: redactor(content)
---
## `input.css`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: content
expression: redactor(content)
---
## `input.css`

Expand Down
Loading