Skip to content

Commit

Permalink
refactor(linter): fix indentation in `nextjs/no_script_component_in_h…
Browse files Browse the repository at this point in the history
…ead` rule
  • Loading branch information
overlookmotel committed Aug 30, 2024
1 parent 32f7300 commit db1c1d4
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions crates/oxc_linter/src/rules/nextjs/no_script_component_in_head.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,31 +100,33 @@ fn test() {
use crate::tester::Tester;

let pass = vec![
r#"import Script from "next/script";
const Head = ({children}) => children
r#"
import Script from "next/script";
const Head = ({children}) => children
export default function Index() {
return (
export default function Index() {
return (
<Head>
<Script></Script>
<Script></Script>
</Head>
);
}
"#,
);
}
"#,
];

let fail = vec![
r#"
import Head from "next/head";
import Script from "next/script";
export default function Index() {
return (
<Head>
<Script></Script>
</Head>
);
}"#,
import Head from "next/head";
import Script from "next/script";
export default function Index() {
return (
<Head>
<Script></Script>
</Head>
);
}
"#,
];

Tester::new(NoScriptComponentInHead::NAME, pass, fail).test_and_snapshot();
Expand Down

0 comments on commit db1c1d4

Please sign in to comment.