forked from Icycoide/searxng
[fix] eslint --fix
automatically fix some of the problems reported by eslint rules:: $ ./manage nvm.bash nvm-env$ npm --prefix searx/static/themes/simple run eslint-fix Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
32cf24a272
commit
34f5e9c7a3
10 changed files with 201 additions and 201 deletions
|
@ -1,6 +1,6 @@
|
|||
/*jshint esversion: 6 */
|
||||
/* jshint esversion: 6 */
|
||||
|
||||
module.exports = function(grunt) {
|
||||
module.exports = function (grunt) {
|
||||
|
||||
const eachAsync = require('each-async');
|
||||
|
||||
|
@ -113,7 +113,7 @@ module.exports = function(grunt) {
|
|||
new (require('less-plugin-clean-css'))()
|
||||
],
|
||||
sourceMap: true,
|
||||
sourceMapURL: (name) => { const s = name.split('/'); return s[s.length - 1] + '.map';},
|
||||
sourceMapURL: (name) => { const s = name.split('/'); return s[s.length - 1] + '.map'; },
|
||||
outputSourceFiles: true,
|
||||
},
|
||||
files: {
|
||||
|
@ -178,37 +178,37 @@ module.exports = function(grunt) {
|
|||
},
|
||||
});
|
||||
|
||||
grunt.registerMultiTask('svg2jinja', 'Create Jinja2 macro', function() {
|
||||
grunt.registerMultiTask('svg2jinja', 'Create Jinja2 macro', function () {
|
||||
const ejs = require('ejs'), svgo = require('svgo');
|
||||
const icons = {}
|
||||
for(const iconName in this.data.src) {
|
||||
const svgFileName = this.data.src[iconName];
|
||||
try {
|
||||
const svgContent = grunt.file.read(svgFileName, { encoding: 'utf8' })
|
||||
const svgoResult = svgo.optimize(svgContent, {
|
||||
path: svgFileName,
|
||||
multipass: true,
|
||||
plugins: [
|
||||
{
|
||||
name: "removeTitle",
|
||||
},
|
||||
{
|
||||
name: "removeXMLNS",
|
||||
},
|
||||
{
|
||||
name: "addAttributesToSVGElement",
|
||||
params: {
|
||||
attributes: [
|
||||
{ "aria-hidden": "true" }
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
icons[iconName] = svgoResult.data.replace("'", "\\'");
|
||||
} catch (err) {
|
||||
grunt.log.error(err);
|
||||
}
|
||||
for (const iconName in this.data.src) {
|
||||
const svgFileName = this.data.src[iconName];
|
||||
try {
|
||||
const svgContent = grunt.file.read(svgFileName, { encoding: 'utf8' })
|
||||
const svgoResult = svgo.optimize(svgContent, {
|
||||
path: svgFileName,
|
||||
multipass: true,
|
||||
plugins: [
|
||||
{
|
||||
name: "removeTitle",
|
||||
},
|
||||
{
|
||||
name: "removeXMLNS",
|
||||
},
|
||||
{
|
||||
name: "addAttributesToSVGElement",
|
||||
params: {
|
||||
attributes: [
|
||||
{ "aria-hidden": "true" }
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
icons[iconName] = svgoResult.data.replace("'", "\\'");
|
||||
} catch (err) {
|
||||
grunt.log.error(err);
|
||||
}
|
||||
}
|
||||
const template = `{# this file was generated by searx/static/themes/simple/gruntfile.js #}
|
||||
{%- set icons = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue