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',
'import/no-anonymous-default-export': 'off',
'node/no-unsupported-features/node-builtins': 'warn',
'prefer-exponentiation-operator': 'warn'
'prefer-exponentiation-operator': 'warn',
'node/no-unsupported-features/es-syntax': 'off'
},
overrides: [
// 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 dynamicImportVars from '@rollup/plugin-dynamic-import-vars';
import {terser} from 'rollup-plugin-terser';
import progress from 'rollup-plugin-progress';
// import progress from 'rollup-plugin-progress';
import filesize from 'rollup-plugin-filesize';
// utility function
@ -57,7 +57,7 @@ const config = [{
}
],
plugins: [
progress(),
// progress(),
copy({
targets: [
{
@ -133,7 +133,7 @@ extensionDirs.forEach((extensionDir) => {
}
],
plugins: [
progress(),
// progress(),
url({
include: ['**/*.svg', '**/*.png', '**/*.jpg', '**/*.gif', '**/*.xml'],
limit: 0,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -11,12 +11,10 @@
const loadExtensionTranslation = async function (lang) {
let translationModule;
try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/${lang}.js`);
} catch (_error) {
// eslint-disable-next-line no-console
console.error(`Missing translation (${lang}) - using 'en'`);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
translationModule = await import(`./locale/en.js`);
}
return translationModule.default;
@ -194,7 +192,6 @@ export default {
$('body').addClass('tex2jax_ignore');
try {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
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.
MathJax.Hub.queue.Push(function () {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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