src/prelint.js
function getStagedFiles(callback) {

    const options = [ 'diff', '--cached', '--name-only', '--diff-filter=ACM' ]

    execFile('git', options, (err, stdout) => {

        if (err) return callback(err)

        const stagedFiles = stdout
            .split('\n')
            .filter(filename => filename.match(/.js$/))

        callback(null, stagedFiles)

    })

}
function getStagedFiles(callback) {

    const options = [ 'diff', '--cached', '--name-only', '--diff-filter=ACM' ]

    execFile('git', options, (err, stdout) => {

        if (err) return callback(err)

        const stagedFiles = stdout
            .split('\n')
            .filter(filename => filename.match(/.js$/))

        callback(null, stagedFiles)

    })

}
function getStagedFiles ( callback ) { const options = [ 'diff' , '--cached' , '--name-only' , '--diff-filter=ACM' ] execFile ( 'git' , options , ( err , stdout ) => { if ( err ) return callback ( err ) const stagedFiles = stdout . split ( '\n' ) . filter ( filename => filename . match ( / .js$ / ) ) callback ( null , stagedFiles ) } ) }
Calls callback with list of staged files
@param {Function} callback
@returns {void}
Calls callback with list of staged files