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

zeno-config

v5.1.0

Published

Preconfigured and opinionated ESLint, Prettier, and TypeScript setup

Readme

zeno-config

Preconfigured ESLint, Prettier, and TypeScript setup for modern JavaScript and React projects.

Features

  • 🚀 ESLint 9+ flat config - Modern configuration format
  • ⚛️ React support - Comprehensive React, React Hooks, and JSX accessibility rules
  • 📘 TypeScript ready - Full TypeScript support with type-aware linting
  • 💅 Prettier integration - Seamless formatting with ESLint
  • 🎯 Node.js optimized - Specific rules for Node.js projects
  • 🔌 Modular configs - Use only what you need

Requirements

  • Node.js >= 20
  • ESLint >= 9

Installation

Install the package and its peer dependencies:

# Using pnpm (recommended)
pnpm add -D zeno-config eslint prettier

# For TypeScript projects, also install:
pnpm add -D typescript

All ESLint plugins are bundled with zeno-config, so you don't need to install them separately.

Usage

ESLint Configuration

Create an eslint.config.js file in your project root:

Basic Configuration

import { defineZenoConfig } from 'zeno-config/eslint';

export default defineZenoConfig({
	reactIncludes: ['src'], // Directories/files with React code (enables React rules)
	ts: true, // Enable TypeScript support (default: false)
});

React Compiler

If you're using or preparing to adopt React Compiler, you can opt in to its ESLint rules:

import { defineZenoConfig } from 'zeno-config/eslint';

// Full enforcement — compiler rules as errors
export default defineZenoConfig({
	reactIncludes: ['src'],
	reactCompiler: true,
});

// Preparing a codebase — surface compiler violations as warnings
export default defineZenoConfig({
	reactIncludes: ['src'],
	reactCompiler: 'warn',
});

engines field in package.json

Add an engines field to your package.json with your supported Node.js versions. Some rules for Node.js use this:

{
	"engines": {
		"node": ">=20"
	}
}

Advanced Configuration

import { defineZenoConfig } from 'zeno-config/eslint';

export default defineZenoConfig(
	{
		ts: true,

		// Directories and files containing React code (enables React rules for all file types in these paths)
		reactIncludes: ['src/client', 'src/components'],

		// Directories and files containing Node.js code (scopes Node rules to these paths)
		nodeIncludes: ['src/server', 'vite.config.ts', 'eslint.config.js'],

		// Additional directories to ignore (added to defaults: node_modules, dist, build, coverage)
		ignores: ['out', '.next'],

		// Patterns to ignore for import/no-unresolved rule
		ignoreExports: ['^@/'],

		// Additional file patterns to allow dev dependencies in (for no-extraneous-dependencies rule)
		additionalDevDependencies: [
			'**/scripts/**/*.js',
			'**/playwright.config.ts',
		],

		// Extensions to ignore for import/extensions rule
		extensionsIgnorePattern: {
			svg: 'always',
		},

		// Webpack config path for import resolution
		webpackConfig: './webpack.config.js',
	},
	[
		// Your custom config objects
		{
			rules: {
				'no-console': 'warn',
			},
		},
	]
);

Prettier Configuration

Create a prettier.config.js file in your project root:

import zenoConfig from 'zeno-config/prettier';

export default zenoConfig;

Or extend it with your own options:

import zenoConfig from 'zeno-config/prettier';

export default {
	...zenoConfig,
	printWidth: 100, // Override specific options
};

TypeScript Configuration

For Node.js projects, extend the provided TypeScript config in your tsconfig.json:

{
	"extends": "zeno-config/tsconfig"
	// your tsconfig options
}

For backend servers using bundlers like tsup or tsx:

{
	"extends": "zeno-config/tsconfig-server"
	// your tsconfig options
}

For React projects:

{
	"extends": "zeno-config/tsconfig-react"
	// your tsconfig options
}

Example:

{
	"extends": "zeno-config/tsconfig-react",
	"compilerOptions": {
		"baseUrl": ".", // should match webpack alias settings
		"paths": {
			// should match webpack alias settings
			"@/*": ["src/*"]
		},

		"allowJs": true,
		"checkJs": false
	},
	"include": ["src/**/*"]
}

Gitignore

Includes a shared .gitignore template with common patterns for your projects. Run the following command to add any missing patterns to your project's .gitignore (or create one if it doesn't exist):

npx zc-gitignore

The command only adds patterns that aren't already present. You can also add it as a setup script:

{
	"scripts": {
		"setup:gitignore": "zc-gitignore"
	}
}

See src/gitignore for the full list of included patterns.

File Extensions Helpers

Use in your build configs, webpack, etc:

import {
	// Arrays of extensions
	allExtensions, // All supported extensions: .js, .mjs, .cjs, .jsx, .mjsx, .cjsx, .ts, .cts, .mts, .tsx, .mtsx, .ctsx
	nodeExtensions, // Node.js extensions: .js, .mjs, .cjs, .ts, .cts, .mts
	reactJsExtensions, // JSX-only extensions: .jsx, .mjsx, .cjsx
	reactJsExtensionsExtended, // JS + JSX extensions: .js, .mjs, .cjs, .jsx, .mjsx, .cjsx
	reactExtensions, // React extensions (JSX + TSX): .jsx, .mjsx, .cjsx, .tsx, .mtsx, .ctsx
	reactExtensionsExtended, // All extensions for React directories: .js, .mjs, .cjs, .jsx, .mjsx, .cjsx, .ts, .cts, .mts, .tsx, .mtsx, .ctsx
	typescriptExtensions, // TypeScript extensions: .ts, .cts, .mts, .tsx, .mtsx, .ctsx

	// String versions for glob patterns (comma-separated)
	allExtensionsString, // ".js,.mjs,.cjs,.jsx,.mjsx,.cjsx,.ts,.cts,.mts,.tsx,.mtsx,.ctsx"
	nodeExtensionsString, // ".js,.mjs,.cjs,.ts,.cts,.mts"
	reactJsExtensionsString, // ".jsx,.mjsx,.cjsx"
	reactJsExtensionsExtendedString, // ".js,.mjs,.cjs,.jsx,.mjsx,.cjsx"
	reactExtensionsString, // ".jsx,.mjsx,.cjsx,.tsx,.mtsx,.ctsx"
	reactExtensionsExtendedString, // ".js,.mjs,.cjs,.jsx,.mjsx,.cjsx,.ts,.cts,.mts,.tsx,.mtsx,.ctsx"
	typescriptExtensionsString, // ".ts,.cts,.mts,.tsx,.mtsx,.ctsx"
} from 'zeno-config/extensions';

defineZenoConfig(options, additionalESLintConfig)

| Option | Type | Default | Description | | --------------------------- | ----------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------- | | reactIncludes | string[] | [] | Directories and files containing React code. Setting this enables all React rules (hooks, JSX, a11y, etc.) for all file types in these paths. | | reactCompiler | boolean \| 'warn' | false | Enable React Compiler rules. Set to true to enforce as errors, or 'warn' to surface violations as warnings (recommended when preparing a codebase for React Compiler adoption). | | ts | boolean | false | Enable TypeScript-specific rules | | performanceMode | boolean | false | Disables expensive rules for better performance | | ignores | string[] | [] | Additional directories to ignore (added to defaults: node_modules, dist, build, coverage) | | nodeIncludes | string[] | [] | Directories and files containing Node.js code. When set, Node-specific rules only apply to these paths. When not set but reactIncludes is set, reactIncludes directories are automatically excluded from Node rules. | | ignoreExports | string[] | [] | Export patterns to ignore for import/no-unresolved rule | | additionalDevDependencies | string[] | [] | Additional file patterns to allow dev dependencies in (for import/no-extraneous-dependencies) | | extensionsIgnorePattern | object | {} | Extension patterns to ignore for import/extensions rule | | webpackConfig | string | undefined | Path to webpack config for import resolver |

Advanced Usage

Using Internal Configs Directly

For advanced use cases, you can import and use the internal configs:

import zenoInternals from 'zeno-config/eslint';

const { configs, rules, extensions } = zenoInternals;

export default [
	...configs.getBase(),
	...configs.getNode({ includes: ['src/server'] }),
	...configs.getReact({ includes: ['src'] }),
	...configs.getTypescript({ react: true }),
	// Your custom configs
];

Accessing Individual Rules

import zenoInternals from 'zeno-config/eslint';

const { rules } = zenoInternals;

// Use individual rule sets
const baseRules = rules.getBaseRules();
const reactRules = rules.getReactPluginRules({ extensions: ['.jsx', '.tsx'] });

Defaults

Ignored Directories

The following directories are automatically ignored:

  • node_modules/
  • dist/
  • build/
  • coverage/

Prettier Settings

See src/prettier.js for the default Prettier configuration.

TypeScript Settings

See the TypeScript configuration files:

Included Plugins

  • @eslint/js - Core JavaScript rules (rules)
  • @stylistic/eslint-plugin - Code style rules (rules)
  • eslint-plugin-import-x - Import/export validation (rules)
  • eslint-plugin-unicorn - Additional JavaScript best practices (rules)
  • eslint-plugin-n - Node.js specific rules (rules)
  • eslint-plugin-prettier - Prettier integration
  • eslint-plugin-react (optional) - React specific rules (rules)
  • eslint-plugin-react-hooks (optional) - React Hooks rules (rules) and React Compiler rules (rules)
  • eslint-plugin-jsx-a11y (optional) - Accessibility rules for JSX (rules)
  • eslint-plugin-react-you-might-not-need-an-effect (optional) - React Effect optimization (rules)
  • typescript-eslint (optional) - TypeScript rules (rules)