Skip to content

Commit fff87a2

Browse files
committed
test(linter): add extra test case for multiple forbidden props in react/forbid-dom-props
1 parent c9405fc commit fff87a2

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

crates/oxc_linter/src/rules/react/forbid_dom_props.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ fn test() {
365365
<div className="foo">
366366
<input className="boo" />
367367
<span className="foobar">Foobar</span>
368-
<div otherProp="bar" />
368+
<div otherProp="bar" className="forbiddenClassname" />
369369
</div>
370370
);
371371
"#,

crates/oxc_linter/src/snapshots/react_forbid_dom_props.snap

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,21 @@ source: crates/oxc_linter/src/tester.rs
8686
4 │ <input className="boo" />
8787
5 │ <span className="foobar">Foobar</span>
8888
· ─────────
89-
6 │ <div otherProp="bar" />
89+
6 │ <div otherProp="bar" className="forbiddenClassname" />
9090
╰────
9191

9292
eslint-plugin-react(forbid-dom-props): Avoid using otherProp
9393
╭─[forbid_dom_props.tsx:6:30]
9494
5 │ <span className="foobar">Foobar</span>
95-
6 │ <div otherProp="bar" />
95+
6 │ <div otherProp="bar" className="forbiddenClassname" />
9696
· ─────────
9797
7 │ </div>
9898
╰────
99+
100+
eslint-plugin-react(forbid-dom-props): Please use class instead of ClassName
101+
╭─[forbid_dom_props.tsx:6:46]
102+
5 │ <span className="foobar">Foobar</span>
103+
6 │ <div otherProp="bar" className="forbiddenClassname" />
104+
· ─────────
105+
7 │ </div>
106+
╰────

0 commit comments

Comments
 (0)