mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
test(linter/no-unused-vars): arrow functions in tagged templates (#5510)
Closes #5391
This commit is contained in:
parent
b96bea4f0d
commit
340b535715
2 changed files with 40 additions and 0 deletions
|
|
@ -19,6 +19,23 @@ fn test_vars_simple() {
|
||||||
});",
|
});",
|
||||||
None,
|
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 fail = vec![
|
||||||
("let a = 1", None),
|
("let a = 1", None),
|
||||||
|
|
|
||||||
|
|
@ -426,3 +426,26 @@ fn test_arrow_explicit_return() {
|
||||||
.has_number_of_writes(1)
|
.has_number_of_writes(1)
|
||||||
.test();
|
.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();
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue