WordPress.org

Make WordPress Core

Ticket #29792: 29792.3.diff

File 29792.3.diff, 5.0 KB (added by netweb, 4 years ago)
  • .stylelintrc

     
     1{
     2  "rules": {
     3    "at-rule-empty-line-before": [ 2, "always", {
     4      "except": ["blockless-group"],
     5      "ignore": ["after-comment"]
     6    } ],
     7    "at-rule-no-vendor-prefix": 2,
     8    "block-closing-brace-newline-after": [ 2, "always" ],
     9    "block-closing-brace-newline-before": [ 2, "always" ],
     10    "block-opening-brace-newline-after": [ 2, "always" ],
     11    "block-opening-brace-space-before": [ 2, "always" ],
     12    "color-hex-case": [ 2, "lower" ],
     13    "color-hex-length": [ 2, "short" ],
     14    "color-no-invalid-hex": 2,
     15    "declaration-bang-space-after": [ 2, "never" ],
     16    "declaration-bang-space-before": [ 2, "always" ],
     17    "declaration-block-semicolon-newline-after": [ 2, "always" ],
     18    "declaration-block-semicolon-space-before": [ 2, "never" ],
     19    "declaration-colon-newline-after": [ 2, "always-multi-line" ],
     20    "declaration-colon-space-after": [ 2, "always-single-line" ],
     21    "declaration-colon-space-before": [ 2, "never" ],
     22    "function-calc-no-unspaced-operator": 2,
     23    "function-comma-space-after": [ 2, "always" ],
     24    "function-comma-space-before": [ 2, "never" ],
     25    "function-linear-gradient-no-nonstandard-direction": 2,
     26    "function-parentheses-space-inside": [ 2, "never" ],
     27    "function-space-after": [ 2, "always" ],
     28    "function-url-quotes": [ 2, "none" ],
     29    "indentation": [ 2, "tab" ],
     30    "media-feature-colon-space-after": [ 2, "always" ],
     31    "media-feature-colon-space-before": [ 2, "never" ],
     32    "media-feature-name-no-vendor-prefix": 2,
     33    "media-feature-range-operator-space-after": [ 2, "always" ],
     34    "media-feature-range-operator-space-before": [ 2, "always" ],
     35    "media-query-list-comma-newline-after": [ 2, "always-multi-line" ],
     36    "media-query-list-comma-space-after": [ 2, "always-single-line" ],
     37    "media-query-list-comma-space-before": [ 2, "never" ],
     38    "media-query-parentheses-space-inside": [ 2, "never" ],
     39    "no-eol-whitespace": 2,
     40    "no-missing-eof-newline": 2,
     41    "number-leading-zero": [ 2, "always" ],
     42    "number-no-trailing-zeros": 2,
     43    "number-zero-length-no-unit": 2,
     44    "property-no-vendor-prefix": 2,
     45    "rule-no-shorthand-property-overrides": 2,
     46    "rule-nested-empty-line-before": [ 2, "always", {
     47      "except": ["first-nested"]
     48    } ],
     49    "rule-non-nested-empty-line-before": [ 2, "always" ],
     50    "rule-trailing-semicolon": [ 2, "always" ],
     51    "selector-combinator-space-after": [ 2, "always" ],
     52    "selector-combinator-space-before": [ 2, "always" ],
     53    "selector-list-comma-newline-after": [ 2, "always" ],
     54    "selector-list-comma-space-before": [ 2, "never" ],
     55    "selector-no-vendor-prefix": 2,
     56    "string-quotes": [ 2, "double" ],
     57    "value-list-comma-newline-after": [ 2, "always-multi-line" ],
     58    "value-list-comma-space-after": [ 2, "always-single-line" ],
     59    "value-list-comma-space-before": [ 2, "never" ],
     60    "value-no-vendor-prefix": 2
     61  }
     62}
  • Gruntfile.js

     
    33        var path = require('path'),
    44                SOURCE_DIR = 'src/',
    55                BUILD_DIR = 'build/',
    6                 autoprefixer = require('autoprefixer-core'),
     6                autoprefixer = require('autoprefixer'),
    77                mediaConfig = {},
    88                mediaBuilds = ['audiovideo', 'grid', 'models', 'views'];
    99
     
    4545                                src: [
    4646                                        'wp-admin/css/colors/*/colors.css'
    4747                                ]
     48                        },
     49                        lint: {
     50                                options: {
     51                                        syntax: require('postcss-scss'),
     52                                        processors: [
     53                                                require('stylelint'),
     54                                                require('postcss-reporter')({clearMessages: true})
     55                                        ]
     56                                },
     57                                expand: true,
     58                                cwd: SOURCE_DIR,
     59                                dest: SOURCE_DIR,
     60                                src: [
     61                                        // CSS
     62                                        'wp-admin/css/*.css',
     63                                        'wp-includes/css/*.css',
     64                                        // SCSS
     65                                        'wp-admin/css/colors/**/*.scss',
     66                                        // Exceptions
     67                                        '!wp-includes/css/jquery-ui-dialog.css'
     68                                ]
    4869                        }
    4970                },
    5071                clean: {
     
    614635
    615636        grunt.registerTask( 'precommit', 'Runs front-end dev/test tasks in preparation for a commit.', [
    616637                'postcss:core',
     638                'postcss:lint',
    617639                'imagemin:core',
    618640                'browserify',
    619641                'jshint:corejs',
  • package.json

     
    99  "author": "The WordPress Contributors",
    1010  "license": "GPL-2.0+",
    1111  "devDependencies": {
    12     "autoprefixer-core": "~5.2.1",
     12    "autoprefixer": "~6.0.3",
    1313    "grunt": "~0.4.5",
    1414    "grunt-browserify": "~4.0.0",
    1515    "grunt-contrib-clean": "~0.6.0",
     
    2626    "grunt-jsvalidate": "~0.2.2",
    2727    "grunt-legacy-util": "^0.2.0",
    2828    "grunt-patch-wordpress": "~0.3.0",
    29     "grunt-postcss": "~0.5.4",
     29    "grunt-postcss": "~0.6.0",
    3030    "grunt-rtlcss": "~1.6.0",
    3131    "grunt-sass": "~1.0.0",
     32    "postcss-reporter": "~1.3.0",
     33    "postcss-scss": "~0.1.2",
     34    "stylelint": "~2.0.0",
    3235    "matchdep": "~0.3.0"
    3336  }
    3437}