Skip to content

Commit

Permalink
Update eslint rules. Fix source accordingly.
Browse files Browse the repository at this point in the history
  • Loading branch information
vellotis committed Jan 6, 2017
1 parent 54d12eb commit a49a91d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
20 changes: 12 additions & 8 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"parser": "babel-eslint",
"extends": "eslint:recommended",
"env": {
"browser": true,
"es6": true,
"node": true
},
Expand All @@ -10,13 +11,16 @@
"modules": true
},
"rules": {
"indent": [2, 4, {"SwitchCase": 1}],
"no-console": 1,
"no-const-assign": 2,
"no-tabs": 1,
"no-unused-vars": [1, {"vars": "all", "args": "none"}],
"no-var": 1,
"prefer-const": 1,
"no-trailing-spaces": 1
"eol-last": ["error", "always"],
"indent": ["error", 4, {"SwitchCase": 1}],
"no-console": ["error"],
"no-const-assign": ["error"],
"no-tabs": ["error"],
"no-trailing-spaces": ["error"],
"no-unused-vars": ["error", {"vars": "all", "args": "none"}],
"no-var": ["error"],
"prefer-const": ["error"],
"semi": ["error", "never"],
"template-curly-spacing": ["error", "always"]
}
}
3 changes: 1 addition & 2 deletions src/hwcrypto.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*global window location*/
'use strict'

// JavaScript library as described in
Expand Down Expand Up @@ -52,7 +51,7 @@ function _autodetect(force) {

function _performCrypto(method, cert, hash, options = {}) {
if (arguments.length < 3) {
return Promise.reject(new Error(CONSTANTS.INVALID_ARGUMENT));
return Promise.reject(new Error(CONSTANTS.INVALID_ARGUMENT))
}
options.lang = (options && options.lang) || 'en'

Expand Down
1 change: 0 additions & 1 deletion src/interfaces/DigiDocExtension.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*global window navigator*/
import NotImplementedPlugin from '../NotImplementedPlugin'
import * as CONSTANTS from '../constants'
import { hasExtensionFor } from '../utils'

const digidoc_chrome = 'TokenSigning'
Expand Down
4 changes: 1 addition & 3 deletions src/interfaces/DigiDocPlugin.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/*global navigator*/
import { hasPluginFor, loadPluginFor, _debug } from '../utils'
import * as CONSTANTS from '../constants'
import NotImplementedPlugin from '../NotImplementedPlugin'

//
const digidoc_mime = 'application/x-digidoc'

function code2str(err) {
Expand Down Expand Up @@ -92,7 +90,7 @@ class DigiDocPlugin extends NotImplementedPlugin {
_debug(JSON.stringify(ex))
reject(code2err.call(this, this.interface.errorCode))
}
}, 0);
}, 0)
} else {
_debug('invalid certificate: ' + JSON.stringify(cert))
reject(new Error(CONSTANTS.INVALID_ARGUMENT))
Expand Down
2 changes: 0 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/*global navigator window document XMLHttpRequest*/

import * as CONSTANTS from './constants'

// Returns "true" if a plugin is present for the MIME
Expand Down

0 comments on commit a49a91d

Please sign in to comment.