ignore some lint warnings

This commit is contained in:
Danny Coates 2018-03-01 21:36:45 -08:00
parent fddf1c40dc
commit 80e9f129d8
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB
6 changed files with 15 additions and 5 deletions

View File

@ -123,6 +123,7 @@ a {
cursor: pointer;
/* Force flat button look */
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
appearance: none;
font-size: 15px;
padding-bottom: 3px;

View File

@ -19,6 +19,7 @@ export default function(state, emitter) {
return;
}
if (target.files.length > 1) {
// eslint-disable-next-line no-alert
return alert(state.translate('uploadPageMultipleFilesAlert'));
}
const file = target.files[0];
@ -26,9 +27,8 @@ export default function(state, emitter) {
return;
}
if (file.size > MAXFILESIZE) {
window.alert(
state.translate('fileTooBig', { size: bytes(MAXFILESIZE) })
);
// eslint-disable-next-line no-alert
alert(state.translate('fileTooBig', { size: bytes(MAXFILESIZE) }));
return;
}
emitter.emit('upload', { file, type: 'drop' });

View File

@ -111,6 +111,7 @@ export default function(state, emitter) {
openLinksInNewTab(links, false);
emitter.emit('pushState', `/share/${ownedFile.id}`);
} catch (err) {
// eslint-disable-next-line no-console
console.error(err);
if (err.message === '0') {
@ -136,6 +137,7 @@ export default function(state, emitter) {
metrics.addedPassword({ size: file.size });
await delay(1000);
} catch (err) {
// eslint-disable-next-line no-console
console.error(err);
state.passwordSetError = err;
} finally {
@ -186,6 +188,7 @@ export default function(state, emitter) {
state.transfer.reset();
return render();
}
// eslint-disable-next-line no-console
console.error(err);
state.transfer = null;
const location = err.message === '404' ? '/404' : '/error';

View File

@ -73,7 +73,8 @@ module.exports = function(state, emit) {
return;
}
if (file.size > MAXFILESIZE) {
window.alert(state.translate('fileTooBig', { size: bytes(MAXFILESIZE) }));
// eslint-disable-next-line no-alert
alert(state.translate('fileTooBig', { size: bytes(MAXFILESIZE) }));
return;
}

View File

@ -17,6 +17,7 @@ function getLocale(name) {
}
function serverTranslator(name) {
// eslint-disable-next-line security/detect-non-literal-require
return require(`../dist/${locales[`public/locales/${name}/send.ftl`]}`);
}

View File

@ -4,6 +4,10 @@ const fs = require('fs');
const path = require('path');
const { negotiateLanguages } = require('fluent-langneg');
const langData = require('cldr-core/supplemental/likelySubtags.json');
// We return early in the middleware if the lang header is long.
// If that ever changes we should re-evaluate this regex.
// eslint-disable-next-line security/detect-unsafe-regex
const acceptLanguages = /(([a-zA-Z]+(-[a-zA-Z0-9]+){0,2})|\*)(;q=[0-1](\.[0-9]+)?)?/g;
function allLangs() {