npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

eslint-config-vast

v2.0.1

Published

ESLint shareable config for Vast's JavaScript coding standards

Downloads

232

Readme

eslint-config-vast

ESLint shareable config Vast's JavaScript coding standards

NPM version Dependency Status devDependency Status devDependency Status

This config can be used for linting server-side and client-side JavaScript.

If you are using React, extend this config with eslint-config-vast-react to add support for React's specific JSX syntax, and to add additional checks for React, JSX, and accessibility.

Installation

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

Usage

For Node.js environment (ES6):

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

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

For browser environment with ES6/ES7/ES8 to ES5 transpiler:

Create an additional .eslintrc file in a client-side code folder (e.g. client/.eslintrc) with the following settings:

{
    "env": {
        "browser": true
    },
    "parserOptions": {
        "sourceType": "module",
        "ecmaVersion": 8
    },
    "globals": {
        "GLOBAL1": false,
        "GLOBAL2": false
    }
}

For browser environment without ES6/ES7/ES8 to ES5 transpiler:

Create an additional .eslintrc file in a client-side code folder (e.g. client/.eslintrc) with the following settings:

{
    "env": {
        "browser": true,
        "es6": false
    },
    "globals": {
        "GLOBAL1": false,
        "GLOBAL2": false
    },
    "rules": {
        // Disable es6-related rules for es5 environment
        "object-shorthand": 0,
        "prefer-arrow-callback": 0,
        "prefer-template": 0,
        "prefer-spread": 0,
        "prefer-rest-params": 0
    }
}

Setting up ESLint

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

npm install eslint --save-dev

Add scripts to package.json (remember to change paths):

"scripts": {
    "lint:js": "eslint app tests *.js --ext .js --ext .jsx --ignore-pattern 'js/vendor'",
    "lint:js:fix": "npm run eslint -- --fix",
}

Run npm run lint:js to lint the code.

Run npm run lint:js:fix to automatically fix as many issues as possible. Another way to autoformat the code is with the editor plugin, such as ESLint-Formatter for Sublime Text.

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. In order to use this config in editor, you'll have to install ESLint and all dependencies globally (with -g flag).

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.

Related

Other configs

License

MIT © 2016 Vast.com, Inc.