Bundle TypeScript type definitions with the package#298
Open
danmactough wants to merge 4 commits intomasterfrom
Open
Bundle TypeScript type definitions with the package#298danmactough wants to merge 4 commits intomasterfrom
danmactough wants to merge 4 commits intomasterfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ships first-party types so
npm install feedparseris all TypeScript users need — no separate@types/feedparserinstall required.Compared to the DefinitelyTyped version, these types only expose the public API, fix the base class (
stream.Transform, notstream.Duplex), makeoptionsoptional, and add the missingstrictoption,sourceproperty onItem, and index signatures for namespace-prefixed properties.A
typecheckscript runstsc --strictagainst a type-level test file as part ofpretest.