Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Add travis and linting stuffs #117

Closed
pdehaan opened this issue Sep 5, 2014 · 1 comment
Closed

Add travis and linting stuffs #117

pdehaan opened this issue Sep 5, 2014 · 1 comment
Assignees

Comments

@pdehaan
Copy link
Contributor

pdehaan commented Sep 5, 2014

This is a mildly weird repo. On one hand it seems to be getting stale w/ PRs and everybody working in branches, but on the other hand this repo seems to be our first "integration" point with new services.

I randomly noticed that we don't have a .travis.yml file in this repo, or seemingly any sort of JSHint/ESLint set up.

Here's the rough output from the "oauth" branch, using my preferred ESLint:

$ eslint .

oauth.js
   4:4   error  'crypto' is read only         no-undef
  43:31  error  db is defined but never used  no-unused-vars

retarget.js
  10:1  error  'crypto' is read only  no-undef

server.js
   18:15  error  Expected error to be handled                                    handle-callback-err
   68:0   error  Missing "use strict" statement                                  strict
   82:36  error  Trailing comma                                                  no-comma-dangle
  116:23  error  Use path.join() or path.resolve() instead of + to create paths  no-path-concat
    2:4   error  https is defined but never used                                 no-unused-vars

static/js/123done.js
  66:38  error  ev is defined but never used  no-unused-vars
  70:38  error  ev is defined but never used  no-unused-vars

static/js/state.js
   59:14  error  Missing semicolon            semi
   57:20  error  Missing semicolon            semi
   65:5   error  Unnecessary semicolon        no-extra-semi
   79:3   error  Unnecessary semicolon        no-extra-semi
  130:3   error  Unnecessary semicolon        no-extra-semi
  153:3   error  Unnecessary semicolon        no-extra-semi
  184:27  error  Missing semicolon            semi
  107:40  error  e is defined but never used  no-unused-vars
  170:40  error  e is defined but never used  no-unused-vars

✖ 19 problems

... And here's my .eslintrc file:

env:
  node: true
  browser: true

globals:
  $: false
  loggedInEmail: false
  state: false

rules:
  camelcase: 0
  curly: 0
  dot-notation: 0
  no-use-before-define: [1, nofunc]
  quotes: [0, single]
@pdehaan
Copy link
Contributor Author

pdehaan commented Sep 5, 2014

IIRC, the odd 'crypto' is read only error is because I have this defined as a Node+Browser project and the browser has a Window.crypto API so we have a soft collision. I could solve it by either using separate .eslintrc file for the "static/" subdirectory; or just setting browser:false and predefining window and document and localStorage globals — although now that starts to feel gross.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants