Skip to content
This repository has been archived by the owner on Nov 14, 2018. It is now read-only.

Commit

Permalink
Add linting test and make recommended updates
Browse files Browse the repository at this point in the history
  • Loading branch information
openjck committed Mar 11, 2016
1 parent ca64589 commit 825c4f3
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 9 deletions.
22 changes: 22 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
env:
browser: true,
jquery: true,
node: true

globals:
dashboard: false

rules:
curly: 0
eqeqeq: 2
guard-for-in: 2
indent: [2, 4, {SwitchCase: 1}]
no-bitwise: 2
no-caller: 2
no-empty: 2
no-extend-native: 2
no-irregular-whitespace: 2
no-undef: 2
no-unused-vars: 2
quotes: [2, single]
strict: [2, function]
7 changes: 3 additions & 4 deletions dashboard/static/js/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@

trackLink: function(event, url, data) {
// ctrl or cmd click or context menu
var newTab = (event.metaKey || event.ctrlKey || event.type == 'contextmenu');
var newTab = (event.metaKey || event.ctrlKey || event.type === 'contextmenu');
// is a same page anchor
var isAnchor = (url.indexOf("#") == 0);
var isAnchor = (url.indexOf('#') === 0);

if(newTab || isAnchor) {
analytics.trackEvent(data);
Expand Down Expand Up @@ -150,8 +150,7 @@
statusText: request.statusText,
crossDomain: settings.crossDomain,
dataType: settings.dataType
})
);
}));
});
},

Expand Down
7 changes: 5 additions & 2 deletions docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ Requirements
------------

* `postgres`_ for database
* `python`_ 2.7, `virtualenv`_, & `pip`_ for app server
* `python`_ 2.7, `virtualenv`_, `pip`_ for app server, & `npm`_ for front-end testing

.. _postgres: https://wiki.postgresql.org/wiki/Detailed_installation_guides
.. _python: https://www.python.org/
.. _virtualenv: http://docs.python-guide.org/en/latest/dev/virtualenvs/
.. _pip: https://pip.readthedocs.org/en/latest/
.. _npm: https://www.npmjs.com/


Install Locally
Expand Down Expand Up @@ -94,10 +95,12 @@ Run the Tests
#. Install test requirements::

pip install -r requirements-test.txt
npm install

#. Running the test suite::
#. Run the test suites::

python manage.py test
npm test


Working on Docs
Expand Down
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"dependencies": {
"yuglify": "^0.1.4"
}
"scripts": {
"test": "eslint dashboard/static/js/*.js; csslint --quiet --warnings=' ' dashboard/static/css/*.css push/static/css/*.css"
},
"dependencies": {
"yuglify": "^0.1.4"
},
"devDependencies": {
"csslint": "^0.10.0",
"eslint": "^2.3.0"
}
}

0 comments on commit 825c4f3

Please sign in to comment.