Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Watching For Changes

sbsky edited this page Nov 15, 2016 · 2 revisions

If you are using gulp in your build process and you would like to run the linter each time the files change, then just integrate this script into your gulp file.

Simply create a file gulp-bslint.js and paste in the following code.

var gulp = require('gulp')
var watch = require('gulp-watch')
var exec = require('child_process').exec

gulp
  .watch(['./**/*.brs'])
  .on('change', function (file) {
    executeBSLint(file)
  })

function executeBSLint (file) {
  var cmd = 'bslint ' + __dirname + '/' + file
  exec(cmd, function (err, stdout, stderr) {
    if (err) throw new Error('Error: ' + err)
    console.log(stdout)
  })
}

Then run node gulp-bslint.js

Clone this wiki locally