Commit graph

6 commits

Author SHA1 Message Date
Markus Heiser
0abad23daa [upd] migrate .eslintrc.json to eslint.config.mjs
The migration was done by the following steps, firts prepare the node enviroment
an open a bash in this environment::

    $ make clean nvm.nodejs
    ...
    $ ./manage nvm.bash
    $ which npx
    searxng/.nvm/versions/node/v23.5.0/bin/npx

In this environment the migration command from [1] is started::

    $ npx @eslint/migrate-config .eslintrc.json
    Need to install the following packages:
    @eslint/migrate-config@1.3.5
    Migrating .eslintrc.json

    Wrote new config to ./eslint.config.mjs

    You will need to install the following packages to use the new config:
    - globals
    - @eslint/js
    - @eslint/eslintrc

    You can install them using the following command:

    npm install globals @eslint/js @eslint/eslintrc -D

    The following messages were generated during migration:
    - The 'node' environment is used, so switching sourceType to 'commonjs'.

[1] https://eslint.org/docs/latest/use/configure/migration-guide#migrate-your-config-file

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-01-14 15:22:23 +01:00
Markus Heiser
a7f1649190 [fix] remove duplicate key in simple theme ESLint configuration
Partial merge of [PR-1736]

[PR-1736] https://github.com/searxng/searxng/pull/1736

Suggested-by: @FunctionalHacker in [1]
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-03-05 09:12:13 +01:00
Markus Heiser
06730588a6 [mod] SearXNG JavaScript Style Guide (eslint:recommended)
The SearXNG JavaScript Style Guide is a set of eslint rules [1] based on the
eslint:recommended [2] rules.

    "extends": "eslint:recommended"

The additional rules adopted from the JavaScript Standard Style [3][4].

[1] https://eslint.org/docs/rules/
[2] https://github.com/kunalgolani/eslint-config/tree/master/packages/recommended
[3] https://standardjs.com/rules.html#javascript-standard-style
[4] https://github.com/standard/eslint-config-standard/blob/master/.eslintrc.json

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-14 06:50:26 +01:00
Markus Heiser
b07884c958 [fix] Optimize SVG for WEB usage / CSP 'style-src self'
- Replace grunt-contrib-htmlmin by grunt-image [1].

- Activate svgo's [2] convertStyleToAttrs to make the HTML inline SVGs
  compoliant to the CSP policy [3]::

    Content-Security-Policy: style-src self;

[1] https://www.npmjs.com/package/grunt-image
[2] https://github.com/svg/svgo
[3] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src

Closes: https://github.com/searxng/searxng/issues/502

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-15 14:51:55 +01:00
Alexandre Flament
0ee316f3d1 eslint: grunt integration 2021-08-31 12:20:23 +02:00
Markus Heiser
2948a99b6e [mod] simple theme - add ESLint
[1] https://eslint.org/
[2] https://eslint.org/docs/user-guide/configuring/
[3] https://eslint.org/docs/user-guide/command-line-interface

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-08-31 12:20:23 +02:00