;;; init-json.el --- Initialize json-mode -*- lexical-binding: t -*- ;;; Commentary: ;; My json-mode is derived from js-mode. There are two benefits of json-mode. ;; First, json-mode ensures that JSON files are linted using a JSON linter ;; instead of a JavaScript linter. Second, json-mode ensures that js-jsx-mode ;; isn't enabled for JSON files. ;;; Code: (require 'init-misc) (define-derived-mode json-mode js-mode "JSON") (add-to-list 'auto-mode-alist '("\\.json\\'" . json-mode)) (add-hook 'js-mode-hook #'my-add-node-modules-path) (provide 'init-json) ;;; init-json.el ends here