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-wework

v3.0.0

Published

ESLint config for WeWork projects

Downloads

32

Readme

eslint-config-wework

Libraries.io for GitHub NPM version NPM downloads MIT License

Shared ESLint configuration for WeWork projects

Introduction

ESLint config for WeWork projects. This is an extension of eslint-config-airbnb and also provides react, imports, lodash, mocha, and node presets.

Usage

Install:

npm install eslint-config-wework --save

If you're using npm < v3 you'll need to install each of this packages peerDependencies explicitly.

npm install eslint-config-airbnb eslint-plugin-react eslint-plugin-import eslint-plugin-jsx-a11y --save

Note: make sure the versions of the above packages that are installed satisfy this package's peerDependencies, otherwise you might see inconsistent behavior.

Configure:

First, touch .eslintrc if you don't already have one.

Then update it to look like the following:

{
  "root": true,
  "extends": [
    "wework"
  ],
  "rules": {
    # Override preset rules here
  },
}

React:

To enable React-specific rules, extend wework/react:

{
  "root": true,
  "extends": [
    "wework",
    "wework/react"
  ],
  "rules": {
    # Override preset rules here
  },
}

Imports:

To enable linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names, extend wework/imports:

{
  "root": true,
  "extends": [
    "wework",
    "wework/react",
    "wework/imports"
  ],
  "rules": {
    # Override preset rules here
  },
}

Lodash:

To enable React-specific rules, extend wework/lodash:

{
  "root": true,
  "extends": [
    "wework",
    "wework/lodash"
  ],
  "rules": {
    # Override preset rules here
  },
}

Mocha:

To enable linting of Mocha/Chai/Sinon tests add a eslintrc file to your test folder:

{
  "extends": [
    "wework/mocha",
  ],
  "rules": {
    # Override preset rules here
  },
}

Node:

For Node specific config, including identification of security hotspots, add a eslintrc file to your node src folder:

{
  "extends": [
    "wework/node",
  ],
  "rules": {
    # Override preset rules here
  },
}

Note: the security plugin is slow, finds a lot of false positives which need triage by a human, and isn't geared towards client-side. Use sparingly! See https://github.com/nodesecurity/eslint-plugin-security for more info.

Development

  1. Checkout this repo
  2. Make changes in a feature branch and open a PR to master

The purpose of this package is to define and enforce code style in JavaScript code. With that in mind please be mindful when proposing changes, explain your reasoning and consider other users.

npm scripts

Target | Behavior ------------ | ------------- npm run lint | (Run as a git pre-commit hook) Lint the config with itself npm run security-scan | (Run as a git pre-push hook) Checks npm dependencies for security vulnerabilities npm run release <version> | Generates a changelog, updates package version, tags and pushes via np. This should only be run on an up-to-date master by a maintainer of this package. Version can be a semver level: patch | minor | major | prepatch | preminor | premajor | prerelease, or a valid semver version: 1.2.3.

npm run will list all npm scripts