antonv.dev
about
portfolio
Filter by tag:
Website
Cloudflare Workers
Cloudflare Workers
C#
Dart
eslint
eslint
Go
js
js
l10n
l10n
next.js
npm
npm
Oracle
PHP
PixiJS
PixiJS
React
React
TypeScript/JavaScript
Visual Studio
Windows
xslt
XSLT
npm
eslint
eslint-plugin-no-in-array
github.com/king8fisher/eslint-plugin-no-in-array
Published to
npmjs.com/package/eslint-plugin-no-in-array
Type-aware ESLint rule
that detects misuse of the
in
operator with arrays in TypeScript.
The
in
operator checks for property keys, not values — causing subtle bugs:
typescript
1
"a"
in
[
"a"
,
"b"
,
"c"
]
;
// false! indices are "0", "1", "2"
Use
.includes()
instead. This plugin catches arrays, tuples, readonly arrays, and inline literals.
Anton Veretennikov
Personal Landing Page
antonv.dev
about
portfolio
@king8fisher
@zzwx