Skip to content

Commit 4b10833

Browse files
committed
fix: improve diagnostics
1 parent 358e900 commit 4b10833

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

crates/biome_js_analyze/src/lint/nursery/use_inline_script_id.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,11 @@ impl Rule for UseInlineScriptId {
150150
rule_category!(),
151151
state,
152152
markup! {
153-
""<Emphasis>"next/script"</Emphasis>" components with inline content or `dangerouslySetInnerHTML` must specify "<Emphasis>"id"</Emphasis>" attribute."
153+
""<Emphasis>"next/script"</Emphasis>" components have inline content or `dangerouslySetInnerHTML` without "<Emphasis>"id"</Emphasis>" attribute."
154154
},
155155
)
156156
.note(markup!(
157-
"Without id attribute, Next.js cannot correctly track inline scripts and this can cause performance issues."
157+
"Next.js requires "<Emphasis>"id"</Emphasis>" attribute to track and optimize inline scripts. Without it, performance issues may occur."
158158
))
159159
.note(markup! {
160160
"See the "<Hyperlink href="https://nextjs.org/docs/messages/inline-script-id">"Next.js docs"</Hyperlink>" for more details."

crates/biome_js_analyze/tests/specs/nursery/useInlineScriptId/invalid-01.jsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default function Page() {
1919
```
2020
invalid-01.jsx:6:5 lint/nursery/useInlineScriptId ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2121
22-
× next/script components with inline content or `dangerouslySetInnerHTML` must specify id attribute.
22+
× next/script components have inline content or `dangerouslySetInnerHTML` without id attribute.
2323
2424
4 │ export default function Page() {
2525
5return (
@@ -28,7 +28,7 @@ invalid-01.jsx:6:5 lint/nursery/useInlineScriptId ━━━━━━━━━━
2828
7 │ )
2929
8}
3030
31-
i Without id attribute, Next.js cannot correctly track inline scripts and this can cause performance issues.
31+
i Next.js requires id attribute to track and optimize inline scripts. Without it, performance issues may occur.
3232
3333
i See the Next.js docs for more details.
3434

crates/biome_js_analyze/tests/specs/nursery/useInlineScriptId/invalid-02.jsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default function Page() {
1919
```
2020
invalid-02.jsx:6:5 lint/nursery/useInlineScriptId ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2121
22-
× next/script components with inline content or `dangerouslySetInnerHTML` must specify id attribute.
22+
× next/script components have inline content or `dangerouslySetInnerHTML` without id attribute.
2323
2424
4 │ export default function Page() {
2525
5return (
@@ -28,7 +28,7 @@ invalid-02.jsx:6:5 lint/nursery/useInlineScriptId ━━━━━━━━━━
2828
7 │ )
2929
8}
3030
31-
i Without id attribute, Next.js cannot correctly track inline scripts and this can cause performance issues.
31+
i Next.js requires id attribute to track and optimize inline scripts. Without it, performance issues may occur.
3232
3333
i See the Next.js docs for more details.
3434

crates/biome_js_analyze/tests/specs/nursery/useInlineScriptId/invalid-03.jsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default function Page() {
2020
```
2121
invalid-03.jsx:7:5 lint/nursery/useInlineScriptId ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2222
23-
× next/script components with inline content or `dangerouslySetInnerHTML` must specify id attribute.
23+
× next/script components have inline content or `dangerouslySetInnerHTML` without id attribute.
2424
2525
5 │ const props = { strategy: "beforeInteractive" };
2626
6 │ return (
@@ -29,7 +29,7 @@ invalid-03.jsx:7:5 lint/nursery/useInlineScriptId ━━━━━━━━━━
2929
8 │ )
3030
9 │ }
3131
32-
i Without id attribute, Next.js cannot correctly track inline scripts and this can cause performance issues.
32+
i Next.js requires id attribute to track and optimize inline scripts. Without it, performance issues may occur.
3333
3434
i See the Next.js docs for more details.
3535

crates/biome_js_analyze/tests/specs/nursery/useInlineScriptId/invalid-04.jsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default function Page() {
1919
```
2020
invalid-04.jsx:6:5 lint/nursery/useInlineScriptId ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2121
22-
× next/script components with inline content or `dangerouslySetInnerHTML` must specify id attribute.
22+
× next/script components have inline content or `dangerouslySetInnerHTML` without id attribute.
2323
2424
4 │ export default function Page() {
2525
5return (
@@ -28,7 +28,7 @@ invalid-04.jsx:6:5 lint/nursery/useInlineScriptId ━━━━━━━━━━
2828
7 │ )
2929
8}
3030
31-
i Without id attribute, Next.js cannot correctly track inline scripts and this can cause performance issues.
31+
i Next.js requires id attribute to track and optimize inline scripts. Without it, performance issues may occur.
3232
3333
i See the Next.js docs for more details.
3434

0 commit comments

Comments
 (0)