mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
refactor(linter): fix indentation in nextjs/no_script_component_in_head rule (#5338)
This commit is contained in:
parent
89f018889d
commit
83b9a8240e
2 changed files with 24 additions and 22 deletions
|
|
@ -100,7 +100,8 @@ fn test() {
|
||||||
use crate::tester::Tester;
|
use crate::tester::Tester;
|
||||||
|
|
||||||
let pass = vec![
|
let pass = vec![
|
||||||
r#"import Script from "next/script";
|
r#"
|
||||||
|
import Script from "next/script";
|
||||||
const Head = ({children}) => children
|
const Head = ({children}) => children
|
||||||
|
|
||||||
export default function Index() {
|
export default function Index() {
|
||||||
|
|
@ -124,7 +125,8 @@ fn test() {
|
||||||
<Script></Script>
|
<Script></Script>
|
||||||
</Head>
|
</Head>
|
||||||
);
|
);
|
||||||
}"#,
|
}
|
||||||
|
"#,
|
||||||
];
|
];
|
||||||
|
|
||||||
Tester::new(NoScriptComponentInHead::NAME, pass, fail).test_and_snapshot();
|
Tester::new(NoScriptComponentInHead::NAME, pass, fail).test_and_snapshot();
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
source: crates/oxc_linter/src/tester.rs
|
source: crates/oxc_linter/src/tester.rs
|
||||||
---
|
---
|
||||||
⚠ eslint-plugin-next(no-script-component-in-head): Prevent usage of `next/script` in `next/head` component.
|
⚠ eslint-plugin-next(no-script-component-in-head): Prevent usage of `next/script` in `next/head` component.
|
||||||
╭─[no_script_component_in_head.tsx:7:17]
|
╭─[no_script_component_in_head.tsx:7:13]
|
||||||
6 │ return (
|
6 │ return (
|
||||||
7 │ <Head>
|
7 │ <Head>
|
||||||
· ────
|
· ────
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue