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; cursor: pointer;
/* Force flat button look */ /* Force flat button look */
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
appearance: none; appearance: none;
font-size: 15px; font-size: 15px;
padding-bottom: 3px; padding-bottom: 3px;

View File

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

View File

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

View File

@ -73,7 +73,8 @@ module.exports = function(state, emit) {
return; return;
} }
if (file.size > MAXFILESIZE) { 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; return;
} }

View File

@ -4,7 +4,7 @@ const isServer = typeof gen === 'function';
const prefix = isServer ? '/' : ''; const prefix = isServer ? '/' : '';
let manifest = {}; let manifest = {};
try { try {
//eslint-disable-next-line node/no-missing-require // eslint-disable-next-line node/no-missing-require
manifest = require('../dist/manifest.json'); manifest = require('../dist/manifest.json');
} catch (e) { } catch (e) {
// use middleware // use middleware
@ -17,6 +17,7 @@ function getLocale(name) {
} }
function serverTranslator(name) { function serverTranslator(name) {
// eslint-disable-next-line security/detect-non-literal-require
return require(`../dist/${locales[`public/locales/${name}/send.ftl`]}`); return require(`../dist/${locales[`public/locales/${name}/send.ftl`]}`);
} }

View File

@ -4,6 +4,10 @@ const fs = require('fs');
const path = require('path'); const path = require('path');
const { negotiateLanguages } = require('fluent-langneg'); const { negotiateLanguages } = require('fluent-langneg');
const langData = require('cldr-core/supplemental/likelySubtags.json'); 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; const acceptLanguages = /(([a-zA-Z]+(-[a-zA-Z0-9]+){0,2})|\*)(;q=[0-1](\.[0-9]+)?)?/g;
function allLangs() { function allLangs() {