disable eslint rule for unsupported feature

master
jfh 2020-09-19 23:59:42 +02:00
parent 5447d05e8c
commit 5583488181
44 changed files with 26 additions and 66 deletions

View File

@ -122,7 +122,8 @@ module.exports = {
'consistent-this': 'off', 'consistent-this': 'off',
'import/no-anonymous-default-export': 'off', 'import/no-anonymous-default-export': 'off',
'node/no-unsupported-features/node-builtins': 'warn', 'node/no-unsupported-features/node-builtins': 'warn',
'prefer-exponentiation-operator': 'warn' 'prefer-exponentiation-operator': 'warn',
'node/no-unsupported-features/es-syntax': 'off'
}, },
overrides: [ overrides: [
// Locales have no need for importing outside of SVG-Edit // Locales have no need for importing outside of SVG-Edit

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@ import nodePolyfills from 'rollup-plugin-node-polyfills';
import url from '@rollup/plugin-url'; // for XML/SVG files import url from '@rollup/plugin-url'; // for XML/SVG files
import dynamicImportVars from '@rollup/plugin-dynamic-import-vars'; import dynamicImportVars from '@rollup/plugin-dynamic-import-vars';
import {terser} from 'rollup-plugin-terser'; import {terser} from 'rollup-plugin-terser';
import progress from 'rollup-plugin-progress'; // import progress from 'rollup-plugin-progress';
import filesize from 'rollup-plugin-filesize'; import filesize from 'rollup-plugin-filesize';
// utility function // utility function
@ -57,7 +57,7 @@ const config = [{
} }
], ],
plugins: [ plugins: [
progress(), // progress(),
copy({ copy({
targets: [ targets: [
{ {
@ -133,7 +133,7 @@ extensionDirs.forEach((extensionDir) => {
} }
], ],
plugins: [ plugins: [
progress(), // progress(),
url({ url({
include: ['**/*.svg', '**/*.png', '**/*.jpg', '**/*.gif', '**/*.xml'], include: ['**/*.svg', '**/*.png', '**/*.jpg', '**/*.gif', '**/*.xml'],
limit: 0, limit: 0,

View File

@ -10,12 +10,10 @@
const loadExtensionTranslation = async function (lang) { const loadExtensionTranslation = async function (lang) {
let translationModule; let translationModule;
try { try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/${lang}.js`); translationModule = await import(`./locale/${lang}.js`);
} catch (_error) { } catch (_error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error(`Missing translation (${lang}) - using 'en'`); console.error(`Missing translation (${lang}) - using 'en'`);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/en.js`); translationModule = await import(`./locale/en.js`);
} }
return translationModule.default; return translationModule.default;

View File

@ -10,12 +10,10 @@
const loadExtensionTranslation = async function (lang) { const loadExtensionTranslation = async function (lang) {
let translationModule; let translationModule;
try { try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/${lang}.js`); translationModule = await import(`./locale/${lang}.js`);
} catch (_error) { } catch (_error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error(`Missing translation (${lang}) - using 'en'`); console.error(`Missing translation (${lang}) - using 'en'`);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/en.js`); translationModule = await import(`./locale/en.js`);
} }
return translationModule.default; return translationModule.default;

View File

@ -10,12 +10,10 @@
const loadExtensionTranslation = async function (lang) { const loadExtensionTranslation = async function (lang) {
let translationModule; let translationModule;
try { try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/${lang}.js`); translationModule = await import(`./locale/${lang}.js`);
} catch (_error) { } catch (_error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error(`Missing translation (${lang}) - using 'en'`); console.error(`Missing translation (${lang}) - using 'en'`);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/en.js`); translationModule = await import(`./locale/en.js`);
} }
return translationModule.default; return translationModule.default;

View File

@ -10,12 +10,10 @@
const loadExtensionTranslation = async function (lang) { const loadExtensionTranslation = async function (lang) {
let translationModule; let translationModule;
try { try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/${lang}.js`); translationModule = await import(`./locale/${lang}.js`);
} catch (_error) { } catch (_error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error(`Missing translation (${lang}) - using 'en'`); console.error(`Missing translation (${lang}) - using 'en'`);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/en.js`); translationModule = await import(`./locale/en.js`);
} }
return translationModule.default; return translationModule.default;

View File

@ -10,12 +10,10 @@
const loadExtensionTranslation = async function (lang) { const loadExtensionTranslation = async function (lang) {
let translationModule; let translationModule;
try { try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/${lang}.js`); translationModule = await import(`./locale/${lang}.js`);
} catch (_error) { } catch (_error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error(`Missing translation (${lang}) - using 'en'`); console.error(`Missing translation (${lang}) - using 'en'`);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/en.js`); translationModule = await import(`./locale/en.js`);
} }
return translationModule.default; return translationModule.default;

View File

@ -10,12 +10,10 @@
const loadExtensionTranslation = async function (lang) { const loadExtensionTranslation = async function (lang) {
let translationModule; let translationModule;
try { try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/${lang}.js`); translationModule = await import(`./locale/${lang}.js`);
} catch (_error) { } catch (_error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error(`Missing translation (${lang}) - using 'en'`); console.error(`Missing translation (${lang}) - using 'en'`);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/en.js`); translationModule = await import(`./locale/en.js`);
} }
return translationModule.default; return translationModule.default;

View File

@ -16,12 +16,10 @@
const loadExtensionTranslation = async function (lang) { const loadExtensionTranslation = async function (lang) {
let translationModule; let translationModule;
try { try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/${lang}.js`); translationModule = await import(`./locale/${lang}.js`);
} catch (_error) { } catch (_error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error(`Missing translation (${lang}) - using 'en'`); console.error(`Missing translation (${lang}) - using 'en'`);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/en.js`); translationModule = await import(`./locale/en.js`);
} }
return translationModule.default; return translationModule.default;

View File

@ -10,12 +10,10 @@
const loadExtensionTranslation = async function (lang) { const loadExtensionTranslation = async function (lang) {
let translationModule; let translationModule;
try { try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/${lang}.js`); translationModule = await import(`./locale/${lang}.js`);
} catch (_error) { } catch (_error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error(`Missing translation (${lang}) - using 'en'`); console.error(`Missing translation (${lang}) - using 'en'`);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/en.js`); translationModule = await import(`./locale/en.js`);
} }
return translationModule.default; return translationModule.default;

View File

@ -32,12 +32,10 @@
const loadExtensionTranslation = async function (lang) { const loadExtensionTranslation = async function (lang) {
let translationModule; let translationModule;
try { try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/${lang}.js`); translationModule = await import(`./locale/${lang}.js`);
} catch (_error) { } catch (_error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error(`Missing translation (${lang}) - using 'en'`); console.error(`Missing translation (${lang}) - using 'en'`);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/en.js`); translationModule = await import(`./locale/en.js`);
} }
return translationModule.default; return translationModule.default;

View File

@ -11,12 +11,10 @@
const loadExtensionTranslation = async function (lang) { const loadExtensionTranslation = async function (lang) {
let translationModule; let translationModule;
try { try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/${lang}.js`); translationModule = await import(`./locale/${lang}.js`);
} catch (_error) { } catch (_error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error(`Missing translation (${lang}) - using 'en'`); console.error(`Missing translation (${lang}) - using 'en'`);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/en.js`); translationModule = await import(`./locale/en.js`);
} }
return translationModule.default; return translationModule.default;
@ -194,7 +192,6 @@ export default {
$('body').addClass('tex2jax_ignore'); $('body').addClass('tex2jax_ignore');
try { try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
await import('./mathjax/MathJax.min.js'); // ?config=TeX-AMS-MML_SVG.js'); await import('./mathjax/MathJax.min.js'); // ?config=TeX-AMS-MML_SVG.js');
// When MathJax is loaded get the div where the math will be rendered. // When MathJax is loaded get the div where the math will be rendered.
MathJax.Hub.queue.Push(function () { MathJax.Hub.queue.Push(function () {

View File

@ -13,12 +13,10 @@
const loadExtensionTranslation = async function (lang) { const loadExtensionTranslation = async function (lang) {
let translationModule; let translationModule;
try { try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/${lang}.js`); translationModule = await import(`./locale/${lang}.js`);
} catch (_error) { } catch (_error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error(`Missing translation (${lang}) - using 'en'`); console.error(`Missing translation (${lang}) - using 'en'`);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/en.js`); translationModule = await import(`./locale/en.js`);
} }
return translationModule.default; return translationModule.default;

View File

@ -9,12 +9,10 @@
const loadExtensionTranslation = async function (lang) { const loadExtensionTranslation = async function (lang) {
let translationModule; let translationModule;
try { try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/${lang}.js`); translationModule = await import(`./locale/${lang}.js`);
} catch (_error) { } catch (_error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error(`Missing translation (${lang}) - using 'en'`); console.error(`Missing translation (${lang}) - using 'en'`);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/en.js`); translationModule = await import(`./locale/en.js`);
} }
return translationModule.default; return translationModule.default;

View File

@ -9,12 +9,10 @@
const loadExtensionTranslation = async function (lang) { const loadExtensionTranslation = async function (lang) {
let translationModule; let translationModule;
try { try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/${lang}.js`); translationModule = await import(`./locale/${lang}.js`);
} catch (_error) { } catch (_error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error(`Missing translation (${lang}) - using 'en'`); console.error(`Missing translation (${lang}) - using 'en'`);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/en.js`); translationModule = await import(`./locale/en.js`);
} }
return translationModule.default; return translationModule.default;

View File

@ -12,12 +12,10 @@ import {Canvg as canvg} from 'canvg';
const loadExtensionTranslation = async function (lang) { const loadExtensionTranslation = async function (lang) {
let translationModule; let translationModule;
try { try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/${lang}.js`); translationModule = await import(`./locale/${lang}.js`);
} catch (_error) { } catch (_error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error(`Missing translation (${lang}) - using 'en'`); console.error(`Missing translation (${lang}) - using 'en'`);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/en.js`); translationModule = await import(`./locale/en.js`);
} }
return translationModule.default; return translationModule.default;

View File

@ -11,12 +11,10 @@ import {Canvg as canvg} from 'canvg';
const loadExtensionTranslation = async function (lang) { const loadExtensionTranslation = async function (lang) {
let translationModule; let translationModule;
try { try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/${lang}.js`); translationModule = await import(`./locale/${lang}.js`);
} catch (_error) { } catch (_error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error(`Missing translation (${lang}) - using 'en'`); console.error(`Missing translation (${lang}) - using 'en'`);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/en.js`); translationModule = await import(`./locale/en.js`);
} }
return translationModule.default; return translationModule.default;

View File

@ -10,12 +10,10 @@
const loadExtensionTranslation = async function (lang) { const loadExtensionTranslation = async function (lang) {
let translationModule; let translationModule;
try { try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/${lang}.js`); translationModule = await import(`./locale/${lang}.js`);
} catch (_error) { } catch (_error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error(`Missing translation (${lang}) - using 'en'`); console.error(`Missing translation (${lang}) - using 'en'`);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/en.js`); translationModule = await import(`./locale/en.js`);
} }
return translationModule.default; return translationModule.default;

View File

@ -9,12 +9,10 @@
const loadExtensionTranslation = async function (lang) { const loadExtensionTranslation = async function (lang) {
let translationModule; let translationModule;
try { try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/${lang}.js`); translationModule = await import(`./locale/${lang}.js`);
} catch (_error) { } catch (_error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error(`Missing translation (${lang}) - using 'en'`); console.error(`Missing translation (${lang}) - using 'en'`);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/en.js`); translationModule = await import(`./locale/en.js`);
} }
return translationModule.default; return translationModule.default;

View File

@ -22,12 +22,10 @@
const loadExtensionTranslation = async function (lang) { const loadExtensionTranslation = async function (lang) {
let translationModule; let translationModule;
try { try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/${lang}.js`); translationModule = await import(`./locale/${lang}.js`);
} catch (_error) { } catch (_error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error(`Missing translation (${lang}) - using 'en'`); console.error(`Missing translation (${lang}) - using 'en'`);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/en.js`); translationModule = await import(`./locale/en.js`);
} }
return translationModule.default; return translationModule.default;

View File

@ -9,12 +9,10 @@
const loadExtensionTranslation = async function (lang) { const loadExtensionTranslation = async function (lang) {
let translationModule; let translationModule;
try { try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/${lang}.js`); translationModule = await import(`./locale/${lang}.js`);
} catch (_error) { } catch (_error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error(`Missing translation (${lang}) - using 'en'`); console.error(`Missing translation (${lang}) - using 'en'`);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/en.js`); translationModule = await import(`./locale/en.js`);
} }
return translationModule.default; return translationModule.default;

View File

@ -360,7 +360,6 @@ export const putLocale = async function (givenParam, goodLangs) {
if (!goodLangs.includes(langParam) && langParam !== 'test') { if (!goodLangs.includes(langParam) && langParam !== 'test') {
langParam = 'en'; langParam = 'en';
} }
// eslint-disable-next-line node/no-unsupported-features/es-syntax
const module = await import(`./locale/lang.${langParam}.js`); const module = await import(`./locale/lang.${langParam}.js`);
return readLang(module.default); return readLang(module.default);
}; };

View File

@ -784,7 +784,6 @@ editor.init = function () {
* @type {module:SVGEditor.ExtensionObject} * @type {module:SVGEditor.ExtensionObject}
*/ */
const url = `${curConfig.extPath}${extname}/${extname}.js`; const url = `${curConfig.extPath}${extname}/${extname}.js`;
// eslint-disable-next-line node/no-unsupported-features/es-syntax
const imported = await import(url); const imported = await import(url);
const {name = extname, init} = imported.default; const {name = extname, init} = imported.default;
return editor.addExtension(name, (init && init.bind(editor)), {$, langParam}); return editor.addExtension(name, (init && init.bind(editor)), {$, langParam});