An ESLint plugin that enforces TypeScript type assertions using ^? Twoslash, $ExpectError, and $ExpectType comments.
eslint-plugin-expect-type is an ESLint plugin that enables developers to write inline type assertions in TypeScript code using comment-based syntax like ^?, $ExpectError, and $ExpectType. It catches type errors during linting, helping maintain type safety and preventing regressions in codebases.
TypeScript developers and teams who use ESLint and want to enforce type correctness as part of their linting process, particularly those maintaining libraries or applications with strict type requirements.
It provides a seamless, low-overhead way to write type assertions directly in code that integrates with existing ESLint workflows, unlike separate type testing tools that require additional test runners or configurations.
ESLint plugin with ^? Twoslash, $ExpectError, and $ExpectType type assertions. 🧩
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Works as a standard ESLint plugin with recommended configurations, making it easy to add type assertions without separate test runners or complex setup.
Uses comment syntax like ^? and $ExpectError for lightweight, inline type checking that integrates directly into code, as shown in the README examples.
Provides immediate type correctness feedback during development through ESLint, catching errors early without requiring additional test runs.
Supports various assertions including Twoslash ^? for type display, $ExpectError for error checking, and $ExpectType for type contracts, covering diverse needs.
Requires full ESLint and TypeScript setup with @typescript-eslint/parser, adding complexity for teams not already invested in this toolchain.
Relies solely on comment-based assertions, which might be less expressive or familiar than function-based approaches from alternatives like expect-type or ts-expect.
Only supports TypeScript versions within the DefinitelyTyped support window (roughly less than 2 years old), potentially excluding older or bleeding-edge projects.