An ESLint plugin for optional static type checking in JavaScript using JSDoc and existing data schemas.
TypeLint is an ESLint plugin that enables optional static type checking in JavaScript projects using JSDoc annotations. It helps developers catch undefined property errors by leveraging existing data schemas like Redux state, Swagger definitions, or JSON Schema without requiring transpilation. The plugin integrates seamlessly into ESLint workflows, providing type validation where data structures are already described.
JavaScript developers working on projects with defined data schemas—such as Redux-based React apps, APIs with Swagger documentation, or JSON Schema-driven databases—who want lightweight type safety without adopting TypeScript or Flow.
Developers choose TypeLint because it offers optional, non-intrusive type checking that works with existing JSDoc comments and data schemas, avoiding the overhead of transpilers. Its unique integration with tools like Redux and Swagger makes it ideal for projects where data structures are already documented.
TypeLint is an ESlint plugin for optional static typing in JavaScript, based on JSDoc.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses standard JSDoc syntax compatible with Closure Compiler, making it easy to integrate with existing documentation without learning a new syntax, as shown in the supported types declarations.
Automatically constructs types from Redux reducer initial values to catch undefined property access errors, demonstrated by the redux option in settings that requires only the path to the root reducer.
Binds Swagger or JSON Schema definitions for type validation, allowing developers to leverage existing API documentation, with support for JSON, YAML, and JS file formats.
Provides type autocomplete in WebStorm/PHPStorm 2016 via generated schemas copied from the plugin, improving developer experience in supported environments.
Supports custom adapters to transform schemas between naming conventions, such as camelCase to snake_case, with built-in examples and a simple interface for extensions.
Missing key functionalities like handling variable reassignment and passing typed variables, as admitted in the Planned Features section, limiting its effectiveness for dynamic code.
Autocomplete is only available for WebStorm/PHPStorm 2016, requiring manual file copying, and lacks integration with popular editors like VS Code or modern IDEs.
Requires detailed .eslintrc settings with specific paths for models and reducers, which can be error-prone and hard to maintain, especially in large or multi-folder projects.
The useCache option improves performance but doesn't reflect changes in models until cache is cleared, forcing a choice between speed and real-time type validation.