mozilla / testpilot-metrics

Metrics broker library for Test Pilot experiments. Pings Google Analytics and Mozilla metrics servers
Mozilla Public License 2.0
3 stars 7 forks source link

Add eslint #2

Closed jaredhirsch closed 7 years ago

pdehaan commented 7 years ago

Bare minimum is probably:

env:
  browser: true
  es6: true
  mocha: true
  node: true
  webextensions: true

extends:
  - eslint:recommended

globals:
  BroadcastChannel: false
  Components: false
  Services: false

rules:
  eqeqeq: error
  no-console: warn
  quotes: [error, single]

Gives me about 28 errors and 3 warnings. If I run eslint . --fix and autofix any easy errors, that number drops down to 20 errors and 3 warnings.

pdehaan commented 7 years ago

A bit edge case, but this just bit me... I ran examples/sdk $ npm run build and it failed because I don't have a globally installed jpm. After running npm install jpm to install it locally in that subfolder, I re-ran npm run build and it added a node_examples folder. Later when I went to re-run ESLint, it tried to scan the nested ./examples/sdk/node_modules/* directory, and crashed.

Long story longer, we should add a lame .eslintignore file with the following:

examples/sdk/node_modules/**
jaredhirsch commented 7 years ago

PRs welcome :-)

pdehaan commented 7 years ago

PR #8 submitted.