From 6547fb938c0916a2e9505a6493c3e623e7e728a5 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Mon, 23 Sep 2013 09:07:04 -0400 Subject: [PATCH] add flymake-jshint package for emacs --- emacs | 6 + .../flymake-jshint-autoloads.el | 18 +++ .../flymake-jshint-1.0/flymake-jshint-pkg.el | 1 + .../flymake-jshint-1.0/flymake-jshint-pkg.elc | Bin 0 -> 641 bytes .../elpa/flymake-jshint-1.0/flymake-jshint.el | 119 ++++++++++++++++++ .../flymake-jshint-1.0/flymake-jshint.elc | Bin 0 -> 1446 bytes 6 files changed, 144 insertions(+) create mode 100644 emacs.d/elpa/flymake-jshint-1.0/flymake-jshint-autoloads.el create mode 100644 emacs.d/elpa/flymake-jshint-1.0/flymake-jshint-pkg.el create mode 100644 emacs.d/elpa/flymake-jshint-1.0/flymake-jshint-pkg.elc create mode 100644 emacs.d/elpa/flymake-jshint-1.0/flymake-jshint.el create mode 100644 emacs.d/elpa/flymake-jshint-1.0/flymake-jshint.elc diff --git a/emacs b/emacs index fcf4c23..8e71520 100644 --- a/emacs +++ b/emacs @@ -28,6 +28,9 @@ ;disable vc-git (dont use it and too slow to start up) (setq vc-handled-backends nil) +;dont use tabs! +(setq-default indent-tabs-mode nil) + ;auto-indent (define-key global-map (kbd "RET") 'newline-and-indent) @@ -40,6 +43,9 @@ (require 'flymake-cursor) (add-hook 'find-file-hook 'flymake-find-file-hook) +(require 'flymake-jshint) +(add-hook 'js-mode-hook 'flymake-mode) + (require 'projectile) (setq projectile-completion-system 'grizzl) (setq projectile-enable-caching t) diff --git a/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint-autoloads.el b/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint-autoloads.el new file mode 100644 index 0000000..cb16c57 --- /dev/null +++ b/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint-autoloads.el @@ -0,0 +1,18 @@ +;;; flymake-jshint-autoloads.el --- automatically extracted autoloads +;; +;;; Code: + + +;;;### (autoloads nil nil ("flymake-jshint-pkg.el" "flymake-jshint.el") +;;;;;; (21025 54429 922272 0)) + +;;;*** + +(provide 'flymake-jshint-autoloads) +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; coding: utf-8 +;; End: +;;; flymake-jshint-autoloads.el ends here diff --git a/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint-pkg.el b/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint-pkg.el new file mode 100644 index 0000000..cacd795 --- /dev/null +++ b/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint-pkg.el @@ -0,0 +1 @@ +(define-package "flymake-jshint" "1.0" "making flymake work with JSHint" (quote nil)) diff --git a/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint-pkg.elc b/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint-pkg.elc new file mode 100644 index 0000000000000000000000000000000000000000..e2dfe2e4c8f5e6977f4bba5b74910da42852f0f6 GIT binary patch literal 641 zcmbtR%WlFj5agU6=yjD-D-nkfq!w~1Af!^YQYG3CSZpV8#Ok0i`tbq*% znC~jcGZ@{@@_aU#!g!SBJ!9!?3ng(v`sStc=}+2}$rib1B9*$swA6cQ7q`IDoammb8y zV5>L?%YAUlRDMXP^8ru@+Qhd`Hf7`KKMrAu!`J}ant(LC3uSUg9h1yA%k>&~jShJr zlfzyfjR0?fqk*jiZSj}L`7<6QI<2IGP}ATzKj~6L7uC_gr4>cdwUDJUGU<>vSV@R~ g2Ny$3(a}j^(mvsg!rr + +;; Author: Wilfred Hughes +;; Created: 23 June 2011 +;; Version: 1.0 +;; Keywords: flymake, jshint, javascript + +;; This file is not part of GNU Emacs. +;; However, it is distributed under the same license. + +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Commentary + +;; To use JSHint with emacs, you will need JSHint installed and available on +;; your path. You should be able to do + +;; $ jshint + +;; without problem. To do this, you can install node.js, npm and +;; jshint by doing the following: + +;; $ apt-get install nodejs # or your distro / OS equivalent +;; $ curl http://npmjs.org/install.sh | sh +;; $ npm install -g jshint + +;; You will probably want to configure the warnings that JSHint +;; produces. The full list is at http://www.jshint.com/options/ but +;; for reference I use: + +;; { "browser": true, //browser constants, such as alert +;; "curly": true, // require {} on one-line if +;; "undef": true, // non-globals must be declared before use +;; "newcap": true, // constructors must start with capital letter +;; "jquery": true, // jQuery constants +;; "nomen": false, // permit leading/trailing underscores, these do actually mean private in jQuery plugins +;; "nonew": true, // don't permit object creation for side-effects only +;; "strict": true // require "use strict"; +;; } + +;; Save this in a file called whatever.json and then set +;; jshint-configuration-path to point to it. + +;;; Usage + +;; Add to your emacs config: + +;; (require 'flymake-jshint) +;; (add-hook 'js-mode-hook 'flymake-mode) + +;; making sure that flymake-jshint.el is on your load-path. If not, +;; also add to your config: + +;; (add-to-list 'load-path "~/.emacs.d/path/to/flymake-jshint.el") + +;;; Debugging + +;; If JSHint isn't working for any reason, execute + +;; M-x set-variable flymake-log-level 3 + +;; and you will see what is going wrong listed in the *Messages* +;; buffer. + +(require 'flymake) + + +(defcustom jshint-configuration-path nil + "Path to a JSON configuration file for JSHint." + :type 'string + :group 'flymake-jshint) + + +(defun flymake-jshint-init () + (let* ((temp-file (flymake-init-create-temp-buffer-copy + 'flymake-create-temp-inplace)) + (local-file (file-relative-name + temp-file + (file-name-directory buffer-file-name)))) + (if jshint-configuration-path + (list "jshint" (list local-file "--config" (expand-file-name jshint-configuration-path))) + (list "jshint" (list local-file))))) + + + +(setq flymake-allowed-file-name-masks + (cons '(".+\\.js$" + flymake-jshint-init + flymake-simple-cleanup + flymake-get-real-file-name) + flymake-allowed-file-name-masks)) + + +(setq flymake-err-line-patterns + (cons '("^\\(.*\\): line \\([[:digit:]]+\\), col \\([[:digit:]]+\\), \\(.+\\)$" + 1 2 3 4) + flymake-err-line-patterns)) + +; load flymake automatically in JavaScript mode +(add-hook 'js-mode-hook 'flymake-mode) + +(provide 'flymake-jshint) + +;;; flymake-jshint.el ends herep \ No newline at end of file diff --git a/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint.elc b/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint.elc new file mode 100644 index 0000000000000000000000000000000000000000..7a772e4d8d529eac5a8dac74ba785ba2f7706066 GIT binary patch literal 1446 zcmbtUOLNmO5bh0{Uf=}N1G6;@G^KK4JEd)Up-nqO86KS}oZ>K}$a11qmW-sNgkR6f zcKQNN^~{d#U3nkh_pJ|3J`J9&tgN&S4h~?Ti&99Q!FT~obcyZ2lnmsL`s;KY9jbId5Pg}4_cVN}Jggqs4D*jedBA%0Vb z2W;4?g5RdX*4@l3w~#FqEd+y1GwX~{6T6L3V;#^eLlmy-MEha9|5uJoV-BSqFs&TL z!!wtYJ@hDYcs@8i1vaIIGKWoWSLLb7z-nMr!I*>8^iGjx7z>;lDYyYQ#e;ED*F}0B zbomAzdbL`u&GEuWlpJc7p+7NtRxUee^frRMc55@^IhBH1cymvULJ0>ihgI$6j2qAW zl#l(Gs~c&szJ?nqjB$`6eeuWg(hqd$Jp_y@;Z4HAwQC8>5}Jj-)#s%L_d^xDAX zs$>7hVcDT?jWEM0GE?Pj(lK2wu7|uG7pjz$AqBXX#Bhn&&Usz9a`_fWh9ohk%>shD zg#ZGA%zK;z;J->#^G(Mi*cl;wchwO;K6--SB&$bHmymhD(x4GcB@R?irHkb>xV!p_ z-%3piYAGz-d6WC7#F(lAy`#%bq f;=dDhO$uC}`eoUg_dsd%T;P4_tY;WO(r*0$xE;wz literal 0 HcmV?d00001