Skip to content

Instantly share code, notes, and snippets.

@danpoltawski
Created July 8, 2016 15:48
Show Gist options
  • Save danpoltawski/8dbcdc26ee5dd8b47199aedc51cd139d to your computer and use it in GitHub Desktop.
Save danpoltawski/8dbcdc26ee5dd8b47199aedc51cd139d to your computer and use it in GitHub Desktop.
grunt-postcss for styleline with css (no longer relevant)
From 859664035feb4ac0df018489517bdaf984dbb9fd Mon Sep 17 00:00:00 2001
From: Dan Poltawski <[email protected]>
Date: Tue, 5 Jul 2016 15:56:53 +0100
Subject: [PATCH 1/1] MDL-55058 grunt: add stylelint css linting
---
Gruntfile.js | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/Gruntfile.js b/Gruntfile.js
index 0b52cc8..39c8101 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -160,6 +160,34 @@ module.exports = function(grunt) {
recursive: true,
paths: [cwd]
}
+ },
+ postcss: {
+ options: {
+ writeDest: false,
+ },
+ lesslint: {
+ options: {
+ parser: require('postcss-less'),
+ processors: [
+ require('stylelint')({
+ configOverrides: {
+ rules: {
+ 'no-extra-semicolons': null,
+ }
+ }
+ })
+ ]
+ },
+ src: ['**/*.less', '!theme/bootstrapbase/less/bootstrap/*', '!node_modules/**'],
+ },
+ csslint: {
+ options: {
+ processors: [
+ require('stylelint')
+ ]
+ },
+ src: ['**/*.css', '!theme/bootstrapbase/**', '!vendor/**', '!node_modules/**', '!lib/yuilib/**'],
+ }
}
});
@@ -299,6 +327,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-eslint');
+ grunt.loadNpmTasks('grunt-postcss');
// Register JS tasks.
grunt.registerTask('shifter', 'Run Shifter against the current directory', tasks.shifter);
--
2.9.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment