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 🙏

© 2025 – Pkg Stats / Ryan Hefner

momenti-eslint

v3.5.0

Published

A shareable ESLint configuration for Next.js projects using TypeScript, TSX, JavaScript, and JSX. Designed with modern best practices, accessibility, and maintainability in mind.

Readme

momenti-eslint

A shareable ESLint configuration for Next.js projects using TypeScript, TSX, JavaScript, and JSX. Designed with modern best practices, accessibility, and maintainability in mind.

Features

  • Optimized for Next.js + TypeScript + React projects
  • Balanced rule set for good code quality without being too strict
  • Performance optimized for faster linting
  • Built-in Prettier integration
  • Accessibility (a11y) rules included
  • Unused imports detection
  • SVG imports support

Installation

# Using npm
npm install --save-dev momenti-eslint

# Using yarn
yarn add --dev momenti-eslint

# Using pnpm
pnpm add -D momenti-eslint

# Using bun
bun add -D momenti-eslint

Next.js Setup

This ESLint configuration is optimized for Next.js projects. Follow these steps for the best setup:

  1. Install the package and its peer dependencies:
# Using npm
npm install --save-dev momenti-eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-next @next/eslint-plugin-next eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks

# Using yarn
yarn add -D momenti-eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-next @next/eslint-plugin-next eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks
  1. Create an eslint.config.mjs file in your project root:
import momentiEslintConfig from 'momenti-eslint';

export default [...momentiEslintConfig];
  1. Add the following to your package.json:
{
  "scripts": {
    "lint": "eslint --config eslint.config.mjs .",
    "lint:fix": "eslint --config eslint.config.mjs . --fix"
  }
}
  1. For proper SVG imports support, update your next.config.js:
/** @type {import('next').NextConfig} */
const nextConfig = {
  webpack(config) {
    // SVG Configuration
    config.module.rules.push({
      test: /\.svg$/,
      use: ['@svgr/webpack'],
    });
    return config;
  },
};

export default nextConfig;
  1. Install SVGR for Next.js:
npm install --save-dev @svgr/webpack

Usage

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

import momentiEslintConfig from 'momenti-eslint';

export default [...momentiEslintConfig];

TypeScript Configuration

For proper TypeScript support, especially with SVG imports, create or update your tsconfig.json:

{
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "bundler",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "plugins": [
      {
        "name": "next"
      }
    ],
    "paths": {
      "@/*": ["./*"]
    }
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
  "exclude": ["node_modules"]
}

SVG Type Declarations

To properly type SVG imports and icon objects, create a types.d.ts file in your project:

declare module '*.svg' {
  import * as React from 'react';
  const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
  export default ReactComponent;
}

// For icon objects that reference SVG files
declare module '@/constants/icons' {
  const Icons: {
    [key: string]: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
  };
  export default Icons;
}

Development vs Production

The configuration automatically detects the NODE_ENV environment variable:

  • In development: Type checking is disabled for faster linting
  • In production: Full type checking is enabled

To run linting in development mode:

NODE_ENV=development eslint .

To run linting in production mode with full type checking:

NODE_ENV=production eslint .

What’s Included?

Installed Dependencies:

Included Dependencies

The following dependencies are included in this package to ensure proper linting rules are applied:

| Dependency | Purpose | | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- | | @eslint/eslintrc | For FlatCompat, enabling modern configs. | | @typescript-eslint/eslint-plugin | TypeScript-specific linting rules. | | @typescript-eslint/parser | Parses TypeScript code for ESLint. | | eslint | Core linting engine. | | eslint-config-next | Next.js-specific linting rules. | | @next/eslint-plugin-next | Next.js-specific linting rules. | | eslint-plugin-import | Rules for ES module imports. | | eslint-plugin-jsx-a11y | Accessibility rules for JSX elements. | | eslint-plugin-prettier | Integrates Prettier for formatting rules. | | eslint-plugin-react | React-specific linting rules. | | eslint-plugin-react-hooks | Ensures proper use of React Hooks. | | globals | Defines browser and Node.js global variables. | | prettier | Code formatter integration. |

Changelog

The changelog is automatically generated following Conventional Commits. See the CHANGELOG.md file for detailed updates.

npm Package

You can find the npm package here.

npm version

PUBLISHING NEW VERSIONS

To publish a new version, run the following commands:

npm run release

This will create a new version, push to GitHub, and publish to npm.

or

npm run release:patch
npm run release:minor
npm run release:major

or you can also use npm publish directly after updating the version in package.json with npm version patch or npm version minor or npm version major.

License

ISC