node package manager
Stop writing boring code. Discover, share, and reuse within your team. Create a free org »

sails-hook-lint

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