Skip to content

Bundle TypeScript type definitions with the package#298

Open
danmactough wants to merge 4 commits intomasterfrom
add-types
Open

Bundle TypeScript type definitions with the package#298
danmactough wants to merge 4 commits intomasterfrom
add-types

Conversation

@danmactough
Copy link
Owner

Ships first-party types so npm install feedparser is all TypeScript users need — no separate @types/feedparser install required.

Compared to the DefinitelyTyped version, these types only expose the public API, fix the base class (stream.Transform, not stream.Duplex), make options optional, and add the missing strict option, source property on Item, and index signatures for namespace-prefixed properties.

A typecheck script runs tsc --strict against a type-level test file as part of pretest.

danmactough and others added 4 commits March 19, 2026 22:53
Introduces index.d.ts with clean, public-API-focused types so TypeScript
users get types automatically without needing @types/feedparser. Fixes
several issues in the DefinitelyTyped version: removes private internals,
corrects base class to stream.Transform, makes options optional, adds
missing strict option, source property, and namespace index signatures.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds test/types.ts exercising the full public API surface, a typecheck
script running tsc --strict, and wires it into pretest alongside lint.
Also adds .eslintignore to skip .ts files and typescript as a devDep.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Without a tsconfig.json VSCode defaulted to ESM module mode, making
import X = require() invalid. Explicit module: commonjs aligns VSCode
with the typecheck script, which is simplified to just tsc.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant