]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - Gruntfile.js
Add eslint & stylelint tests (fix a few things) and move dependencies to dev
[github/wallabag/wallabag.git] / Gruntfile.js
index bd0d6dda40092f6c99013689f65d676cff379e8b..e52cd16f472cafcf3fc9a6f2e4700ccf9e7f354d 100644 (file)
@@ -123,27 +123,22 @@ module.exports = function (grunt) {
         src: 'annotator.min.js',
         dest: '<%= buildDir %>/themes/_global/js/',
       },
-    },
-    symlink: {
       baggyfonts: {
         files: [
           {
             expand: true,
-            overwrite: true,
             cwd: '<%= modulesDir %>/icomoon-free-npm/Font',
             src: 'IcoMoon-Free.ttf',
             dest: '<%= releaseDir %>/themes/baggy/fonts/',
           },
           {
             expand: true,
-            overwrite: true,
             cwd: '<%= modulesDir %>/ptsans-npm-webfont/fonts',
             src: 'ptsansbold.woff',
             dest: '<%= releaseDir %>/themes/baggy/fonts/',
           },
           {
             expand: true,
-            overwrite: true,
             cwd: '<%= modulesDir %>/material-design-icons-iconfont/dist/fonts/',
             src: ['MaterialIcons-Regular.eot', 'MaterialIcons-Regular.woff2', 'MaterialIcons-Regular.woff', 'MaterialIcons-Regular.ttf'],
             dest: '<%= releaseDir %>/themes/baggy/fonts/',
@@ -175,6 +170,8 @@ module.exports = function (grunt) {
           },
         ],
       },
+    },
+    symlink: {
       pics: {
         files: [
           {
@@ -201,12 +198,19 @@ module.exports = function (grunt) {
         src: ['./<%= releaseDir %>/*'],
       }
     },
+    eslint: {
+      target: ['<%= appDir %>/themes/material/js/init.js', '<%= appDir %>/themes/baggy/js/init.js']
+    },
+    stylelint: {
+      target: ['<%= appDir %>/themes/material/css/*.css', '<%= appDir %>/themes/baggy/css/*.css']
+    }
+
   });
 
   grunt.registerTask(
     'fonts',
     'Install fonts',
-    ['symlink:baggyfonts', 'symlink:materialfonts']
+    ['copy:baggyfonts', 'copy:materialfonts']
     );
 
   grunt.registerTask(
@@ -218,7 +222,7 @@ module.exports = function (grunt) {
   grunt.registerTask(
     'default',
     'Build and install everything',
-    ['clean', 'copy:pickerjs', 'concat', 'browserify', 'uglify', 'postcss', 'symlink']
+    ['clean', 'copy:pickerjs', 'concat', 'browserify', 'uglify', 'postcss', 'copy', 'symlink']
     );
 
   grunt.registerTask(
@@ -226,4 +230,10 @@ module.exports = function (grunt) {
     'Compiles the stylesheets.',
     ['clean:css', 'concat:cssMaterial', 'concat:cssBaggy', 'postcss']
   );
+
+  grunt.registerTask(
+      'tests',
+      'Test css and js style conformity',
+      ['eslint', 'stylelint']
+  )
 };