diff --git a/.spacemacs.d/init.el b/.spacemacs.d/init.el index 32fcea3..502e3e7 100644 --- a/.spacemacs.d/init.el +++ b/.spacemacs.d/init.el @@ -11,3 +11,6 @@ (load-file "~/.spacemacs.d/spacemacs-init.el") (load-file "~/.spacemacs.d/spacemacs-user-init.el") (load-file "~/.spacemacs.d/spacemacs-user-config.el") + + + diff --git a/.spacemacs.d/spacemacs-layers.el b/.spacemacs.d/spacemacs-layers.el index 692fb00..67a7d86 100644 --- a/.spacemacs.d/spacemacs-layers.el +++ b/.spacemacs.d/spacemacs-layers.el @@ -77,6 +77,8 @@ values." dotspacemacs-additional-packages '( all-the-icons editorconfig + json-mode + rjsx-mode ) ;; A list of packages that cannot be updated. dotspacemacs-frozen-packages '() diff --git a/.spacemacs.d/spacemacs-user-config.el b/.spacemacs.d/spacemacs-user-config.el index 57e31f6..ae435f9 100644 --- a/.spacemacs.d/spacemacs-user-config.el +++ b/.spacemacs.d/spacemacs-user-config.el @@ -12,7 +12,26 @@ you should place your code here." (setq neo-theme (if (display-graphic-p) 'icons 'arrow)) (setq neo-vc-integration '(face)) + ;; 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 '("\\.jsx\\'" . typescript-mode)) (add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-mode))