summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.dir-locals.el6
-rw-r--r--searx/static/themes/simple/.eslintrc.json12
-rw-r--r--searx/static/themes/simple/gruntfile.js17
-rw-r--r--searx/static/themes/simple/package.json4
-rw-r--r--searx/templates/__common__/new_issue.html8
-rwxr-xr-xsearx/webapp.py1
6 files changed, 40 insertions, 8 deletions
diff --git a/.dir-locals.el b/.dir-locals.el
index 92ff6788b..b8f7ecc76 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -91,9 +91,9 @@
(js-mode
. ((eval . (progn
(setq-local js-indent-level 2)
- ;; flycheck should use the jshint checker from simple theme
- (setq-local flycheck-javascript-jshint-executable
- (expand-file-name "searx/static/themes/simple/node_modules/.bin/jshint" prj-root))
+ ;; flycheck should use the eslint checker from simple theme
+ (setq-local flycheck-javascript-eslint-executable
+ (expand-file-name "searx/static/themes/simple/node_modules/.bin/eslint" prj-root))
(flycheck-mode)
))))
diff --git a/searx/static/themes/simple/.eslintrc.json b/searx/static/themes/simple/.eslintrc.json
new file mode 100644
index 000000000..f6aed7584
--- /dev/null
+++ b/searx/static/themes/simple/.eslintrc.json
@@ -0,0 +1,12 @@
+{
+ "env": {
+ "browser": true,
+ "es2021": true
+ },
+ "extends": "eslint:recommended",
+ "parserOptions": {
+ "ecmaVersion": 12
+ },
+ "rules": {
+ }
+}
diff --git a/searx/static/themes/simple/gruntfile.js b/searx/static/themes/simple/gruntfile.js
index 7e5ad5466..47e5a962e 100644
--- a/searx/static/themes/simple/gruntfile.js
+++ b/searx/static/themes/simple/gruntfile.js
@@ -9,11 +9,19 @@ module.exports = function(grunt) {
watch: {
scripts: {
files: ['src/**'],
- tasks: ['jshint', 'copy', 'concat', 'uglify', 'less:development', 'less:production']
+ tasks: ['eslint', 'copy', 'concat', 'uglify', 'less:development', 'less:production']
}
},
- jshint: {
- files: ['src/js/main/*.js', 'src/js/head/*.js', '../__common__/js/*.js'],
+ eslint: {
+ options: {
+ configFile: '.eslintrc.json',
+ failOnError: false
+ },
+ target: [
+ 'src/js/main/*.js',
+ 'src/js/head/*.js',
+ '../__common__/js/*.js'
+ ],
},
stylelint: {
options: {
@@ -189,11 +197,12 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-webfont');
grunt.loadNpmTasks('grunt-stylelint');
+ grunt.loadNpmTasks('grunt-eslint');
grunt.registerTask('test', ['jshint']);
grunt.registerTask('default', [
- 'jshint',
+ 'eslint',
'stylelint',
'copy',
'concat',
diff --git a/searx/static/themes/simple/package.json b/searx/static/themes/simple/package.json
index 89e9008be..9ddc66d39 100644
--- a/searx/static/themes/simple/package.json
+++ b/searx/static/themes/simple/package.json
@@ -10,9 +10,10 @@
"grunt-contrib-uglify": "~5.0.1",
"grunt-contrib-watch": "~1.1.0",
"grunt-stylelint": "^0.16.0",
+ "grunt-eslint": "^23.0.0",
"grunt-webfont": "^1.7.2",
"ionicons-npm": "^2.0.1",
- "jslint": "^0.12.1",
+ "eslint": "^7.32.0",
"less": "^4.1.1",
"less-plugin-clean-css": "^1.5.1",
"stylelint": "^13.13.1",
@@ -26,6 +27,7 @@
"scripts": {
"all": "npm install && grunt",
"build": "grunt",
+ "eslint": "grunt eslint",
"watch": "grunt watch",
"webfont": "grunt webfont",
"clean": "rm -Rf node_modules package-lock.json ion.less",
diff --git a/searx/templates/__common__/new_issue.html b/searx/templates/__common__/new_issue.html
index c741a049f..d001df6b5 100644
--- a/searx/templates/__common__/new_issue.html
+++ b/searx/templates/__common__/new_issue.html
@@ -6,6 +6,13 @@
<textarea name="body" class="issue-hide">{{- '' -}}
**Version of SearXNG, commit number if you are using on master branch and stipulate if you forked SearXNG**
+{% if searx_git_url and searx_git_url != 'unknow' %}
+Repository: {{ searx_git_url }}
+Branch: {{ searx_git_branch }}
+Version: {{ searx_version }}
+<!-- Check if these values are correct -->
+
+{% else %}
<!-- If you are running on master branch using git execute this command
in order to fetch the latest commit ID:
```
@@ -17,6 +24,7 @@ and check for the version after "Powered by SearXNG"
Please also stipulate if you are using a forked version of SearxNG and
include a link to the fork source code.
-->
+{% endif %}
**How did you install SearXNG?**
<!-- Did you install SearXNG using the official wiki or using searx-docker
or manually by executing the searx/webapp.py file? -->
diff --git a/searx/webapp.py b/searx/webapp.py
index 3b7e0f972..b935424f1 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -1191,6 +1191,7 @@ def stats():
engine_stats = engine_stats,
engine_reliabilities = engine_reliabilities,
selected_engine_name = selected_engine_name,
+ searx_git_branch = GIT_BRANCH,
)