Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bs-eslint-message

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bs-eslint-message

BrowserSync plugin to display eslint errors (or any other message) within connected browsers

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-40%
Maintainers
1
Weekly downloads
 
Created
Source

bs-eslint-message

BrowserSync plugin to display eslint errors (or any other message) within connected browsers. Built specifically for gulp-eslint, but uses eslint's native error object, so should work with any eslint wrapper that exposes a results object.

Note: Uses a lot of es6 syntax, so probably won't work in older browsers 💁

Install

npm i browser-sync gulp-eslint bs-eslint-message

Usage with gulp-eslint

const gulp = require('gulp')
const eslint = require('gulp-eslint')
const browserSync = require('browser-sync').create()

gulp.task('serve', () => {
  browserSync.init({
    server: 'dist',
    plugins: ['bs-eslint-message']
  })
})

gulp.task('lint', () => {
  gulp.src('src/**/*.js')
    .pipe(eslint())
    .pipe(eslint.results(results => {
      browserSync.sockets.emit('msg:eslint', results)
    }))
    .pipe(eslint.format())
})

Send a basic message

const gulp = require('gulp')
const eslint = require('gulp-eslint')
const browserSync = require('browser-sync').create()

gulp.task('serve', () => {
  browserSync.init({
    server: 'dist',
    plugins: ['bs-eslint-message']
  })
  // Basic message only needs title and body
  setTimeout(() => {
    browserSync.sockets.emit('msg', {
      title: 'Hello world',
      body: 'This is the best 💃'
    })
  }, 2000)
})

Keywords

FAQs

Package last updated on 11 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc