Add formatting hook on save
This commit is contained in:
parent
22eeacb374
commit
cef7aa4cd5
@ -11,3 +11,6 @@
|
|||||||
(load-file "~/.spacemacs.d/spacemacs-init.el")
|
(load-file "~/.spacemacs.d/spacemacs-init.el")
|
||||||
(load-file "~/.spacemacs.d/spacemacs-user-init.el")
|
(load-file "~/.spacemacs.d/spacemacs-user-init.el")
|
||||||
(load-file "~/.spacemacs.d/spacemacs-user-config.el")
|
(load-file "~/.spacemacs.d/spacemacs-user-config.el")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -77,6 +77,8 @@ values."
|
|||||||
dotspacemacs-additional-packages '(
|
dotspacemacs-additional-packages '(
|
||||||
all-the-icons
|
all-the-icons
|
||||||
editorconfig
|
editorconfig
|
||||||
|
json-mode
|
||||||
|
rjsx-mode
|
||||||
)
|
)
|
||||||
;; A list of packages that cannot be updated.
|
;; A list of packages that cannot be updated.
|
||||||
dotspacemacs-frozen-packages '()
|
dotspacemacs-frozen-packages '()
|
||||||
|
@ -12,7 +12,26 @@ you should place your code here."
|
|||||||
(setq neo-theme (if (display-graphic-p) 'icons 'arrow))
|
(setq neo-theme (if (display-graphic-p) 'icons 'arrow))
|
||||||
(setq neo-vc-integration '(face))
|
(setq neo-vc-integration '(face))
|
||||||
|
|
||||||
|
|
||||||
;; Use typescript mode for js/jsx too
|
;; Use typescript mode for js/jsx too
|
||||||
|
(add-hook 'before-save-hook 'tide-format-before-save)
|
||||||
|
(setq tide-format-options
|
||||||
|
'(
|
||||||
|
:configFileName "tsconfig.prod.json"
|
||||||
|
:insertSpaceAfterFunctionKeywordForAnonymousFunctions
|
||||||
|
t
|
||||||
|
:insertSpaceBeforeFunctionParenthesis
|
||||||
|
t
|
||||||
|
:insertSpaceAfterConstructor
|
||||||
|
t
|
||||||
|
:spaceBeforeFunctionParen t
|
||||||
|
:terIndent 2
|
||||||
|
:complexity t
|
||||||
|
:no-unused-vars t
|
||||||
|
:allowJs t
|
||||||
|
:placeOpenBraceOnNewLineForFunctions nil))
|
||||||
|
|
||||||
|
;; (setq js2-basic-offset 2)
|
||||||
(add-to-list 'auto-mode-alist '("\\.js\\'" . typescript-mode))
|
(add-to-list 'auto-mode-alist '("\\.js\\'" . typescript-mode))
|
||||||
(add-to-list 'auto-mode-alist '("\\.jsx\\'" . typescript-mode))
|
(add-to-list 'auto-mode-alist '("\\.jsx\\'" . typescript-mode))
|
||||||
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-mode))
|
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-mode))
|
||||||
|
Loading…
Reference in New Issue
Block a user