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

v11.1.0

Published

ESLint configuration used by Groupon

Downloads

151

Readme

nlm-github nlm-node nlm-version

JavaScript at Groupon

This repository contains tools & guidelines for using JavaScript at Groupon. It represents the best effort to capture the current practices.

Writing NPM Packages

ES5 or ES2021?

For client-side code we depend on babel-preset-env to ensure that both application- and library code is compiled down to whatever our targeted browsers support.

Versioning and Publishing

We use nlm to manage our libraries. This ensures that:

  1. Every library has a usable CHANGELOG.md file as part of its git history.
  2. Releases are never tied to a single person.
  3. We can easily share best practices across projects.

Groupon JavaScript Style Guide

Fortunately there already is a great and well-documented style guide for JavaScript over at airbnb/javascript. It definitely is worth a read and in many ways we're staying fairly close to it.

There's some important differences that are mostly around our focus on sticking to features natively supported by Node where possible, and a higher bar for rules that don't support --fix: If a rule isn't clearly preventing bugs, it has to support --fix to be enabled.

Additionally, our file naming convention is kabab-case. File names should be entirely in lowercase to avoid any renaming issues with file systems.

Regarding code organization, we generally structure code by domain, not by layer (todos/model.js instead of models/todo.js).

To ensure good automation support, we're also dropping any rules that conflict with prettier's formatting.

The Longer Answer

We split our rules into three categories:

  • Mistakes: Things that should only appear because the developer made a mistake, 99% of the time. If these errors aren't fixed, we wouldn't expect the program to work correctly. This is the only category where we allow "error" even for rules that don't support --fix.
  • Conventions: Points out patterns that we believe could lead to confusion or maintenance issues down the line. If a rule isn't fixable, there should be a high bar for it to be enabled to not cause noise. Even if a rule is enabled, it may at most warn.
  • Opinions: Things that are arbitrary choices. Most whitespace and formatting rules fall into this category. Everything in here must support --fix and shouldn't require human intervention.

Groupon TypeScript Style Guide

You may have your .eslintrc extend groupon/typescript to get a set of configs based on our JavaScript lint configs, but with tweaks to work better with TypeScript (parsing, defaults, etc.).