Skip to content

Commit

Permalink
Lint our JS code.
Browse files Browse the repository at this point in the history
  • Loading branch information
sfermigier committed May 12, 2015
1 parent 8c59b19 commit 3455423
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 9 deletions.
11 changes: 11 additions & 0 deletions .eslintrc
@@ -0,0 +1,11 @@
{
"env": {
"browser": true,
"node": true
},
"rules": {
"camelcase": false,
"no-trailing-spaces": false,
"quotes": 0
}
}
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -10,6 +10,7 @@
.ropeproject
*,cover

node_modules
env
whoosh*
abilian.db
Expand Down
13 changes: 8 additions & 5 deletions Makefile
@@ -1,4 +1,4 @@
.PHONY: test pep8 pylama clean docs tox
.PHONY: test pep8 pylama clean docs tox jslint

# The source director
SRC=abilian
Expand Down Expand Up @@ -28,6 +28,10 @@ test-with-coverage:
tox:
tox

vagrant-tests:
vagrant up
vagrant ssh -c /vagrant/deploy/vagrant_test.sh

#
# Various Checkers
#
Expand All @@ -52,13 +56,12 @@ pylama:
pylint:
pylint --rcfile=etc/pylintrc $(SRC)

jslint:
npm run lint --silent

check-docs:
sphinx-build -W -b html docs/ docs/_build/html

vagrant-tests:
vagrant up
vagrant ssh -c /vagrant/deploy/vagrant_test.sh

#
# Everything else
#
Expand Down
2 changes: 1 addition & 1 deletion abilian/web/resources/js/abilian.js
Expand Up @@ -134,7 +134,7 @@
);
}
);
};
}

function initLiveSearch() {
var datasets = [];
Expand Down
4 changes: 2 additions & 2 deletions abilian/web/resources/js/widgets/dynamic-row.js
Expand Up @@ -37,8 +37,8 @@
function() {
var item = $(this);
var shortName = item.data("shortName");
var name = self.prefix + '-' + self.current_index
if(shortName) {
var name = self.prefix + '-' + self.current_index;
if (shortName) {
name = name + '-' + shortName;
}
item.attr('name', name);
Expand Down
2 changes: 1 addition & 1 deletion abilian/web/resources/js/widgets/file.js
Expand Up @@ -24,7 +24,7 @@
self.button.on('change.fileapi', 'input',
{fileinput: self},
self.addFiles);
};
}

FileInput.prototype = {
addFiles: function(evt) {
Expand Down
17 changes: 17 additions & 0 deletions package.json
@@ -0,0 +1,17 @@
{
"name": "abilian-core",
"repository": {
"type": "git",
"url": "TODO"
},
"description": "TODO",
"scripts": {
"prestart": "npm install",
"lint": "eslint abilian/web/resources/js/ --ext .js"
},
"dependencies": {
},
"devDependencies": {
"eslint": "^0.20.0"
}
}

0 comments on commit 3455423

Please sign in to comment.