Skip to:
Content

BuddyPress.org

Changeset 11546


Ignore:
Timestamp:
05/01/2017 09:24:53 AM (3 years ago)
Author:
netweb
Message:

Build/Test Tools: Add stylelint for CSS & SCSS linting.

This changeset is the first pass at adding stylelint. A new Grunt task grunt stylelint is now available and this will lint CSS & SCSS files against WordPress' CSS Coding Standards. Follow up commits will update BuddyPress' CSS & SCSS files to adhere to these coding standards. Following the CSS & SCSS updates the Ruby scss-lint gem will be removed.

Props netweb.
See 7028.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Gruntfile.js

    r11038 r11546  
    2020        BP_EXCLUDED_MISC = [
    2121            '!bp-forums/bbpress/**/*'
    22         ];
     22        ],
     23
     24        stylelintConfigCss  = require('stylelint-config-wordpress/index.js'),
     25        stylelintConfigScss = require('stylelint-config-wordpress/scss.js');
    2326
    2427    require( 'matchdep' ).filterDev( ['grunt-*', '!grunt-legacy-util'] ).forEach( grunt.loadNpmTasks );
     
    202205            core: [ SOURCE_DIR + 'bp-templates/bp-legacy/css/*.scss' ]
    203206        },
     207        stylelint: {
     208            css: {
     209                options: {
     210                    config: stylelintConfigCss,
     211                    format: 'css'
     212                },
     213                expand: true,
     214                cwd: SOURCE_DIR,
     215                src: BP_CSS.concat( BP_EXCLUDED_CSS, BP_EXCLUDED_MISC )
     216            },
     217            scss: {
     218                options: {
     219                    config: stylelintConfigScss,
     220                    format: 'scss'
     221                },
     222                expand: true,
     223                cwd: SOURCE_DIR,
     224                src: [ 'bp-templates/bp-legacy/css/*.scss' ]
     225            }
     226        },
    204227        cssmin: {
    205228            minify: {
  • trunk/package.json

    r11446 r11546  
    2323    "grunt-sass": "~1.2.1",
    2424    "grunt-scss-lint": "~0.5.0",
     25    "grunt-stylelint": "^0.8.0",
    2526    "grunt-wp-i18n": "~0.5.4",
    26     "matchdep": "~1.0.1"
     27    "matchdep": "~1.0.1",
     28    "postcss-scss": "^0.4.1",
     29    "stylelint": "^7.10.1",
     30    "stylelint-config-wordpress": "^10.0.2"
    2731  },
    2832  "engines": {
Note: See TracChangeset for help on using the changeset viewer.