Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

sails-eslint

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sails-eslint

Add eslint linting utility to Sails JS

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

sails-eslint

npm version Dependency Status

Sails JS hook to activate ESLint in your sails app.

Here is how eslint log looks like (sample):

Installation

npm install sails-eslint

Usage

requires at least sails >= 0.11

Make sure you have a .eslintrc in your root folder. Then just lift your app as normal, and enjoy the power of linting. For an example of an .eslintrc file see: https://github.com/jasancheg/sails-eslint/blob/master/.eslintrc

Configuration

By default, configuration lives in sails.config.eslint. The configuration key (eslint) can be changed by setting sails.config.hooks['sails-eslint'].configKey.

ParameterTypeDetails
active((boolean))Whether or not sails should lint your JS code. Defaults to true.
formatter((string))Which formatter to use. Defaults to 'eslint-formatter-pretty'.
usePolling((boolean))Whether or not to use the polling feature. Slower but necessary for certain environments. Defaults to false.
dirs((array))Array of strings indicating Which folders or glob patterns to lint and watch. Defaults to [path.resolve(sails.config.appPath, 'api'), path.resolve(sails.config.appPath, 'config')].
ignored((array|string|regexp|function))Files and/or directories to be ignored. Pass a string to be directly matched, string with glob patterns, regular expression test, function that takes the testString as an argument and returns a truthy value if it should be matched, or an array of any number and mix of these types. For more examples look up anymatch docs.

Example (only if you want to change the default configuration!!)

// [your-sails-app]/config/eslint.js
module.exports.eslint = {
  active: true,
  dirs: [
    'api/controllers',
    'api/middlewares',
    'api/mocks',
    'api/models',
    'api/policies',
    'api/services',
    'config'
  ]
};

That’s it!

License

MIT © jasancheg

Keywords

sails

FAQs

Package last updated on 24 Jun 2017

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