{"id":15542052,"url":"https://github.com/lifeart/els-addon-typed-templates","last_synced_at":"2025-04-12T22:36:20.527Z","repository":{"id":36679739,"uuid":"226188771","full_name":"lifeart/els-addon-typed-templates","owner":"lifeart","description":"Ember templates linting / autocomplete, based on Typescript language server ","archived":false,"fork":false,"pushed_at":"2022-12-10T11:18:32.000Z","size":3074,"stargazers_count":30,"open_issues_count":46,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-16T06:05:08.029Z","etag":null,"topics":["els-addon","ember","ember-addon","ember-language-server"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lifeart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-05T21:03:04.000Z","updated_at":"2024-05-30T02:41:54.000Z","dependencies_parsed_at":"2023-01-17T04:00:35.505Z","dependency_job_id":null,"html_url":"https://github.com/lifeart/els-addon-typed-templates","commit_stats":null,"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifeart%2Fels-addon-typed-templates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifeart%2Fels-addon-typed-templates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifeart%2Fels-addon-typed-templates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifeart%2Fels-addon-typed-templates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lifeart","download_url":"https://codeload.github.com/lifeart/els-addon-typed-templates/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248642807,"owners_count":21138352,"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":["els-addon","ember","ember-addon","ember-language-server"],"created_at":"2024-10-02T12:20:33.219Z","updated_at":"2025-04-12T22:36:20.506Z","avatar_url":"https://github.com/lifeart.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# els-addon-typed-templates\nEmber Language Server Typed Templates Addon\n\nHow to use?\n\nInstall this addon as `dev-dependency` inside your ember project.\n\nHow typed template looks under the hood?\n[issue-351282903](https://github.com/lifeart/els-addon-typed-templates/pull/11#issue-351282903)\n\n* route templates not supported (yet);\n\n\n### Template-lint integration (CI)\n\ninstall [ember-template-lint-typed-templates](https://github.com/lifeart/ember-template-lint-typed-templates) plugin to get if working\n\n### Autocomplete\n\n![autocomplete preview](previews/autocomplete.png)\n\n### Warn Each\n\n\n![warn each](previews/warn-each.png)\n\n### Unknown Property\n![warn unknown](previews/warn-unknown.png)\n\n### Features\n\n* Component context autocomplete `{{this.}}`\n* Component arguments autocomplete `{{@}}`\n* Warn on undefined properties (on complete)\n* Warn on incorrect `each` arguments (not an array)\n\n### NPM\n`npm install els-addon-typed-templates --save-dev`\n\n### Yarn\n`yarn add els-addon-typed-templates --dev`\n\n### VSCode\n\nFor `els-addon-typed-templates` \u003e= `v3.0.0`, required `Unstable Ember Language Server` `\u003e= v1.4.2`\n\nFor `els-addon-typed-templates` \u003c= `v2.2.18`, required `Unstable Ember Language Server` `\u003e= v0.2.57`\n\nInstall: [Unstable Ember Language Server](https://marketplace.visualstudio.com/items?itemName=lifeart.vscode-ember-unstable)\n\n* Restart `VSCode`.\n\n## Usage\n\nTry type `{{this.}}` or `{{@}}` inside component template.\n\n### Typescript Components\n\nA component.ts file will work with no changes needed.\n\n### Template Only Components\n\nA template only component needs some additional information.\n\nNote: This is also how Javascript/ JSDoc template only components work.\n\n```hbs\n{{!-- \n    interface Args {\n        foo: {\n            bar: string\n        }\n    }\n--}}\n{{@foo.bar}}\n```\n\nor \n\n```hbs\n{{!--\n  \u003cscript @typedef\u003e\n    interface Args {\n      foo: {\n        bar: string\n      }\n    }\n  \u003c/script\u003e\n--}}\n{{@foo.bar}}\n```\n\n### Javsacript Component (JSDoc)\n\nA component.js file needs some additional information in the js file to work.\n\n`components/cart.js`\n```js\n/**\n * @typedef {import('./../services/cart').default} CartService\n * \n * @typedef {Object} Args\n * @property {string} foo\n * @property {import('./../models/bar'} bar\n * @extends Component\u003cArgs\u003e\n\n */\nexport default class CartComponent extends Component {\n    /**\n     * CartService\n     * @type {CartService}\n     */\n    @service('cart') cart;\n}\n```\n\n`components/cart.hbs`\n```hbs\n{{#each this.cart.items as |item|}}\n    {{item.name}} \n    // ^ will support autocomplete and linting\n{{/each}}\n\n{{@bar.price}}\n// ^ will support autocomplete and linting\n```\n\n## FAQ\n\n### How can I ignore lines?\n\n - use handlebars comments\n\n```hbs\n{{!-- @ts-ignore --}} \n{{this.line.to.ignore}}\n```\n\n### How can I ignore a file?\n\n```hbs\n{{!-- @ts-nocheck --}}\n```\n\n### How can I override/ extend global typings?\n\n```ts\n// + project/types/index.d.ts\ndeclare module \"ember-typed-templates\" {\n    interface GlobalRegistry {\n\t\t// helper, component, modifier name -\u003e result\n        'unknown-helper': (params: string[], hash?)=\u003e string,\n        'block': (params?, hash?) =\u003e [ { someFirstBlockParamProperty: 42 } ]\n    }\n}\n```\n\n\n### Errors and possible fixes:\n\nhttps://github.com/lifeart/els-addon-typed-templates/pull/20\n\n### Is it supposed to support Object.extend notation?\n\nNope\n\n### Would it be possible to add these as dependencies to the language server or something similar?\n\nNope, because it's \"experimental\" and \"heavy\" functionality, adding it into language server itself may decrease DX for other users. UELS has addon API, using this addon API you able add functionality into langserver. All addons scoped inside projects (to allow users have multple addon versions for different ember projects and versions).\n\n### Is it stable?\n\nSometimes it may crash your language server, don't worry it will awake automatically.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flifeart%2Fels-addon-typed-templates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flifeart%2Fels-addon-typed-templates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flifeart%2Fels-addon-typed-templates/lists"}