{"id":15485990,"url":"https://github.com/rclarey/deno-emacs","last_synced_at":"2025-04-22T16:43:33.856Z","repository":{"id":62420945,"uuid":"265638094","full_name":"rclarey/deno-emacs","owner":"rclarey","description":"A collection of utilities to allow for development with deno in emacs!","archived":false,"fork":false,"pushed_at":"2023-01-25T03:40:27.000Z","size":22,"stargazers_count":16,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-17T07:16:59.568Z","etag":null,"topics":["deno","emacs","emacs-mode","formatter"],"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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rclarey.png","metadata":{"files":{"readme":"readme.org","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}},"created_at":"2020-05-20T17:25:57.000Z","updated_at":"2025-02-05T08:02:02.000Z","dependencies_parsed_at":"2023-02-14T04:15:47.843Z","dependency_job_id":null,"html_url":"https://github.com/rclarey/deno-emacs","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rclarey%2Fdeno-emacs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rclarey%2Fdeno-emacs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rclarey%2Fdeno-emacs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rclarey%2Fdeno-emacs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rclarey","download_url":"https://codeload.github.com/rclarey/deno-emacs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250279651,"owners_count":21404428,"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":["deno","emacs","emacs-mode","formatter"],"created_at":"2024-10-02T06:05:29.479Z","updated_at":"2025-04-22T16:43:33.835Z","avatar_url":"https://github.com/rclarey.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+TITLE: deno-emacs\n\nA collection of utilities to allow for development with [[https://deno.land][deno]] in emacs!\n\nThis repository contains the following utilities:\n- [[deno-fmt.el]]\n\n* deno-fmt.el\n~deno-fmt~ is function that formats the current buffer on save with [[https://deno.land/manual/tools/formatter][deno fmt]].\nThe package also exports a minor mode that applies ~(deno-fmt)~ on save.\n\n** Installation\nFeel free to replace ~typescript-mode~ / ~js2-mode~ in the following with your TypeScript/JavaScript mode of choice.\n\n*** Vanilla\n[[https://melpa.org/#/getting-started][Configure emacs to use melpa]], and require ~deno-fmt~ in your emacs config\n#+BEGIN_SRC elisp\n(require 'deno-fmt)\n#+END_SRC\nthen add hooks to automatically enable the minor mode\n#+BEGIN_SRC elisp\n(add-hook 'typescript-mode-hook 'deno-fmt-mode)\n(add-hook 'js2-mode-hook 'deno-fmt-mode)\n#+END_SRC\n\n*** use-package\nAdd the following to your emacs config\n#+BEGIN_SRC elisp\n(use-package deno-fmt\n  :ensure t\n  :hook (js2-mode typescript-mode))\n#+END_SRC\n\n*** Doom Emacs\nAdd ~deno-fmt~ to your ~.doom.d/packages.el~\n#+BEGIN_SRC elisp\n(package! deno-fmt)\n#+END_SRC\nthen add hooks to ~.doom.d/config.el~\n#+BEGIN_SRC elisp\n(add-hook 'typescript-mode-hook 'deno-fmt-mode)\n(add-hook 'js2-mode-hook 'deno-fmt-mode)\n#+END_SRC\n\n*** spacemacs\nAdd ~deno-fmt~ to ~dotspacemacs-additional-packages~ in your ~.spacemacs~ file:\n#+BEGIN_SRC elisp\n(defun dotspacemacs/layers ()\n  (setq-default\n   ;; ...\n   dotspacemacs-additional-packages '(deno-fmt)))\n#+END_SRC\nthen add hooks in ~dotspacemacs/user-config~\n#+BEGIN_SRC elisp\n(defun dotspacemacs/user-config ()\n  ;; ...\n  (add-hook 'typescript-mode-hook 'deno-fmt-mode)\n  (add-hook 'js2-mode-hook 'deno-fmt-mode))\n#+END_SRC\n\n** Only enable ~deno-fmt-mode~ for Deno projects\nThe most reliable way to do this is to make sure your Deno projects always have a ~deno.jsonc~ or ~deno.json~ file in the root directory, then you can do something like:\n#+BEGIN_SRC elisp\n(defun deno-project-p ()\n  (let ((root (projectile-project-root)))\n    (unless (null root)\n      (let ((config1 (concat root \"deno.jsonc\"))\n            (config2 (concat root \"deno.json\")))\n        (or (file-exists-p config1) (file-exists-p config2))))))\n\n(defun fmt-for-deno ()\n  (if (deno-project-p)\n      (deno-fmt-mode)))\n\n(add-hook 'typescript-mode-hook #'fmt-for-deno)\n(add-hook 'js2-mode-hook #'fmt-for-deno)\n#+END_SRC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frclarey%2Fdeno-emacs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frclarey%2Fdeno-emacs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frclarey%2Fdeno-emacs/lists"}