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

@br/eslint-plugin-laws-of-the-game

v1.5.1

Published

Disincentivizes some coding practices.

Downloads

264

Readme

eslint-plugin-laws-of-the-game

CircleCI

This is a plugin full of ESLint rules. It is intended to be a somewhat-opinionated set of standards to follow when contributing to Bleacher Report JavaScript/ES codebases.

Custom rules

There are a handful of custom rules implemented in this repo. Some rules emphasize the use of functions and transformations, and discourage mutation and implicit state. Some rules intend to warn you of potential footguns.

Installation

You'll first need to install ESLint:

$ npm install --save-dev eslint

Next, install @br/eslint-plugin-laws-of-the-game:

$ npm install --save-dev @br/eslint-plugin-laws-of-the-game

Note: If you installed ESLint globally (using the -g flag) then you must also install @br/eslint-plugin-laws-of-the-game globally.

Usage

Add "@br/laws-of-the-game" to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "@br/laws-of-the-game"
    ]
}

It's Recommended that you use the Recommended set of rules by adding to the extends section:

{
    "extends": [
        "plugin:@br/laws-of-the-game/recommended",
    ]
}

Then configure any rules you'd like to tweak under the rules section:

{
    "rules": {
        "@br/laws-of-the-game/alphabetize-properties": ["error", {"limit": 3}],
        "@br/laws-of-the-game/no-assign-in-case-without-braces": "warn"
    }
}

Custom Rules

Contributions

We welcome contributions! There are a few ideas in the Issues of this repo.

To get started with how to lint JavaScript, play around with the AST Explorer.

Please add tests!

Note that the default branch of this repo is trunk.

Release Process

This codebase attempts to follow Semantic Versioning.

  1. Merge. One or more approved Pull Requests are merged to the trunk branch.
  2. Test. Ensure the test suite passes, and runs the expected number of tests: npm test
  3. Measure. Choose the appropriate New Version Number according to Semantic Versioning. (The CHANGELOG.md file may help with identifying the nature of the changes.)
  4. Changelog. Edit the CHANGELOG.md file, replacing the "Unreleased" label with the New Version Number, linked to the (as-yet-uncreated) GitHub tag as well (the pattern is https://github.com/<user>/<repo>/releases/tag/v<version-number> note the v). Ensure that the notes under this version reflect the changes made by the merged Pull Requests. Commit and push.
  5. Version. Run npm version <version-number> --message "Version %s" to both update the version in the package.json file and create the tag on GitHub.
  6. Publish. Run git push && npm publish to push the merges & version to GitHub, and publish the new package on npmjs.com.
  7. Release. Create a new Release on GitHub. Visit https://github.com/<user>/<repo>/releases, click the "Draft a new release" button. In the Tag field, enter "v"; in the Title field, enter just the version number; in the Description, write a brief description of the changes in this version. Then click "Publish release".

More on the general patterns of publishing packages: "How to Publish an Updated Version of an npm Package"