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

@tsrx/eslint-plugin

v0.3.118

Published

ESLint plugin for Ripple

Readme

@tsrx/eslint-plugin

npm version npm downloads

ESLint plugin for Ripple - helps enforce best practices and catch common mistakes when writing Ripple applications.

Works just like eslint-plugin-react - simply install and use the recommended config!

Installation

npm install --save-dev '@tsrx/eslint-plugin'
# or
yarn add --dev '@tsrx/eslint-plugin'
# or
pnpm add --save-dev '@tsrx/eslint-plugin'

Usage

Flat Config (ESLint 9+)

// eslint.config.js
import ripple from '@tsrx/eslint-plugin';

export default [...ripple.configs.recommended];

The plugin automatically:

  • Detects and uses @tsrx/eslint-parser if installed for .tsrx files
  • Detects and uses @typescript-eslint/parser if installed for .ts/.tsx files
  • Excludes .d.ts files, node_modules, dist, and build directories from linting
  • Works with .ts, .tsx, and .tsrx files

Legacy Config (.eslintrc)

{
  "plugins": ["ripple"],
  "extends": ["plugin:ripple/recommended"]
}

Configurations

recommended

The recommended configuration enables all rules at their default severity levels (errors and warnings).

import ripple from '@tsrx/eslint-plugin';

export default [
  {
    plugins: { ripple },
    rules: ripple.configs.recommended.rules,
  },
];

strict

The strict configuration enables all rules as errors.

import ripple from '@tsrx/eslint-plugin';

export default [
  {
    plugins: { ripple },
    rules: ripple.configs.strict.rules,
  },
];

Rules

ripple/no-module-scope-track (error)

Prevents calling track() at module scope. Tracked values must be created inside a function body.

Incorrect:

import { track } from 'ripple';

// This will cause runtime errors
let globalCount = track(0);

export function App() {
  return <div>{globalCount}</div>;
}

Correct:

import { track } from 'ripple';

export function App() {
  let count = track(0);

  return <div>{count}</div>;
}

ripple/prefer-oninput (warning, fixable)

Recommends using onInput instead of onChange for form inputs. Unlike React, Ripple doesn't have synthetic events, so onInput is the correct event handler.

Incorrect:

<input onChange={handleChange} />

Correct:

<input onInput={handleInput} />

This rule is auto-fixable with --fix.

ripple/control-flow-jsx (error)

Checks template control flow inside functions that return native TSRX. @for blocks should render template output, while ordinary for...of loops inside effect() callbacks should not render JSX.

ripple/no-lazy-destructuring-in-modules (error)

Prevents using lazy destructuring (&[] / &{}) in TypeScript/JavaScript modules. In .ts/.js files, you should use .value to read and write tracked values instead.

Incorrect:

// count.ts
import { track, effect } from 'ripple';

export function useCount() {
  const &[count] = track(1);
  effect(() => {
    console.log(count); // Error: Cannot use &[] in TypeScript modules
  });
  return { count };
}

Correct:

// count.ts
import { track, effect } from 'ripple';

export function useCount() {
  const count = track(1);

  // Use .value to read tracked values
  const double = track(() => count.value * 2);

  effect(() => {
    console.log('count is', count.value);
  });

  return { count, double };
}

Note: Lazy destructuring (&[] / &{}) is only valid in TSRX files. In TypeScript modules, use .value to read and write tracked values.

ripple/no-return-in-component (deprecated)

This compatibility rule is now a no-op. TSRX components are ordinary functions, so returning native TSRX is the expected authoring style.

Custom Configuration

You can customize individual rules in your ESLint config:

export default [
  {
    plugins: { ripple },
    rules: {
      'ripple/no-module-scope-track': 'error',
      'ripple/prefer-oninput': 'error', // Make this an error instead of warning
      'ripple/control-flow-jsx': 'error',
      'ripple/no-lazy-destructuring-in-modules': 'error',
      'ripple/valid-for-of-key': 'error',
    },
  },
];

The plugin will automatically detect and use the Ripple parser for .tsrx files.

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Related