Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

Commit

Permalink
Merge pull request #104 from pdehaan/clean-eslint
Browse files Browse the repository at this point in the history
Fix a bunch of ESLint and HTMLLint errors
  • Loading branch information
dannycoates committed Jun 22, 2017
2 parents 8ed180d + 9bcdf09 commit da8b4ab
Show file tree
Hide file tree
Showing 15 changed files with 677 additions and 1,325 deletions.
20 changes: 5 additions & 15 deletions .eslintrc.yml
@@ -1,13 +1,11 @@
env:
browser: true
es6: true
jquery: true
mocha: true
node: true

extends:
- eslint:recommended
- plugin:node/recommended
- plugin:security/recommended

plugins:
- node
Expand All @@ -16,18 +14,10 @@ plugins:
root: true

rules:
security/detect-buffer-noassert: warn
security/detect-child-process: warn
security/detect-disable-mustache-escape: warn
security/detect-eval-with-expression: warn
security/detect-new-buffer: warn
security/detect-no-csrf-before-method-override: warn
security/detect-non-literal-fs-filename: warn
security/detect-non-literal-regexp: warn
security/detect-non-literal-require: warn
security/detect-possible-timing-attacks: warn
security/detect-pseudoRandomBytes: warn
security/detect-unsafe-regex: warn
node/no-unpublished-require: off

security/detect-non-literal-fs-filename: off
security/detect-object-injection: off

eqeqeq: error
no-console: warn
Expand Down
1 change: 1 addition & 0 deletions .stylelintrc
Expand Up @@ -2,4 +2,5 @@ extends: stylelint-config-standard

rules:
color-hex-case: upper
declaration-colon-newline-after: null
selector-list-comma-newline-after: null
5 changes: 5 additions & 0 deletions circle.yml
Expand Up @@ -9,3 +9,8 @@ deployment:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker build . -t mozilla/portal:latest
- docker push mozilla/portal:latest

test:
override:
- npm run lint
- npm test
3 changes: 3 additions & 0 deletions frontend/src/.eslintrc.yml
@@ -0,0 +1,3 @@
env:
browser: true
jquery: true
4 changes: 2 additions & 2 deletions frontend/src/fileSender.js
@@ -1,5 +1,5 @@
const EventEmitter = require('events');
const { ivToStr, notify } = require('./utils');
const { ivToStr } = require('./utils');

class FileSender extends EventEmitter {
constructor(file) {
Expand All @@ -23,7 +23,7 @@ class FileSender extends EventEmitter {
}

if (xhr.status === 200) {
console.log('The file was successfully deleted.')
console.log('The file was successfully deleted.');
} else {
console.log('The file has expired, or has already been deleted.');
}
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/upload.js
@@ -1,5 +1,5 @@
const FileSender = require('./fileSender');
const { notify } = require('./utils')
const { notify } = require('./utils');
const $ = require('jquery');

$(document).ready(function() {
Expand All @@ -15,7 +15,7 @@ $(document).ready(function() {

// copy link to clipboard
$copyBtn.click(() => {
var aux = document.createElement('input');
const aux = document.createElement('input');
aux.setAttribute('value', $('#link').attr('value'));
document.body.appendChild(aux);
aux.select();
Expand Down Expand Up @@ -61,7 +61,6 @@ $(document).ready(function() {
const popupDiv = document.createElement('div');
const $popupText = $('<span>', { class: 'popuptext' });
const cellText = document.createTextNode(file.name);
const progress = document.createElement('p');

name.appendChild(cellText);

Expand Down
9 changes: 4 additions & 5 deletions frontend/src/utils.js
Expand Up @@ -21,15 +21,14 @@ function strToIv(str) {
}

function notify(str) {
if (!("Notification" in window)) {
if (!('Notification' in window)) {
return;
} else if (Notification.permission === 'granted') {
new Notification(str)
new Notification(str);
} else if (Notification.permission !== 'denied') {
Notification.requestPermission(function(permission) {
if (permission === 'granted')
new Notification(str);
})
if (permission === 'granted') new Notification(str);
});
}
}

Expand Down

0 comments on commit da8b4ab

Please sign in to comment.