Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including sails-hook-lint with all npm packages installed. Try it out:

var sailsHookLint = require("sails-hook-lint")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

sails-hook-lint v1.1.2

Sails hook for code style check

sails-hook-lint

NPM version Build status Test coverage Downloads

Use ESlint to check sails app code.

Installation

$ npm install sails-hook-lint

Usage

Put eslint configuration in your root folder, and if not, will use the plugin's configuration as default. Then you just lift app as normal, by default, lint only run in development and local environment.

For an example of eslint configuration: .eslintrc.yml. More configuration references http://eslint.org/docs/user-guide/configuring.

Configuration

Change the default configuration by adding config/lint.js under your sails project

module.exports.lint = {
  enabled: true, // Enable lint. Defaults to `true`
  format: 'stylish', // Formatter. Defaults to `stylish`
  // Folders or files to lint or be ignored, support glob patterns,
  // pattern that starts with '!' are ignored by linting.  
  src: [
    '.',
    '!assets/**/*.js',
    '!tasks/**/*.js',
    '!Gruntfile.js',
    '!app.js',
    '!api/responses/**/*.js'
  ]
};

License

MIT

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free