File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
crates/oxc_linter/src/rules/eslint/no_unused_vars/tests Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1361,6 +1361,22 @@ import Layout from '../layouts/Layout.astro';
13611361 . test ( ) ;
13621362}
13631363
1364+ #[ test]
1365+ fn test_jsx_non_ascii ( ) {
1366+ // Test that non-ASCII component names (e.g., Korean characters) are correctly recognized
1367+ // as references in JSX, ensuring they don't trigger false positives for unused variables.
1368+ // Non-ASCII identifiers are always treated as component references in JSX.
1369+ let pass = vec ! [
1370+ ( "const 테스트 = () => <div>Hello</div>; <테스트 />;" ) ,
1371+ ( "const $foo = () => <div>Hello</div>; <$foo />;" ) ,
1372+ ( "const _foo = () => <div>Hello</div>; <_foo />;" ) ,
1373+ ] ;
1374+ let fail = vec ! [ ( "const foo = () => <div>Hello</div>; <foo />;" ) ] ;
1375+ Tester :: new ( NoUnusedVars :: NAME , NoUnusedVars :: PLUGIN , pass, fail)
1376+ . intentionally_allow_no_fix_tests ( )
1377+ . test ( ) ;
1378+ }
1379+
13641380// #[test]
13651381// fn test_template() {
13661382// let pass = vec![];
You can’t perform that action at this time.
0 commit comments