summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2021-06-22 13:33:05 +0200
committerMarkus Heiser <markus.heiser@darmarit.de>2021-06-24 13:27:21 +0200
commitdfc5c3bc1520d8b4e48d972099c80198fa312847 (patch)
treefabbb39e86ff8d34f2d3086cadb85a1ac8a80ed6 /searx
parente73a96b5f9c55e3b6eb6b95515b18d46308ee1c1 (diff)
[mod] add stylelint process to target themes.simple
Before build, do lint the LESS files using stylelint [1]. The configuration 'stylelint-config-standard' [2] is added to the root of the simple theme [3]. [1] https://stylelint.io/ [2] https://github.com/stylelint/stylelint-config-standard [3] https://stylelint.io/user-guide/configure Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx')
-rw-r--r--searx/static/themes/simple/.stylelintrc.json3
-rw-r--r--searx/static/themes/simple/gruntfile.js19
-rw-r--r--searx/static/themes/simple/package.json9
3 files changed, 28 insertions, 3 deletions
diff --git a/searx/static/themes/simple/.stylelintrc.json b/searx/static/themes/simple/.stylelintrc.json
new file mode 100644
index 000000000..40db42c66
--- /dev/null
+++ b/searx/static/themes/simple/.stylelintrc.json
@@ -0,0 +1,3 @@
+{
+ "extends": "stylelint-config-standard"
+}
diff --git a/searx/static/themes/simple/gruntfile.js b/searx/static/themes/simple/gruntfile.js
index e34d4ee4f..956626148 100644
--- a/searx/static/themes/simple/gruntfile.js
+++ b/searx/static/themes/simple/gruntfile.js
@@ -23,6 +23,14 @@ module.exports = function(grunt) {
}
}
},
+ stylelint: {
+ options: {
+ formatter: 'unix',
+ },
+ src: [
+ 'src/less/**/*.less',
+ ]
+ },
copy: {
js: {
expand: true,
@@ -191,8 +199,17 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-webfont');
+ grunt.loadNpmTasks('grunt-stylelint');
grunt.registerTask('test', ['jshint']);
- grunt.registerTask('default', ['jshint', 'copy', 'concat', 'uglify', 'less:development', 'less:production']);
+ grunt.registerTask('default', [
+ 'jshint',
+ 'stylelint',
+ 'copy',
+ 'concat',
+ 'uglify',
+ 'less:development',
+ 'less:production'
+ ]);
};
diff --git a/searx/static/themes/simple/package.json b/searx/static/themes/simple/package.json
index 5c075d154..89e9008be 100644
--- a/searx/static/themes/simple/package.json
+++ b/searx/static/themes/simple/package.json
@@ -9,11 +9,14 @@
"grunt-contrib-less": "~3.0.0",
"grunt-contrib-uglify": "~5.0.1",
"grunt-contrib-watch": "~1.1.0",
+ "grunt-stylelint": "^0.16.0",
"grunt-webfont": "^1.7.2",
"ionicons-npm": "^2.0.1",
"jslint": "^0.12.1",
"less": "^4.1.1",
- "less-plugin-clean-css": "^1.5.1"
+ "less-plugin-clean-css": "^1.5.1",
+ "stylelint": "^13.13.1",
+ "stylelint-config-standard": "^22.0.0"
},
"dependencies": {
"autocomplete-js": "2.7.1",
@@ -25,6 +28,8 @@
"build": "grunt",
"watch": "grunt watch",
"webfont": "grunt webfont",
- "clean": "rm -Rf node_modules package-lock.json ion.less"
+ "clean": "rm -Rf node_modules package-lock.json ion.less",
+ "stylelint": "grunt stylelint",
+ "stylelint-fix": "grunt stylelint --fix"
}
}