Skip to content

Commit 743275c

Browse files
committed
test: add tests for unions with numbers and booleans
1 parent 178ea0d commit 743275c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/rules/no-unlocalized-strings.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,22 @@ ruleTester.run("no-unlocalized-strings", noUnlocalizedStrings, {
134134
setVariant("primary")
135135
`,
136136
filename: "test.tsx"
137+
},
138+
139+
// TypeScript: String literal unions with numbers/booleans
140+
{
141+
code: `
142+
type MixedUnion = "auto" | "manual" | 0 | 1
143+
const value: MixedUnion = "auto"
144+
`,
145+
filename: "test.tsx"
146+
},
147+
{
148+
code: `
149+
type StateOrBool = "pending" | "done" | boolean
150+
const state: StateOrBool = "pending"
151+
`,
152+
filename: "test.tsx"
137153
}
138154
],
139155
invalid: [

0 commit comments

Comments
 (0)