Skip to content

Commit e8149a4

Browse files
committed
Use TODO(codemod) for sibling broadening comment, tighten PR description guidance
Change the inline comment from `// NOTE:` to `// TODO(codemod):` so it's actionable and attributable. Also tighten CLAUDE.md PR description guidance. https://claude.ai/code/session_01NACR4DTcJGrJ3xu7sWWQC9
1 parent 93ff226 commit e8149a4

8 files changed

Lines changed: 16 additions & 15 deletions

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ Skills are located in `.claude/skills/`.
218218

219219
## Pull Request Descriptions
220220

221-
Keep PR descriptions concise: a brief summary of what the PR does and why. Do not add sections like "Test case", "Test plan", or checklists. Context that's obvious from the diff or commit message doesn't need repeating.
221+
Keep PR descriptions **very short** — 1-3 sentences max. Just say what changed and why. Do not add sections like "Summary", "Test case", "Test plan", "Changes", or checklists. Do not enumerate files changed or repeat what's obvious from the diff. Less is more.
222222

223223
## Post-Implementation Workflow
224224

src/__tests__/transform.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ export const App = () => <Thing />;
695695
expect(infoWarnings).toHaveLength(0);
696696
// The output should contain a NOTE comment about the broadening
697697
expect(result.code).toContain(
698-
"// NOTE: CSS `+` (adjacent sibling) becomes `~` (general sibling) in StyleX",
698+
"// TODO(codemod): CSS `+` (adjacent) was broadened to `~` (general sibling). Verify siblings are always adjacent.",
699699
);
700700
});
701701

src/internal/lower-rules/process-rules.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ export function processDeclRules(ctx: DeclProcessingState): void {
768768
value: siblingValue,
769769
...(isAdjacentCombinator && {
770770
leadingComment:
771-
"NOTE: CSS `+` (adjacent sibling) becomes `~` (general sibling) in StyleX",
771+
"TODO(codemod): CSS `+` (adjacent) was broadened to `~` (general sibling). Verify siblings are always adjacent.",
772772
}),
773773
});
774774
}
@@ -2174,7 +2174,8 @@ function handleSiblingSelector(
21742174
keyExpr: makeSiblingKeyExpr(),
21752175
value: siblingValue,
21762176
...(isAdjacent && {
2177-
leadingComment: "NOTE: CSS `+` (adjacent sibling) becomes `~` (general sibling) in StyleX",
2177+
leadingComment:
2178+
"TODO(codemod): CSS `+` (adjacent) was broadened to `~` (general sibling). Verify siblings are always adjacent.",
21782179
}),
21792180
});
21802181
}

test-cases/selector-componentSiblingCombinator.output.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ const styles = stylex.create({
3737
paddingInline: 8,
3838
color: {
3939
default: "gray",
40-
// NOTE: CSS `+` (adjacent sibling) becomes `~` (general sibling) in StyleX
40+
// TODO(codemod): CSS `+` (adjacent) was broadened to `~` (general sibling). Verify siblings are always adjacent.
4141
[stylex.when.siblingBefore(":focus-visible", LinkMarker)]: "blue",
4242
},
4343
backgroundColor: {
4444
default: null,
45-
// NOTE: CSS `+` (adjacent sibling) becomes `~` (general sibling) in StyleX
45+
// TODO(codemod): CSS `+` (adjacent) was broadened to `~` (general sibling). Verify siblings are always adjacent.
4646
[stylex.when.siblingBefore(":hover", LinkMarker)]: {
4747
default: null,
4848
"@media (min-width: 768px)": "lightyellow",

test-cases/selector-sibling.output.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,28 +37,28 @@ const styles = stylex.create({
3737
thing: {
3838
color: {
3939
default: "blue",
40-
// NOTE: CSS `+` (adjacent sibling) becomes `~` (general sibling) in StyleX
40+
// TODO(codemod): CSS `+` (adjacent) was broadened to `~` (general sibling). Verify siblings are always adjacent.
4141
[stylex.when.siblingBefore(":is(*)", ThingMarker)]: "red",
4242
},
4343
paddingBlock: 8,
4444
paddingInline: 16,
4545
backgroundColor: {
4646
default: null,
47-
// NOTE: CSS `+` (adjacent sibling) becomes `~` (general sibling) in StyleX
47+
// TODO(codemod): CSS `+` (adjacent) was broadened to `~` (general sibling). Verify siblings are always adjacent.
4848
[stylex.when.siblingBefore(":is(*)", ThingMarker)]: "lime",
4949
},
5050
},
5151
thingThemed: {
5252
color: {
5353
default: "blue",
54-
// NOTE: CSS `+` (adjacent sibling) becomes `~` (general sibling) in StyleX
54+
// TODO(codemod): CSS `+` (adjacent) was broadened to `~` (general sibling). Verify siblings are always adjacent.
5555
[stylex.when.siblingBefore(":is(*)", ThingThemedMarker)]: $colors.labelBase,
5656
},
5757
},
5858
row: {
5959
marginTop: {
6060
default: null,
61-
// NOTE: CSS `+` (adjacent sibling) becomes `~` (general sibling) in StyleX
61+
// TODO(codemod): CSS `+` (adjacent) was broadened to `~` (general sibling). Verify siblings are always adjacent.
6262
[stylex.when.siblingBefore(":is(*)", RowMarker)]: 16,
6363
},
6464
},

test-cases/selector-siblingBaseAfter.output.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const styles = stylex.create({
1919
thing: {
2020
color: {
2121
default: "blue",
22-
// NOTE: CSS `+` (adjacent sibling) becomes `~` (general sibling) in StyleX
22+
// TODO(codemod): CSS `+` (adjacent) was broadened to `~` (general sibling). Verify siblings are always adjacent.
2323
[stylex.when.siblingBefore(":is(*)", ThingMarker)]: "red",
2424
},
2525
paddingBlock: 8,

test-cases/selector-siblingMarkerScoping.output.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ const styles = stylex.create({
2828
padding: 8,
2929
borderTopWidth: {
3030
default: null,
31-
// NOTE: CSS `+` (adjacent sibling) becomes `~` (general sibling) in StyleX
31+
// TODO(codemod): CSS `+` (adjacent) was broadened to `~` (general sibling). Verify siblings are always adjacent.
3232
[stylex.when.siblingBefore(":is(*)", RowMarker)]: 1,
3333
},
3434
borderTopStyle: {
3535
default: null,
36-
// NOTE: CSS `+` (adjacent sibling) becomes `~` (general sibling) in StyleX
36+
// TODO(codemod): CSS `+` (adjacent) was broadened to `~` (general sibling). Verify siblings are always adjacent.
3737
[stylex.when.siblingBefore(":is(*)", RowMarker)]: "solid",
3838
},
3939
borderTopColor: {
4040
default: null,
41-
// NOTE: CSS `+` (adjacent sibling) becomes `~` (general sibling) in StyleX
41+
// TODO(codemod): CSS `+` (adjacent) was broadened to `~` (general sibling). Verify siblings are always adjacent.
4242
[stylex.when.siblingBefore(":is(*)", RowMarker)]: "gray",
4343
},
4444
},

test-cases/selector-siblingMedia.output.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const styles = stylex.create({
1919
padding: 8,
2020
marginTop: {
2121
default: null,
22-
// NOTE: CSS `+` (adjacent sibling) becomes `~` (general sibling) in StyleX
22+
// TODO(codemod): CSS `+` (adjacent) was broadened to `~` (general sibling). Verify siblings are always adjacent.
2323
[stylex.when.siblingBefore(":is(*)", ThingMarker)]: {
2424
default: null,
2525
"@media (min-width: 768px)": 16,

0 commit comments

Comments
 (0)