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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@r1-dev/code-style

v0.2.1

Published

Opinionated oxlint and oxfmt configuration: a base config, React and Effect add-ons, the anti-slop rules, a blank-line rule, and the formatter options.

Readme

@r1-dev/code-style

Opinionated oxlint and oxfmt configuration for TypeScript projects, in one package:

  • an oxlint base config with a React add-on and an Effect add-on,
  • the anti-slop rules, vendored,
  • a padding-lines rule that enforces blank-line discipline, with an autofix,
  • the oxfmt options.

The goal is code that reads the same in every repository that adopts it: one statement per thought, a blank line between thoughts, no function you cannot hold in your head.

Install

pnpm add -D @r1-dev/code-style oxlint oxfmt

oxlint (1.83 or later) and oxfmt (0.68 or later) are peer dependencies. The Node-based oxlint package and Node 22.18 or later are required, because the configs are TypeScript files.

Use

Two config files at the repository root. Each one imports the shared rules and adds only what is specific to that repository.

// oxlint.config.ts
import { base, react } from '@r1-dev/code-style/oxlint';
import { defineConfig } from 'oxlint';

export default defineConfig({
  extends: [base, react],
  ignorePatterns: ['src/generated/**']
});
// oxfmt.config.ts
import { format } from '@r1-dev/code-style/oxfmt';
import { defineConfig } from 'oxfmt';

export default defineConfig({
  ...format,
  sortImports: { ...format.sortImports, internalPattern: ['@acme/'] }
});

Leave out react in a project without React. Add effect in a project that uses Effect:

import { base, effect, react } from '@r1-dev/code-style/oxlint';

export default defineConfig({ extends: [base, react, effect] });

Add scripts:

{
  "scripts": {
    "lint": "oxlint",
    "lint:fix": "oxlint --fix",
    "format": "oxfmt",
    "format:check": "oxfmt --check"
  }
}

The first lint:fix and format on an existing codebase is a large commit. After that, the rules hold on every save and in CI.

What the rules say

Formatting (oxfmt)

| Option | Value | Why | | ------------------------------ | --------- | -------------------------------------------------------------- | | printWidth | 100 | Wide enough for a real name, narrow enough for two panes. | | semi | true | No ASI surprises. | | singleQuote | true | Less noise around the most common literal. | | trailingComma | "none" | A list ends where it ends. | | arrowParens | "always"| One shape for every arrow. | | experimentalOperatorPosition | "start" | A wrapped condition reads as a list of clauses. | | singleAttributePerLine | true | A JSX element with two attributes reads like an object. | | bracketSameLine | true | The closing > stays with the last attribute. | | sortImports | on | External, then internal, then relative, no groups by blank line. |

Linting (oxlint)

  • The correctness, suspicious, and perf categories are errors.
  • Type imports are explicit and inline: import { type Foo, bar }.
  • Arrays are Array<T> and ReadonlyArray<T>, never T[].
  • No console outside tests, seeds, scripts, and config files.
  • complexity is capped at 10. A function past the cap is split into named steps. There is no autofix for this one by design.
  • A long list of stylistic rules is turned off where the formatter or the type checker already decides, or where the rule fights idiomatic TypeScript (no-non-null-assertion, no-explicit-any, no-namespace, and others). See src/oxlint/index.ts.

anti-slop

base turns on every generic rule of anti-slop except require-readable-spacing, which r1/padding-lines covers. The rules reject low-evidence code: unknown parameters, returns, and type aliases; Record<string, unknown> contracts; typeof narrowing; chained or unexplained type assertions; filter().map() pairs; a reduce that copies its accumulator; object parameters; Reflect.get and Reflect.apply; module mocking; and shape words in names. oxc/no-accumulating-spread is on with them.

effect adds the five Effect rules: no hand-written _tag fields or comparisons, no hand-built tagged values, no imports of a service constructor outside its layer, and Match over a switch on a tag.

The plugins ship inside this package under @r1-dev/code-style/anti-slop and @r1-dev/code-style/anti-slop-effect. src/anti-slop/README.md records the vendored commit and the local edits.

r1/padding-lines

A blank line separates statements. Inside a function body a run of statements of the same tight kind stays together:

  • imports,
  • one-line variable declarations,
  • plain calls,
  • overload signatures with their implementation.

At the top level of a module every statement stands alone, except imports. A declaration, a statement that ends with a block, a function, class, interface, or type alias is always followed by a blank line. A return, throw, loop, if, switch, try, function, class, interface, type alias, or multi-line declaration always gets a blank line before it. The same rules apply inside a switch case. Comments travel with the statement under them: a blank line above a comment counts for that statement.

const rows = await load();
const first = rows[0];

if (first === undefined) return null;

if (first.isStale) return refresh(first);

for (const row of rows) {
  mark(row);
}

return first;

The rule is a configuration of the ESLint Stylistic padding-line-between-statements engine that anti-slop vendors, so it is autofixable: oxlint --fix inserts the missing lines and never removes any.

Compatibility

  • oxlint 1.83 or later, Node-based package. JS plugins and TypeScript configs are marked experimental by oxlint; this package tracks them and pins a minimum.
  • oxfmt 0.68 or later.
  • Node 22.18 or later.

Versioning

Semantic versioning. A change that makes previously passing code fail lint or change under the formatter is a major version. New rules that are off by default, and fixes, are minor or patch. Every release is listed in CHANGELOG.md.

Contributing

See CONTRIBUTING.md. Rule proposals are welcome as issues that include a before-and-after code sample.

License

MIT. The vendored anti-slop and ESLint Stylistic code is MIT as well; their notices are in THIRD_PARTY_NOTICES.md, which ships with the package.