{"id":18978922,"url":"https://github.com/andreidmt/tpl-ts-jsdoc","last_synced_at":"2026-04-09T07:02:40.906Z","repository":{"id":84514849,"uuid":"338072829","full_name":"andreidmt/tpl-ts-jsdoc","owner":"andreidmt","description":"Plain JavaScript with types by leveraging TypeScript's JSDoc support.","archived":false,"fork":false,"pushed_at":"2023-05-03T19:12:45.000Z","size":2099,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-01T10:42:18.313Z","etag":null,"topics":["eslint","javascript","jsdoc","prettier","starter","template","typescript"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andreidmt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-11T15:43:19.000Z","updated_at":"2023-05-03T19:12:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"b7724028-8a4c-45b9-ad07-9127acb98998","html_url":"https://github.com/andreidmt/tpl-ts-jsdoc","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreidmt%2Ftpl-ts-jsdoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreidmt%2Ftpl-ts-jsdoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreidmt%2Ftpl-ts-jsdoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreidmt%2Ftpl-ts-jsdoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreidmt","download_url":"https://codeload.github.com/andreidmt/tpl-ts-jsdoc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239985713,"owners_count":19729512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eslint","javascript","jsdoc","prettier","starter","template","typescript"],"created_at":"2024-11-08T15:40:25.052Z","updated_at":"2025-12-30T22:13:54.637Z","avatar_url":"https://github.com/andreidmt.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable first-line-h1 line-length --\u003e\n\n[![dev-badge](https://david-dm.org/andreidmt/tpl-ts-jsdoc.svg)](https://david-dm.org/andreidmt/tpl-ts-jsdoc)\n\n# tpl-ts-jsdoc\n\n\u003e Plain JavaScript with types by leveraging [TypeScript's JSDoc support](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html).\n\n![Vim with Typescript evaluating JavaScript code](docs/screenshot.png)\n\n![Vim with Typescript evaluating JavaScript code](docs/screenshot-ts-error-wrong-type.png)\n\n\u003c!-- vim-markdown-toc GFM --\u003e\n\n* [Why?](#why)\n* [Stack](#stack)\n* [npm scripts](#npm-scripts)\n* [Tools](#tools)\n* [FAQ](#faq)\n* [Random tips](#random-tips)\n* [Changelog](#changelog)\n\n\u003c!-- vim-markdown-toc --\u003e\n\n## Why?\n\n* :godmode: Plain JavaScript and JSDoc\n* :lipstick: TypeScript is good at _types_\n* :scroll: Types are already part of docs, repeating creates noise\n* :two_hearts: Incentivize documentation writing by giving them static typing powers :zap:\n* :brain: Thinking about _types_ and _code logic_ are different mental activities. One is zoomed-in, focused on what each piece is, the other, zoomed-out and focused on how the data flows from one transition to another\n\n## Stack\n\n* Main: JavaScript + types using [TypeScript support](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html) for [JSDoc](https://jsdoc.app/)\n* Testing: [riteway](https://github.com/ericelliott/riteway)\n* Linting: [ESLint](https://github.com/eslint/eslint), [@asd14/eslint-config](https://github.com/asd-xiv/eslint-config)\n* Formatting: ESLint rules + [prettier](https://github.com/prettier/prettier)\n* Environment variable: [dotenv](https://github.com/motdotla/dotenv)\n\n## npm scripts\n\n* Clean package install\n\n```bash\n# \"setup\": \"rm -rf ./node_modules \u0026\u0026 npm install \u0026\u0026 npm audit fix\",\nnpm run setup\n```\n\n* Check for package updates (with interactive console)\n\n```bash\n# \"update\": \"npm-check --update\",\nnpm run update\n```\n\n* Compile \"src\" folder into \"dist\" while also generating \".d.ts\" - see [tsconfig.json](tsconfig.json)\n\n```bash\n# \"build\": \"tsc --skipLibCheck\",\nnpm run build\n```\n\n* Lint source files - see [.eslintrc](.eslintrc)\n\n```bash\n# \"lint:md\": \"markdownlint *.md\",\n# \"lint:js\": \"eslint --quiet src\",\n# \"lint\": \"npm run lint:md \u0026\u0026 npm run lint:js\",\nnpm run lint\n```\n\n* Run all \".test.js\" files from \"dist\" folder - see [example test file](src/hello-world.test.js)\n\n```bash\n# \"pretest\": \"npm run build\",\n# \"test\": \"riteway 'dist/**/*.test.js' | tap-nirvana\",\nnpm run test\n```\n\n* Watch changes in \"src\" folder and re-run tests\n\n```bash\n# \"tdd\": \"nodemon --ext js,json --watch src --exec 'npm test'\"\nnpm run tdd\n```\n\n## Tools\n\n* [jsdoc](https://github.com/jsdoc/jsdoc) - An API documentation generator for JavaScript\n* [better-docs](https://github.com/SoftwareBrothers/better-docs) - Beautiful toolbox for JSDoc generated documentation - with 'typescript', 'category' and 'component' plugins\n* [documentation.js](https://github.com/documentationjs/documentation) - The documentation system for modern JavaScript\n* [apidoc](https://apidocjs.com/) - Inline Documentation for RESTful web APIs\n* [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown) - Generate markdown documentation from jsdoc-annotated JavaScript\n\n## FAQ\n\n_1. Can I use both JSDocs infered types and TypeScript annotations?_\n\nNo, TypeScript draws a hard line between functionalities provided in `.js` and `.ts` files. TypeScript specific syntax is only available in `.ts` files, while JSDoc interpretation in `.js`.\n\n![TypeScript not allowing type annotations in .js files](docs/screenshot-ts-error-annotations.png)\n\n## Random tips\n\n* [Naming conventions that work](https://github.com/kettanaito/naming-cheatsheet)\n* [Hierarchical Model-View-Controller](https://en.wikipedia.org/wiki/Hierarchical_model%E2%80%93view%E2%80%93controller)\n* Better repeat yourself than a wrong abstraction\n* Don't fix imaginary future problem\n* Extract code in libraries and test 100%\n* If possible, don't mock, E2E test\n\n## Changelog\n\nSee the [releases section](https://github.com/andreidmt/tpl-ts-jsdoc/releases) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreidmt%2Ftpl-ts-jsdoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreidmt%2Ftpl-ts-jsdoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreidmt%2Ftpl-ts-jsdoc/lists"}