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-plugin-rule-adoption

v1.0.0

Published

ESLint plugin for incremental rule adoption.

Downloads

10

Readme

eslint-plugin-rule-adoption

An eslint plugin for incremental rule adoption, when --fix and codemods don't cut it.

If you deal with very large codebases such as monorepos, you may find that adopting new rules can be a huge chore. This plugin forceably shares the burden of eslint rule adoption amoungst all maintainers.

Similar Projects

  1. @rushstack/eslint-patch

Install

npm:

npm i --save-dev eslint-plugin-rule-adoption

yarn:

yarn add -D eslint-plugin-rule-adoption

Usage

This plugin comes with a processor.

In your eslint config, you will need to add the following:

{
  "processor": "rule-adoption/processor",
  "plugins": [
    /** other plugins */
    "eslint-plugin-rule-adoption"
  ]
}

Adopting new rules

Run eslint with the UPDATE_ADOPTION_BLACKLIST environment variable set to a truthy value.

# bash
UPDATE_ADOPTION_BLACKLIST=true npx eslint <your-eslint-args>

[!NOTE] Updating the blacklist using multiple eslint processes at the same time is not supported and can lead to undefined behavior. You must use one eslint process per project.

You will then see a new file eslint.adoption.json next to your package.json, which contains an object where keys correspond to file hashes and the values contain information on where the file is located (for humans to read) and a list of rules that are disabled in the file.

{
  "3e40fad28e92c430b85f6f82b918c754c1a008451670a27b70906561e08e23df": {
    "file": "src\\rendererCore\\main.ts",
    "rules": ["react/react-in-jsx-scope", "react/no-unknown-property", "no-console"]
  }
  // etc...
}

It can be helpful to regenerate this config every once and a while to get rid of old file hashes, but otherwise it is completely harmless to leave old entries here.

Caveats

Since rules are disabled on a per-file basis, it is not recommended to be used with rules that function across files, since changing one file would require fixing multiple files causing a cascade of needed fixes that defeats the purpose of this plugin.

To get around this, you can exclude certain rules from being ignored via eslint's cli.

UPDATE_ADOPTION_BLACKLIST=true npx eslint --rule "import/no-extraneous-dependencies: off" <your-eslint-args>

Or you can just modify the eslint config temporarily.