Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/oxc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ fn test_vars_simple() {
});",
None,
),
// https://github.com/oxc-project/oxc/issues/5391
(
"
import styled from 'styled-components';

import { Prose, ProseProps } from './prose';

interface Props extends ProseProps {
density?: number;
}

export const HandMarkedPaperBallotProse = styled(Prose)<Props>`
line-height: ${({ density }) => (density !== 0 ? '1.1' : '1.3')};
`;
",
None,
),
];
let fail = vec![
("let a = 1", None),
Expand Down
23 changes: 23 additions & 0 deletions crates/oxc_semantic/tests/integration/symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,3 +426,26 @@ fn test_arrow_explicit_return() {
.has_number_of_writes(1)
.test();
}

#[test]
fn test_tagged_templates() {
// https://github.com/oxc-project/oxc/issues/5391
SemanticTester::tsx(
"
import styled from 'styled-components';

import { Prose, ProseProps } from './prose';

interface Props extends ProseProps {
density?: number;
}
export const HandMarkedPaperBallotProse = styled(Prose)<Props>`
line-height: ${({ density }) => (density !== 0 ? '1.1' : '1.3')};
`;
",
)
.has_some_symbol("density")
.has_number_of_reads(1)
.has_number_of_writes(0)
.test();
}