My private home-grown Emacs config
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

64 lines
1.9 KiB

(use-package web-mode
:hook (web-mode . lsp)
;; :hook (typescript-tsx-mode . lsp-deferred)
:mode (("\\.html\\'" . web-mode)
("\\.html\\.eex\\'" . web-mode)
("\\.html\\.heex\\'" . web-mode)
("\\.html\\.tera\\'" . web-mode)
("\\.html\\.jinja\\'" . web-mode))
:config
(setq web-mode-markup-indent-offset 2
web-mode-css-indent-offset 2
web-mode-code-indent-offset 2
web-mode-enable-auto-indentation nil
web-mode-enable-auto-pairing nil
web-mode-engines-alist '(("django" . "\\.html\\.tera\\'"))))
(use-package css-mode
:init (setq css-indent-offset 2))
(use-package js
:hook (js-mode . lsp-deferred)
:hook (tsx-mode . ck/add-eslint)
:init
(setq js-indent-level 2))
(use-package json-mode
:hook (json-mode . lsp-deferred))
(use-package typescript-mode
:hook (typescript-mode . lsp)
:hook (tsx-mode . ck/add-eslint)
;; (typescript-tsx-mode . lsp))
;; :mode ("\\.tsx\\'" . typescript-tsx-mode)
;; :init
;; (define-derived-mode typescript-tsx-mode typescript-mode "TypeScript-tsx")
:config
(setq typescript-indent-level 2))
(straight-use-package '(tsi :type git :host github :repo "orzechowskid/tsi.el"))
(straight-use-package '(tsx-mode :type git :host github :repo "orzechowskid/tsx-mode.el"))
(use-package tsx-mode
:mode (("\\.tsx\\'" . tsx-mode))
:custom (tsx-mode-tsx-auto-tags t)
:hook (tsx-mode . ck/add-eslint)
:config
(flycheck-add-mode 'javascript-eslint 'tsx-mode))
(use-package add-node-modules-path
:commands add-node-modules-path
:hook ((js-mode . add-node-modules-path)
(typescript-mode . add-node-modules-path)
(tsx-mode . add-node-modules-path)))
(use-package prettier
:hook ((tsx-mode . prettier-mode)
(typescript-mode . prettier-mode)
(js-mode . prettier-mode)
(json-mode . prettier-mode)
(css-mode . prettier-mode)
(scss-mode . prettier-mode)))
(provide 'setup-web)