Menu

1 / 2

I grepped for @ts-ignore and found zero. Then I grepped for the cast nobody bans

DEV Community: typescript·chet100·18 days ago
#YFLAeWsT
#devtotypescript#devto#dev#unknown#cast
Reading 0:00
15s threshold

Every TypeScript team has a rule about @ts-ignore . Ours does too, and it works: zero occurrences across 610 source files .

Then I grepped for something nobody puts in a style guide:

grep -rn --include = '*.ts' --include = '*.tsx' \ --exclude-dir = node_modules --exclude-dir = .next \ 'as unknown as' apps packages | wc -l

Enter fullscreen mode

Exit fullscreen mode

117.

Zero explicit suppressions, a hundred and seventeen implicit ones. That ratio is not a coincidence — it is what a ban creates when the ban only covers the syntax people remember to grep for.

The numbers, from a real repo

Pattern Occurrences in source

@ts-ignore 0

@ts-expect-error 0

as any 3

as unknown as 117

eslint-disable* 53

console.log 4

Two more facts worth having. The 53 eslint-disables are not 53 decisions: 42 of them are one rule ( @next/next/no-img-element ), which is a single architectural choice about <img> tags, repeated.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.