From a3f58a3a3d099cf6c5dfd533f76d97623146e079 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Thu, 24 Jun 2021 12:12:13 +0200 Subject: [PATCH] [emacs] .dir-locals.el: add setup for js-mode - move jshint option from gruntfile to .jshintrc - remove trailing-whitespace from gruntfile and - add jshint esversion: 6 - .dir-locals.el add locals for js-mode to use JSHint from the simple theme Signed-off-by: Markus Heiser --- .dir-locals.el | 9 +++++++++ searx/static/themes/simple/.jshintrc | 8 ++++++++ searx/static/themes/simple/gruntfile.js | 14 +++----------- 3 files changed, 20 insertions(+), 11 deletions(-) create mode 100644 searx/static/themes/simple/.jshintrc diff --git a/.dir-locals.el b/.dir-locals.el index fb5afe7b9..92ff6788b 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -88,6 +88,15 @@ (setq-local js-indent-level 2) (flycheck-checker . json-python-json))))) + (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-mode) + )))) + (python-mode . ((eval . (progn diff --git a/searx/static/themes/simple/.jshintrc b/searx/static/themes/simple/.jshintrc new file mode 100644 index 000000000..ba7bc2965 --- /dev/null +++ b/searx/static/themes/simple/.jshintrc @@ -0,0 +1,8 @@ +{ + "proto": true, + "globals": { + "browser": true, + "jQuery": false, + "devel": true + } +} diff --git a/searx/static/themes/simple/gruntfile.js b/searx/static/themes/simple/gruntfile.js index 956626148..130f406d9 100644 --- a/searx/static/themes/simple/gruntfile.js +++ b/searx/static/themes/simple/gruntfile.js @@ -1,3 +1,5 @@ +/*jshint esversion: 6 */ + module.exports = function(grunt) { const path = require('path'); @@ -12,16 +14,6 @@ module.exports = function(grunt) { }, jshint: { files: ['src/js/main/*.js', 'src/js/head/*.js', '../__common__/js/*.js'], - options: { - reporterOutput: "", - proto: true, - // options here to override JSHint defaults - globals: { - browser: true, - jQuery: false, - devel: true - } - } }, stylelint: { options: { @@ -122,7 +114,7 @@ module.exports = function(grunt) { 'node_modules/ionicons-npm/src/ion-close-round.svg', 'node_modules/ionicons-npm/src/android-more-vertical.svg', 'src/fonts/magnet.svg', - 'node_modules/ionicons-npm/src/android-close.svg', + 'node_modules/ionicons-npm/src/android-close.svg', ], dest: 'fonts', destLess: 'src/generated',