<commit_before>(require-package 'js3-mode)
(require-package 'tern)
(require-package 'company-tern)
(require-package 'web-beautify)

(add-to-list 'auto-mode-alist '("\\.js$" . js3-mode))
(add-hook 'js3-mode-hook (lambda ()
                           (tern-mode t)
                           (add-hook 'before-save-hook 'web-beautify-js)
                           (add-to-list 'company-backends 'company-tern)

                           (setq-default js3-global-externs
                                         '("module" "require" "__dirname" "process" "console" "define"
                                           "JSON" "$" "_" "Backbone" "buster" "sinon" "moment" "_gaq"
                                           "Zenbox" "Mousetrap" "Comoyo"))
                           (setq-default js3-indent-tabs-mode t)
                           (setq-default js3-indent-level 4)
                           (setq-default js3-auto-indent-p t)         ; it's nice for commas to right themselves.
                           (setq-default js3-enter-indents-newline t) ; don't need to push tab before typing
                           (setq-default js3-indent-on-enter-key t)))

(provide 'init-javascript-mode)<commit_msg>Emacs: Runs js-beautify only in javascript mode.<commit_after>(require-package 'js3-mode)
(require-package 'tern)
(require-package 'company-tern)
(require-package 'web-beautify)

(add-to-list 'auto-mode-alist '("\\.js$" . js3-mode))
(add-hook 'js3-mode-hook (lambda ()
                           (tern-mode t)
                           (add-hook 'before-save-hook (lambda ()
                                                         (when (string-equal major-mode "js3-mode"))
                                                           (web-beautify-js)))
                           (add-to-list 'company-backends 'company-tern)

                           (setq-default js3-global-externs
                                         '("module" "require" "__dirname" "process" "console" "define"
                                           "JSON" "$" "_" "Backbone" "buster" "sinon" "moment" "_gaq"
                                           "Zenbox" "Mousetrap" "Comoyo"))
                           (setq-default js3-indent-tabs-mode t)
                           (setq-default js3-indent-level 4)
                           (setq-default js3-auto-indent-p t)         ; it's nice for commas to right themselves.
                           (setq-default js3-enter-indents-newline t) ; don't need to push tab before typing
                           (setq-default js3-indent-on-enter-key t)))

(provide 'init-javascript-mode)
{'fraction_non_alphanumeric': 0.12262718299164768, 'fraction_numerical': 0.007972665148063782, 'mean_word_length': 1.275474956822107, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4608835', 'n_tokens_mistral': 734, 'n_tokens_neox': 718, 'n_words': 152}