{"id":27611776,"url":"https://github.com/leafoftree/svelte-ts-mode","last_synced_at":"2025-04-23T00:43:04.350Z","repository":{"id":266653431,"uuid":"898953938","full_name":"leafOfTree/svelte-ts-mode","owner":"leafOfTree","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-29T09:36:10.000Z","size":42,"stargazers_count":8,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-23T00:42:58.714Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leafOfTree.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2024-12-05T10:54:16.000Z","updated_at":"2025-04-13T13:25:08.000Z","dependencies_parsed_at":"2024-12-05T11:39:13.585Z","dependency_job_id":"5500da8b-d1d7-42d1-8f5f-cc267ea67858","html_url":"https://github.com/leafOfTree/svelte-ts-mode","commit_stats":null,"previous_names":["leafoftree/svelte-ts-mode"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafOfTree%2Fsvelte-ts-mode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafOfTree%2Fsvelte-ts-mode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafOfTree%2Fsvelte-ts-mode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafOfTree%2Fsvelte-ts-mode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leafOfTree","download_url":"https://codeload.github.com/leafOfTree/svelte-ts-mode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250348892,"owners_count":21415907,"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":[],"created_at":"2025-04-23T00:43:03.833Z","updated_at":"2025-04-23T00:43:04.344Z","avatar_url":"https://github.com/leafOfTree.png","language":"Emacs Lisp","readme":"# Svelte tree-sitter mode\n\nAn Emacs tree-sitter major mode for `.svelte` files.\n\nIt requires\n\n- Emacs `(\u003e= emacs-major-version 29)` with tree-sitter support.\n\nUpstream grammars:\n\n- [tree-sitter-svelte][3]: mandatory\n- [tree-sitter-typescript][4]: optional\n- [tree-sitter-javascript][5]: optional\n- [tree-sitter-css][6]: optional\n\nExample `language-source-alist` for `treesit-language-source-alist` can be found\nin `svelte-ts-mode-language-source-alist` constant in [svelte-ts-mode.el](./svelte-ts-mode.el)\n\nYou can use command `M-x treesit-install-language-grammar` to install these grammars\nonce you have configured them in your `treesit-language-source-alist`.\n\n## Installation\n\n\u003e [!CAUTION]\n\u003e Still in early development.\n\n- [MELPA][2]\n\n  Not ready yet.\n\n- Elpaca\n\n  ```emacs-lisp\n  (use-package svelte-ts-mode\n    :ensure (:host github :repo \"leafOfTree/svelte-ts-mode\"))\n  ```\n\n- Manually\n\n  ```bash\n  git clone https://github.com/leafOfTree/svelte-ts-mode --depth 1\n  ```\n\n  ```lisp\n  ; ~/.emacs\n  (add-to-list 'load-path \"/path/to/svelte-ts-mode\")\n  (require 'svelte-ts-mode)\n  ```\n\n  For [Spacemacs][1], put them inside `dotspacemacs/user-config`.\n\n  ```lisp\n  ; ~/.spacemacs\n  (defun dotspacemacs/user-config ()\n        \n  (add-to-list 'load-path \"/path/to/svelte-ts-mode\")\n  (require 'svelte-ts-mode)\n  ```\n\n## Example Configuration\n\n```emacs-lisp\n(use-package svelte-ts-mode\n  :after eglot\n  :ensure (:host github :repo \"leafOfTree/svelte-ts-mode\")\n  :config\n  (add-to-list 'eglot-server-programs '(svelte-ts-mode . (\"svelteserver\" \"--stdio\"))))\n```\n\n## Tips\n\n### Set project-wide indentation offset for different languages\n\nCreate `.dir-locals.el` at the project root directory, and write content like the\nfollowing into it:\n\n```emacs-lisp\n;;; Directory Local Variables         -*- no-byte-compile: t; -*-\n;;; For more information see (info \"(emacs) Directory Variables\")\n\n((nil . ((typescript-ts-mode-indent-offset . 4)\n         (js-indent-level . 4)\n         (css-indent-offset . 4)\n         (svelte-ts-mode-indent-offset . 2))))\n```\n\nThis ensures indentation for a specific language(e.g. typescript) between its major mode\nand `svelte-ts-mode` are the same.\n\n## Credits\n\nInspired by `mhtml-ts-mode`\n\n[1]: https://github.com/syl20bnr/spacemacs\n[2]: https://melpa.org/#/svelte-mode\n[3]: https://github.com/Himujjal/tree-sitter-svelte\n[4]: https://github.com/tree-sitter/tree-sitter-typescript\n[5]: https://github.com/tree-sitter/tree-sitter-javascript\n[6]: https://github.com/tree-sitter/tree-sitter-css\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleafoftree%2Fsvelte-ts-mode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleafoftree%2Fsvelte-ts-mode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleafoftree%2Fsvelte-ts-mode/lists"}