fixed readme, added clarifying comments to the source (#147)

This commit is contained in:
Kumar McMillan
2016-11-21 10:20:26 -06:00
committed by GitHub
parent e4eeac9504
commit dcdd025cb2
3 changed files with 17 additions and 4 deletions

View File

@@ -2,9 +2,16 @@
## What it shows
A project configured to use the [Mozilla ESlint configuration](https://www.npmjs.com/package/eslint-plugin-mozilla). By using a linter on your extension source code you can be sure that you will only be writing JavaScript that is compatible with Firefox.
This shows how to configure a WebExtension with
[eslint](http://eslint.org/)
to protect against
writing JavaScript code that may be incompatible with modern versions of
Firefox or Chrome.
## How to use
## How to use it
* run `npm install` to install packages
* run `npm run lint` to use eslint
This requires [NodeJS](https://nodejs.org/en/) and [npm](http://npmjs.com/).
* Change into the example directory and run `npm install` to install all
dependencies.
* Execute `npm run lint` to view a report of any coding errors.

View File

@@ -1,3 +1,6 @@
// This special eslint comment will declare that the named
// function has been "exported" into the global scope.
/* exported getUsefulContents */
function getUsefulContents(callback) {
callback('Hello World');

View File

@@ -1,3 +1,6 @@
// This special eslint comment declares that the code below relies on
// a named function in the global scope.
/* global getUsefulContents */
function start() {
getUsefulContents(data => {