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

@iarna/standard

v2.0.2

Published

Standard formats as @iarna likes it.

Downloads

100

Readme

@iarna/standard

Standard formats as @iarna likes it.

USAGE

$ npm i -D @iarna/standard
$ npx iarna-standard

In package.json...

"scripts": {
  "pretest": "iarna-standard"
}

WHATSAT?

Sooo, I mostly like Standard, except some of the rules drive me bonkers. So for my personal projects I worked up a .eslint config that did what I wanted. This is all that bundled up as an extension to standard. Many many thanks to @feross and friends for making standard so easy to extend.

WHUTSITDO?

It tests for a Node.js environment specifically:

  • No ESM, script mode only
  • No jsx

It disables some standard rules that produce results I find objectionable:

  • indent - I mostly like this, but there are times where it does the wrong thing and it's insufficiently configurable to correct that w/o patching. Maybe I'll make my own version someday but for today... disabling it is fine. I don't, as rule, screw up my indentation. =p
  • no-return-assign - Assigning in return values is really weird... except when using _ => abc = _ and yes, I could use _ => { abc = _ } but I don't wanna. And assigning in return otherwise may be weird, but it isn't likely to hide a bug.
  • object-curly-spacing - Enabled in standard@12 it sets all my code on fire.

It enables all of the eslint recommended rules. But it disables some those that I find objectionable, specifically:

  • no-console - Is not great in primarily cli/server-side code.

It enables some assertions that standard doesn't:

  • no-prototype-builtins - Disallow calling Object.prototype methods directly
  • array-callback-return - Enforce using return in builtin callbacks when needed
  • no-implicit-coercion - Disallow implicit conversions, eg !!foo use Boolean(foo) instead.
  • The node recommended assertions.

It adds some more plugins:

  • security We use the recommended settings for disbling...
    • detect-object-injection - This isn't an issue i node land and has too many false positives.
  • dependencies
    • case-sensitive - Make sure we don't screw ourselves when using Linux.
    • no-unresolved - Deps must exist.
    • require-json-ext - If you require json, be explicit.
  • unicorn
    • catch-error-name - Exceptions should be caught as err so other assertions can tell if they're unused
    • filename-case - kebab-case is the only case. camelCase in filename is definitely baad.
    • explicit-length-check - no checking truthyness of array.length
    • no-abusive-eslint-disable - stop eslint being disabled for an entire file
    • throw-new-error - when constructing and throwing built in errors, use new
    • number-literal-case - when constructing hex and other literals, use lowercase for the middle part, caps for the latter part, eg 0xBADC0FFEE
    • escape-case - same as above, but for string escapes, eg '\uD834'
    • no-array-instanceof - use Array.isArray for array identity
    • no-hex-escape - no '\x1b' use '\u001b' instead
    • custom-error-definition - some common sense around custom Error classes
    • prefer-starts-ends-with - use startsWith and endsWith string methods where possible in pref to regexp
    • prefer-type-error - enforce use of TypeError over Error where appropriate
    • regex-shorthand - enforce use of regexp character classes when available