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

one-eslint

v0.0.4

Published

> A collection of opinionated eslint configs and plugins that can be installed as one dependency

Downloads

2

Readme

one-eslint

A collection of opinionated eslint configs and plugins that can be installed as one dependency

It's similar to xo, but instead of wrapping eslint and prettier, it is installed along-side them. This enables use of the regular eslint/prettier IDE plugins, CLIs and more.

Features

:battery: Batteries included

Bundles all plugins and configs under one dependency. You only need to install one-eslint (and eslint itself) and you're ready to go.

:robot: Maximum uniformity

The base config disallows:

  • null (Use undefined)
  • classes (Use functions)
  • interface (Use type)
  • function keyword (Use arrow functions)
  • commonjs (Use esm)
  • forEach (Use for..of)
  • reduce (Use for..of, map or filter)
  • Abbreviations
  • Spelling mistakes
  • Certain dependencies (Suggests alternatives)

:nerd_face: Functional programming style

Includes eslint-plugin-fp.

:jigsaw: Works well with other popular tools

Assumes the use of TypeScript and prettier (It does not enable any style or formatting rules)

:zap: Fast

Only enables rules that are actually useful.

Ignores the following (and more):

  • Rules that are covered by TypeScript anyway

  • Rules that contradict each other

  • Rules regarding classes, they are disabled anyway

  • Rules that are extremely unlikely to catch errors in real life scenarios

For a full list of ignored rules and the reasoning behind them, see each configs ignored.js file.


:package: Install

npm

npm install --save-dev one-eslint eslint

yarn

yarn add --dev one-eslint eslint

Configs

All configs contain unique rules and can be combined however you want. Although it is recommended to always include the base config.

{
  "extends": ["one-base", "one-react", "one-ava", "one-cypress", "one-node"]
}

VS Code config

Some rules should be turned off in your IDE:

base

{
  "eslint.rules.customizations": [
    {
      "rule": "no-console",
      "severity": "off"
    },
    {
      "rule": "no-debugger",
      "severity": "off"
    },
    {
      "rule": "@typescript-eslint/no-explicit-any",
      "severity": "off"
    }
  ]
}

ava

{
  "eslint.rules.customizations": [
    {
      "rule": "ava/no-only-test",
      "severity": "off"
    },
    {
      "rule": "ava/no-skip-test",
      "severity": "off"
    }
  ]
}

Note

The configs are exported as one single dependency (one-eslint). This is so that the plugins can be included with the configs and don't pollute the package.json of the consumer. Also, if you use more than one config, you still only have one dependency in your package.json.

Measure performance

Run eslint with TIMING=1

TIMING=1 npx eslint test-project/index.ts

Formatter

https://github.com/sindresorhus/eslint-formatter-pretty

Features from xo

  • Default paths to lint or ignore
  • Enable clicking a line to open in your editor