Mobile/Fennec/Android/Lint/Eslint: Difference between revisions

From MozillaWiki
< Mobile‎ | Fennec‎ | Android‎ | Lint
Jump to navigation Jump to search
(Created page with "==Install== npm global install is the recommended way of getting eslint. On OS X: brew install npm npm -g install eslint ==Run== To run eslint, cd to `mobile/android` and...")
 
Line 6: Line 6:


==Run==
==Run==
To run eslint, cd to `mobile/android` and run eslint on all .js and .jsm files:
eslint should be run from mobile/android as it contains the base .eslintignore and .eslintrc files. If you run from another directory, eslint may not parse these files and the output may be unexpected. For example, from the repository root:
 
  mach eslint mobile/android
  # From mozilla-central
pushd mobile/android
eslint . --ext "[.js,.jsm]"
popd

Revision as of 00:37, 3 July 2015

Install

npm global install is the recommended way of getting eslint. On OS X:

brew install npm
npm -g install eslint

Run

eslint should be run from mobile/android as it contains the base .eslintignore and .eslintrc files. If you run from another directory, eslint may not parse these files and the output may be unexpected. For example, from the repository root:

mach eslint mobile/android