Socket
Socket
Sign inDemoInstall

eslint-config-vast

Package Overview
Dependencies
139
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    eslint-config-vast

ESLint shareable config for Vast's JavaScript coding standards


Version published
Maintainers
2
Install size
9.62 kB
Created

Readme

Source

eslint-config-vast

ESLint shareable config Vast's JavaScript coding standards

NPM version Dependency Status devDependency Status devDependency Status

Installation

npm install eslint-config-vast --save-dev

Usage

For server-side (Node.js) code

Create .eslintrc file in the root of your project with the following config:

{
  "extends": "eslint-config-vast",
  "rules": {
    // Your overrides...
  }
}

For client-side code

Since the default settings are for server-side, in case you want to use the config for a client-side project, or in case you want to add an additional .stylelintrc file in a client-side code folder (e.g. /client/.eslintrc), use the following config:

{
    "extends": "eslint-config-vast",
    "env": {
        "browser": true,
        "es6": false // if you're not using Babel
    },
    "parserOptions": {
        "sourceType": "module", // if you're using Babel
        "ecmaVersion": 8 // if you're using Babel
    },
    "globals": {
            "SOME_GLOBAL": false
    },
    "rules": {
        // Your overrides...
    }
}

Setting up ESLint

If you haven’t already set up ESLint on your project, run:

npm install eslint --save-dev

Add "eslint" to "scripts" in package.json (wrap globstar pattern with single quotes):

"scripts": {
    "eslint": "eslint js tests *.js --ignore-pattern 'js/vendor/**/*.js'"
}

...and then you can run:

npm run eslint

To add a Git pre-commit hook for ESLint, run:

npm install pre-commit --save-dev

...and add this to package.json:

"pre-commit": [
  "eslint"
]

Tip: For real-time linting in your text editor, see ESLint integrations for editors.

Tip: Run eslint --fix /path/to/file.js to automatically fix as many issues as possible.

Tip: You can create a personal configuration file in your home directory (~/.eslintrc), it will only be used if no other configuration files are found. See Configuration Cascading and Hierarchy. But make sure to all install dependencies globally with -g flag.

License

MIT © 2016 Vast.com, Inc.

Keywords

FAQs

Last updated on 27 Oct 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc