DevTools/CodingStandards: Difference between revisions

add emacs instructions
(link to main .eslintrc)
(add emacs instructions)
Line 24: Line 24:


[[File:Eslint-sublimetext3.png|600px|ESLint in SublimeText 3]]
[[File:Eslint-sublimetext3.png|600px|ESLint in SublimeText 3]]
=== Running ESLint in Emacs ===
* First, install the flycheck package (flymake doesn't support ESLint yet).  You can get flycheck from the [https://marmalade-repo.org/ marmalade] or [http://stable.melpa.org/#/ melpa-stable] repositories.
* Tell flycheck to disable jslint, and enable flycheck in your javascript mode.  This snippet assumes the built-in javascript mode, but with minor changes (just the name of the hook) should work fine with js2-mode as well:
<nowiki>
(defun my-js-mode-hacks ()
  (flycheck-mode 1))
(require 'flycheck)
(setq-default flycheck-disabled-checkers
      (append flycheck-disabled-checkers
      '(javascript-jshint)))
(add-hook 'js-mode-hook #'my-js-mode-hacks)</nowiki>
* flycheck puts its bindings on <code>C-c !</code> by default, so use <code>C-c ! C-h</code> to see what is available.  There are key bindings to list all the errors and to move through the errors, among other things.


== Code style ==
== Code style ==
10

edits