attw Plugin
attw ("Are the Types Wrong") tests whether the TypeScript types shipped in an npm
package actually resolve under every module-resolution strategy (node10, node16
CJS/ESM, bundler). Catches masquerading files, missing .d.ts, wrong types
conditions — before users report them.
Commands
Checking
attw check pack— Pack the local package and check its typesattw check npm <pkg>— Check a published npm packageattw check tarball <file.tgz>— Check a.tgztarballattw _ _— Passthrough to attw CLI
Usage Examples
- "Check if my package's types resolve correctly"
- "Does lodash's types work under node16 ESM?"
- "Verify the built tarball has correct types"
- "Add an attw check to my publish workflow"
Installation
npm install -g @arethetypeswrong/cli
# or: npx @arethetypeswrong/cli
Examples
# Standard pre-publish check
attw --pack .
# Inspect a published package
attw --from-npm react@19
# Machine-readable output
attw --pack . --format json
# Only check specific entrypoints
attw --pack . --entrypoints ./index.d.ts
Key Features
- Tests every resolution mode: node10, node16 CJS, node16 ESM, bundler
- Detects "masquerading" files (ESM syntax in .js under type:commonjs, etc.)
--format table|json|flippedoutput- Pairs with publint for complete pre-publish verification