- Linting: Fix .eslintrc.js overrides to point to new paths (and avoid need for inline disabling--except import/no-namespace)

master
Brett Zamir 2020-07-18 18:31:34 +08:00
parent e560784961
commit 0fc64b4912
138 changed files with 18257 additions and 19842 deletions

View File

@ -32,7 +32,7 @@ module.exports = {
// Locales have no need for importing outside of SVG-Edit
{
files: [
'editor/locale/lang.*.js', 'editor/extensions/ext-locale/**',
'src/editor/locale/lang.*.js', 'src/editor/extensions/ext-locale/**',
'docs/tutorials/ExtensionDocs.md'
],
rules: {
@ -42,18 +42,20 @@ module.exports = {
// These browser files don't do importing or requiring
{
files: [
'editor/svgpathseg.js', 'editor/touch.js', 'editor/typedefs.js',
'editor/redirect-on-no-module-support.js',
'editor/extensions/imagelib/index.js',
'editor/external/dom-polyfill/dom-polyfill.js',
'screencasts/svgopen2010/script.js'
'src/editor/svgpathseg.js',
'src/editor/touch.js',
'src/editor/typedefs.js',
'src/editor/redirect-on-no-module-support.js',
'src/editor/extensions/imagelib/index.js',
'src/editor/external/dom-polyfill/dom-polyfill.js',
'docs/screencasts/svgopen2010/script.js'
],
rules: {
'import/unambiguous': ['off']
}
},
{
files: ['**/*.html', 'screencasts/**'],
files: ['**/*.html', 'docs/screencasts/**'],
globals: {
root: 'off'
},
@ -119,7 +121,7 @@ module.exports = {
// Dis-apply Node rules mistakenly giving errors with browser files,
// and treating Node global `root` as being present for shadowing
{
files: ['editor/**'],
files: ['src/editor/**'],
globals: {
root: 'off'
},
@ -184,7 +186,7 @@ module.exports = {
// descriptive `svgEditor`; they also have no need for importing outside
// of SVG-Edit
{
files: ['editor/extensions/**'],
files: ['src/editor/extensions/**'],
settings: {
polyfills: [
'console',
@ -244,7 +246,7 @@ module.exports = {
},
{
// Should probably have as external, but should still check
files: ['canvg/rgbcolor.js'],
files: ['src/editor/canvg/rgbcolor.js'],
settings: {
polyfills: [
'Number.isNaN',

View File

@ -101,7 +101,6 @@ iframe[0].src = frameBase + framePath +
: ''); // Append arguments to this file onto the iframe
iframe[0].addEventListener('load', function () {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
svgCanvas = new EmbeddedSVGEdit(frame, [new URL(frameBase).origin]);
// Hide main button, as we will be controlling new, load, save, etc. from the host document
let doc;

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/**
* @file ext-arrows.js
*
@ -12,7 +11,6 @@ export default {
name: 'arrows',
async init (S) {
const strings = await S.importLocale();
// eslint-disable-next-line consistent-this
const svgEditor = this;
const svgCanvas = svgEditor.canvas;
const // {svgcontent} = S,

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/**
* @file ext-closepath.js
*
@ -15,7 +14,6 @@ export default {
name: 'closepath',
async init ({importLocale, $}) {
const strings = await importLocale();
// eslint-disable-next-line consistent-this
const svgEditor = this;
let selElems;
const updateButton = function (path) {

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/* eslint-disable unicorn/no-fn-reference-in-iterator */
/**
* @file ext-connector.js
@ -12,7 +11,6 @@
export default {
name: 'connector',
async init (S) {
// eslint-disable-next-line consistent-this
const svgEditor = this;
const svgCanvas = svgEditor.canvas;
const {getElem} = svgCanvas;

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/**
* @file ext-eyedropper.js
*
@ -12,7 +11,6 @@ export default {
name: 'eyedropper',
async init (S) {
const strings = await S.importLocale();
// eslint-disable-next-line consistent-this
const svgEditor = this;
const {$, ChangeElementCommand} = S, // , svgcontent,
// svgdoc = S.svgroot.parentNode.ownerDocument,

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/**
* @file ext-foreignobject.js
*
@ -11,7 +10,6 @@
export default {
name: 'foreignobject',
async init (S) {
// eslint-disable-next-line consistent-this
const svgEditor = this;
const {$, text2xml, NS, importLocale} = S;
const svgCanvas = svgEditor.canvas;

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/**
* @file ext-grid.js
*
@ -12,7 +11,6 @@ export default {
name: 'grid',
async init ({$, NS, getTypeMap, importLocale}) {
const strings = await importLocale();
// eslint-disable-next-line consistent-this
const svgEditor = this;
const svgCanvas = svgEditor.canvas;
const svgdoc = document.getElementById('svgcanvas').ownerDocument,

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/**
* @file ext-helloworld.js
*
@ -18,7 +17,6 @@ export default {
async init ({$, importLocale}) {
// See `/editor/extensions/ext-locale/helloworld/`
const strings = await importLocale();
// eslint-disable-next-line consistent-this
const svgEditor = this;
const svgCanvas = svgEditor.canvas;
return {

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/**
* @file ext-imagelib.js
*
@ -16,7 +15,6 @@ export default {
!window.svgEditor ||
window.svgEditor.modules !== false;
// eslint-disable-next-line consistent-this
const svgEditor = this;
const {uiStrings, canvas: svgCanvas, curConfig: {extIconsPath}} = svgEditor;
@ -39,7 +37,6 @@ export default {
});
const allowedImageLibOrigins = imagelibStrings.imgLibs.map(({url}) => {
try {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
return new URL(url).origin;
} catch (err) {
return location.origin;

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: 'Arrows',
langList: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: 'Arrows',
langList: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: '箭头',
langList: [

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
name: 'ClosePath',
buttons: [

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
name: '闭合路径',
buttons: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: 'Connector',
langList: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: 'Connector',
langList: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: '连接器',
langList: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: 'eyedropper',
buttons: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: '滴管',
buttons: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: 'foreignObject',
buttons: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: '外部对象',
buttons: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: 'View Grid',
buttons: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: '网格视图',
buttons: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: 'Hello World',
text: 'Hello World!\n\nYou clicked here: {x}, {y}',

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: 'Hello World',
text: 'Hello World!\n\n 请点击: {x}, {y}',

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
select_lib: 'Select an image library',
show_list: 'Show library list',

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
select_lib: 'Select an image library',
show_list: 'Show library list',

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
select_lib: "Choisir une bibliothèque d'images",
show_list: 'show_list',

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
select_lib: 'Select an image library',
show_list: 'Show library list',

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
select_lib: 'Select an image library',
show_list: 'Show library list',

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
select_lib: 'Select an image library',
show_list: 'Show library list',

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
select_lib: 'Select an image library',
show_list: 'Show library list',

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
select_lib: 'Select an image library',
show_list: 'Show library list',

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
select_lib: 'Select an image library',
show_list: 'Show library list',

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: 'Markers',
langList: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: '标记',
langList: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: 'MathJax',
buttons: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: '数学',
buttons: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: 'Extension Panning',
buttons: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: '移动',
buttons: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: 'placemark',
langList: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: 'polygon',
buttons: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: '多边形',
buttons: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
saved: 'Saved! Return to Item View!',
hiddenframe: 'Moinsave frame to store hidden values'

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
saved: '已保存! 返回视图!',
hiddenframe: 'Moinsave frame to store hidden values'

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
uploading: 'Uploading...',
hiddenframe: 'Opensave frame to store hidden values'

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
uploading: '正在上传...',
hiddenframe: 'Opensave frame to store hidden values'

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
loading: 'Loading...',
categories: {

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
loading: 'Loading...',
categories: {

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
loading: '正在加载...',
categories: {

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: 'star',
buttons: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: '星形',
buttons: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
message: 'Standardmäßig kann SVG-Edit Ihre Editor-Einstellungen ' +
'und die SVG-Inhalte lokal auf Ihrem Gerät abspeichern. So brauchen Sie ' +

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
message: 'By default and where supported, SVG-Edit can store your editor ' +
'preferences and SVG content locally on your machine so you do not ' +

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
message: "Par défaut et si supporté, SVG-Edit peut stocker les préférences de l'éditeur " +
"et le contenu SVG localement sur votre machine de sorte que vous n'ayez pas besoin de les " +

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
message: '默认情况下, SVG-Edit 在本地保存配置参数和画布内容. 如果基于隐私考虑, ' +
'您可以勾选以下选项修改配置.',

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: 'WebAppFind',
buttons: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
export default {
name: 'WebAppFind',
buttons: [

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/**
* @file ext-markers.js
*
@ -33,7 +32,6 @@ export default {
name: 'markers',
async init (S) {
const strings = await S.importLocale();
// eslint-disable-next-line consistent-this
const svgEditor = this;
const {$} = S;
const svgCanvas = svgEditor.canvas;

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/* globals MathJax */
/**
* @file ext-mathjax.js
@ -15,7 +14,6 @@ export default {
name: 'mathjax',
async init ({$, importLocale}) {
const strings = await importLocale();
// eslint-disable-next-line consistent-this
const svgEditor = this;
const svgCanvas = svgEditor.canvas;

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/**
* @file ext-overview_window.js
*

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/**
* @file ext-panning.js
*
@ -14,7 +13,6 @@ export default {
name: 'panning',
async init ({importLocale}) {
const strings = await importLocale();
// eslint-disable-next-line consistent-this
const svgEditor = this;
const svgCanvas = svgEditor.canvas;
const buttons = [{

View File

@ -1,11 +1,9 @@
/* eslint-disable import/no-anonymous-default-export */
// TODO: Might add support for "exportImage" custom
// handler as in "ext-server_opensave.js" (and in savefile.php)
export default {
name: 'php_savefile',
init ({$}) {
// eslint-disable-next-line consistent-this
const svgEditor = this;
const {
curConfig: {extPath},

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/**
* @file ext-placemark.js
*
@ -9,7 +8,6 @@
export default {
name: 'placemark',
async init (S) {
// eslint-disable-next-line consistent-this
const svgEditor = this;
const svgCanvas = svgEditor.canvas;
const addElem = svgCanvas.addSVGElementFromJson;

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/**
* @file ext-polygon.js
*
@ -9,7 +8,6 @@
export default {
name: 'polygon',
async init (S) {
// eslint-disable-next-line consistent-this
const svgEditor = this;
const svgCanvas = svgEditor.canvas;
const {$, importLocale} = S, // {svgcontent}

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/**
* @file ext-server_moinsave.js
*
@ -14,7 +13,6 @@ export default {
name: 'server_moinsave',
async init ({$, encode64, importLocale}) {
const strings = await importLocale();
// eslint-disable-next-line consistent-this
const svgEditor = this;
const svgCanvas = svgEditor.canvas;
const saveSvgAction = '/+modify';
@ -30,7 +28,6 @@ export default {
svgEditor.setCustomHandlers({
async save (win, data) {
const svg = '<?xml version="1.0"?>\n' + data;
// eslint-disable-next-line node/no-unsupported-features/node-builtins
const {pathname} = new URL(location);
const name = pathname.replace(/\/+get\//, '');
const svgData = encode64(svg);

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/**
* @file ext-server_opensave.js
*
@ -13,7 +12,6 @@ export default {
name: 'server_opensave',
async init ({$, decode64, encode64, importLocale}) {
const strings = await importLocale();
// eslint-disable-next-line consistent-this
const svgEditor = this;
const {
curConfig: {

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/**
* @file ext-shapes.js
*
@ -11,7 +10,6 @@ export default {
name: 'shapes',
async init ({$, importLocale}) {
const strings = await importLocale();
// eslint-disable-next-line consistent-this
const svgEditor = this;
const canv = svgEditor.canvas;
const svgroot = canv.getRootElem();

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/**
* @file ext-star.js
*
@ -9,7 +8,6 @@
export default {
name: 'star',
async init (S) {
// eslint-disable-next-line consistent-this
const svgEditor = this;
const svgCanvas = svgEditor.canvas;

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/**
* @file ext-storage.js
*
@ -23,7 +22,6 @@
export default {
name: 'storage',
init ({$}) {
// eslint-disable-next-line consistent-this
const svgEditor = this;
const svgCanvas = svgEditor.canvas;
@ -168,7 +166,6 @@ export default {
return {
name: 'storage',
async langReady ({importLocale}) {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
const storagePrompt = new URL(top.location).searchParams.get('storagePrompt');
const confirmSetStorage = await importLocale();

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/**
* Depends on Firefox add-on and executables from
* {@link https://github.com/brettz9/webappfind}.
@ -11,7 +10,6 @@ export default {
name: 'webappfind',
async init ({importLocale, $}) {
const strings = await importLocale();
// eslint-disable-next-line consistent-this
const svgEditor = this;
const saveMessage = 'save',
readMessage = 'read',

View File

@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/**
* Should not be needed for same domain control (just call via child frame),
* but an API common for cross-domain and same domain use can be found
@ -7,7 +6,6 @@
export default {
name: 'xdomain-messaging',
init () {
// eslint-disable-next-line consistent-this
const svgEditor = this;
const svgCanvas = svgEditor.canvas;
try {

View File

@ -1,4 +1,3 @@
/* eslint-disable import/unambiguous */
/* globals jQuery */
const $ = jQuery;
$('a').click(function () {

View File

@ -248,7 +248,6 @@ jml('div', [
id: 'openclipart',
$custom: {
async $submit () {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
const url = new URL(baseAPIURL);
[
'query', 'sort', 'amount', 'page', 'byids'

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'af',
dir: 'ltr',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'ar',
dir: 'rtl',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'az',
dir: 'ltr',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'be',
dir: 'ltr',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'bg',
dir: 'ltr',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'ca',
dir: 'ltr',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'cs',
dir: 'ltr',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'cy',
dir: 'ltr',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'da',
dir: 'ltr',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'de',
dir: 'ltr',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'el',
dir: 'ltr',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'en',
dir: 'ltr',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'es',
dir: 'ltr',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'et',
dir: 'ltr',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'fa',
dir: 'rtl',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'fi',
dir: 'ltr',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'fr',
dir: 'ltr',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'fy',
dir: 'ltr',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'ga',
dir: 'ltr',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'gl',
dir: 'ltr',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'he',
dir: 'rtl',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'hi',
dir: 'ltr',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'hr',
dir: 'ltr',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'hu',
dir: 'ltr',

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
lang: 'hy',
dir: 'ltr',

Some files were not shown because too many files have changed in this diff Show More