Skip to content

Commit

Permalink
updated eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
dannycoates committed Aug 2, 2019
1 parent 20c063d commit f036df5
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 16 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ dist
assets
firefox
coverage
android/app/build
app/locale.js
app/capabilities.js
11 changes: 2 additions & 9 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ env:

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

Expand All @@ -22,13 +23,5 @@ rules:
security/detect-non-literal-fs-filename: off
security/detect-object-injection: off

eol-last: [error, always]
eqeqeq: error
no-alert: warn
no-console: warn
no-path-concat: error
no-unused-vars: [error, {argsIgnorePattern: "^_|err|event|next|reject"}]
no-var: error
one-var: [error, never]
prefer-const: error
quotes: [error, single, {avoidEscape: true}]
require-atomic-updates: warn
6 changes: 3 additions & 3 deletions app/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,13 @@ export function downloadStream(id, keychain) {

//////////////////

function download(id, keychain, onprogress, canceller) {
async function download(id, keychain, onprogress, canceller) {
const auth = await keychain.authHeader();
const xhr = new XMLHttpRequest();
canceller.oncancel = function() {
xhr.abort();
};
return new Promise(async function(resolve, reject) {
return new Promise(function(resolve, reject) {
xhr.addEventListener('loadend', function() {
canceller.oncancel = function() {};
const authHeader = xhr.getResponseHeader('WWW-Authenticate');
Expand All @@ -337,7 +338,6 @@ function download(id, keychain, onprogress, canceller) {
onprogress(event.loaded);
}
});
const auth = await keychain.authHeader();
xhr.open('get', getApiUrl(`/api/download/blob/${id}`));
xhr.setRequestHeader('Authorization', auth);
xhr.responseType = 'blob';
Expand Down
2 changes: 1 addition & 1 deletion app/streams.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global ReadableStream TransformStream */
/* global TransformStream */

export function transformStream(readable, transformer, oncancel) {
try {
Expand Down
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"css-mqpacker": "^7.0.0",
"cssnano": "^4.1.10",
"eslint": "^6.1.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-mocha": "^6.0.0",
"eslint-plugin-node": "^9.1.0",
"eslint-plugin-security": "^1.4.0",
Expand Down
4 changes: 2 additions & 2 deletions scripts/get-prod-locales.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ exec(cmd)
const locales = Object.keys(summary)
.filter(locale => {
const loc = summary[locale];
const hasMissing = loc.hasOwnProperty('missing');
const hasErrors = loc.hasOwnProperty('errors');
const hasMissing = Object.prototype.hasOwnProperty.call(loc, 'missing');
const hasErrors = Object.prototype.hasOwnProperty.call(loc, 'errors');
return !hasMissing && !hasErrors;
})
.sort();
Expand Down
2 changes: 1 addition & 1 deletion scripts/lint-locales.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function filterErrors(details) {
.sort()
.map(locale => {
const data = details[locale]
.filter(item => item.hasOwnProperty('error'))
.filter(item => Object.prototype.hasOwnProperty.call(item, 'error'))
.map(({ error }) => error);
return { locale, data };
})
Expand Down
2 changes: 2 additions & 0 deletions test/.eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ rules:
mocha/no-pending-tests: error
mocha/no-return-and-callback: warn
mocha/no-skipped-tests: error
mocha/no-setup-in-describe: off
mocha/no-hooks-for-single-case: off

no-console: off # ¯\_(ツ)_/¯

0 comments on commit f036df5

Please sign in to comment.