diff --git a/.svgo.config.js b/.svgo.config.js index 9f22832..9743e64 100644 --- a/.svgo.config.js +++ b/.svgo.config.js @@ -1,54 +1,23 @@ 'use strict'; -/** - * SVGO Configuration - * Compatible to v2.4.0+ - * Recommended options from: - * https://www.mediawiki.org/wiki/Manual:Coding_conventions/SVG#Exemplified_safe_configuration - */ + +// https://www.mediawiki.org/wiki/Manual:Coding_conventions/SVG#Exemplified_safe_configuration module.exports = { + js2svg: { + eol: 'lf', + finalNewline: false, + indent: '\t' + }, + multipass: true, plugins: [ { - // Set of built-in plugins enabled by default. name: 'preset-default', params: { overrides: { - removeDesc: false, - removeTitle: false, - removeViewBox: false, - // If the SVG doesn't start with an XML declaration, - // then its MIME type will be detected as "text/plain" - // rather than "image/svg+xml" by libmagic and, consequently, - // MediaWiki's CSSMin CSS minifier. - // libmagic's default database currently requires that - // SVGs contain an XML declaration: - // https://github.com/threatstack/libmagic/blob/master/magic/Magdir/sgml#L5 - removeXMLProcInst: false, // https://phabricator.wikimedia.org/T327446 - convertPathData: false, // https://github.com/svg/svgo/issues/880 https://github.com/svg/svgo/issues/1487 - removeMetadata: false, // Copyright-Violation - removeHiddenElems: false, // source for converted text2path - removeUnknownsAndDefaults: false, // removes Flow-Text: https://commons.wikimedia.org/wiki/User:JoKalliauer/RepairFlowRoot - cleanupNumericValues: false, // https://github.com/svg/svgo/issues/1080 - minifyStyles: false, // https://github.com/svg/svgo/issues/888 - removeComments: false, // reduces readability - removeEditorsNSData: false, // https://github.com/svg/svgo/issues/1096 - collapseGroups: false, // https://github.com/svg/svgo/issues/1057 - removeEmptyContainers: false, // https://github.com/svg/svgo/issues/1194 https://github.com/svg/svgo/issues/1618 - convertTransform: false, // https://github.com/svg/svgo/issues/988 https://github.com/svg/svgo/issues/1021 - inlineStyles: false // https://github.com/svg/svgo/issues/1486 + removeViewBox: false } } }, 'removeRasterImages', 'sortAttrs' - ], - // Set whitespace according to Wikimedia Coding Conventions. - // @see https://github.com/svg/svgo/blob/v2.8.0/lib/stringifier.js#L41 for available options. - js2svg: { - eol: 'lf', - finalNewline: true, - // Configure the indent to tabs (default 4 spaces) used by '--pretty' here. - indent: '\t', - pretty: true - }, - multipass: true + ] }; diff --git a/resources/.eslintrc.json b/resources/.eslintrc.json index d8e83d4..1512a2c 100644 --- a/resources/.eslintrc.json +++ b/resources/.eslintrc.json @@ -3,7 +3,8 @@ "extends": [ "wikimedia/client-common", "wikimedia/language/es2022", - "wikimedia/mediawiki" + "wikimedia/mediawiki", + "wikimedia/jquery" ], "rules": { "no-jquery/no-global-selector": "off",