Make WordPress Core

Ticket #25187: 25187.16.diff

File 25187.16.diff, 829 bytes (added by kadamwhite, 11 years ago)

Standardize spacing and make JSHint filter pass eqeqeq

  • Gruntfile.js

     
    123123                                options: {
    124124                                        curly: false,
    125125                                        eqeqeq: false
     126                                },
     127                                // Limit JSHint's run to a single specified file
     128                                //     grunt jshint:core --file=filename.js
     129                                filter: function( filepath ) {
     130                                        var file = grunt.option( 'file' );
     131
     132                                        // Don't filter when no target file is specified
     133                                        if ( ! file ) {
     134                                                return true;
     135                                        }
     136
     137                                        // Normalize filepath for Windows
     138                                        filepath = filepath.replace( /\\/g, '/' );
     139
     140                                        // Match only the filename passed from cli
     141                                        if ( filepath.lastIndexOf( '/' + file ) === filepath.length - ( file.length + 1 ) ) {
     142                                                return true;
     143                                        }
     144
     145                                        return false;
    126146                                }
    127147                        }
    128148                },