diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2021-12-14 07:31:58 +0100 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2021-12-14 07:31:58 +0100 |
commit | 34f5e9c7a305d20bbebe907d3d1032ca04259537 (patch) | |
tree | 7ed2b6395ae251279183ae2a5afffc53a5fcf059 /searx/static/themes/simple/gruntfile.js | |
parent | 32cf24a2727c2db5b7b7187a355fd20382b5e40c (diff) | |
download | searxng-34f5e9c7a305d20bbebe907d3d1032ca04259537.tar.gz searxng-34f5e9c7a305d20bbebe907d3d1032ca04259537.zip |
[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>
Diffstat (limited to 'searx/static/themes/simple/gruntfile.js')
-rw-r--r-- | searx/static/themes/simple/gruntfile.js | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/searx/static/themes/simple/gruntfile.js b/searx/static/themes/simple/gruntfile.js index 928b92d82..aac1217ea 100644 --- a/searx/static/themes/simple/gruntfile.js +++ b/searx/static/themes/simple/gruntfile.js @@ -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 = { |