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

@neatfreak/eslint-plugin

v1.0.0-pre.0

Published

Sensible ESLint defaults for neat freaks

Downloads

2

Readme


@neatfreak/eslint-plugin

This plugin provides opinionated, sensible rules that...

  1. Help simplify ESLint setup.
  2. Help you adhere to best practices.
  3. Identify probable issue vectors in your code (pitfalls and code smells).
  4. Maximize readability and understanding of your code.
  5. Maximize ease of maintaining and refactoring your code.
  6. Maximize consistency of style and practices.
  7. Are designed to augment and/or compliment as opposed to override or conflict when using Prettier.

Rules that might cause excessive errors and are not auto-fixable are set to "warn".

For these reasons, many rules are enabled and, of those, most are using the recommended configuration except where it makes sense for achieving said goals. When used with Prettier, conflicting rules are disabled.

If there is a rule you just can't stomach, simply override it. This way you have a solid starting point. Publish your version publicly or privately and share it within your organization to maintain consistency between all your projects!

If you feel like any rule is just too cumbersome or restrictive, in general, please consider contributing to this project and let's make it better together!

💁‍♂️ You might also consider using @therealklanni/prettier-config

Available configurations

(and what they configure)

Usage

  1. Install required dependencies

    npm install -D @neatfreak/eslint-plugin eslint
  2. Optionally, view and install any additional dependencies, as needed

    # list dependencies
    npm view @neatfreak/eslint-plugin peerDependencies
    
    # install what you need
    npm install -D eslint-plugin-{jest,node,react} @neatfreak/prettier-config ...
  3. Configure as shown here (more examples below)

    {
      // the only plugin you need to specify is this one
      // or any plugin not provided by this one
      "plugins": ["@neatfreak"],
      "extends": ["plugin:@neatfreak/base", "plugin:@neatfreak/prettier"]
    }
  4. ???

  5. Profit

"Hard mode" example

DIY file globs. Allows for more control over how configs are applied.

{
  "plugins": ["@neatfreak"],
  "extends": [
    "some-unrelated-config",
    // apply @neatfreak configs after unrelated configs
    "plugin:@neatfreak/base"
  ],
  "overrides": [
    // if you need other unrelated overrides, add them first
    {
      "files": ["*.js"],
      "rules": {
        "semi": ["error", "always"]
      }
    },
    {
      "files": ["*.ts"],
      "extends": [
        "some-unrelated-config",
        // apply @neatfreak configs after unrelated configs
        "plugin:@neatfreak/typescript"
      ],
      "rules": {
        "@typescript-eslint/semi": ["error", "always"],
        "@typescript-eslint/init-declarations": "off"
      }
    },
    {
      "files": ["**/__tests__/**"],
      // base config will get applied by above overrides
      "extends": ["plugin:@neatfreak/jest"],
      "rules": {
        "jest/no-if": "warn"
      }
    },
    // Apply last when using Prettier config
    {
      "files": ["*.?(ts,js)"],
      "extends": ["plugin:@neatfreak/prettier"]
    }
  ]
}

"Easy mode" example

Applies configs automatically wrapped in an override with a default files glob.

{
  "plugins": ["@neatfreak"],
  "extends": [
    "some-unrelated-config",
    // apply @neatfreak configs after unrelated configs
    "plugin:@neatfreak/base",
    // applied using pattern matching
    "plugin:@neatfreak/jest auto",
    "plugin:@neatfreak/typescript auto",
    // applied globally
    "plugin:@neatfreak/prettier"
  ],
  // example rules overrides
  "rules": {
    "semi": ["error", "always"],
    "@typescript-eslint/semi": ["error", "always"],
    "@typescript-eslint/init-declarations": "off",
    "jest/no-if": "warn"
  }
}

Note: the prettier, node, and cli configs do not have an "auto" config, as these don't typically require an override.

"Lazy mode" example

Automatically applies everything.

Note: requires installing all optional peer dependencies (see Usage)

{
  "plugins": ["@neatfreak"],
  "extends": ["plugin:@neatfreak/lazy"],
  // example rules overrides
  "rules": {
    "semi": ["error", "always"],
    "@typescript-eslint/semi": ["error", "always"],
    "@typescript-eslint/init-declarations": "off",
    "jest/no-if": "warn"
  }
}