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

eslint-plugin-nextfriday

v1.21.0

Published

A comprehensive ESLint plugin providing custom rules and configurations for Next Friday development workflows.

Readme

eslint-plugin-nextfriday

A comprehensive ESLint plugin providing custom rules and configurations for Next Friday development workflows.

Installation

npm install --save-dev eslint-plugin-nextfriday
# or
yarn add --dev eslint-plugin-nextfriday
# or
pnpm add -D eslint-plugin-nextfriday

Usage

Flat Config (ESLint 9+)

Base Configuration (for pure JS/TS projects)

import nextfriday from "eslint-plugin-nextfriday";

export default [nextfriday.configs.base];
// or use the recommended preset (stricter)
export default [nextfriday.configs["base/recommended"]];

React Configuration

import nextfriday from "eslint-plugin-nextfriday";

export default [nextfriday.configs.react];
// or use the recommended preset
export default [nextfriday.configs["react/recommended"]];

Next.js Configuration

import nextfriday from "eslint-plugin-nextfriday";

export default [nextfriday.configs.nextjs];
// or use the recommended preset
export default [nextfriday.configs["nextjs/recommended"]];

Bundled Plugin Configs

Pre-configured configs for popular plugins. No extra install needed — they ship as dependencies. These configs are arrays, so use the spread operator (...) to merge them into your flat config.

import nextfriday from "eslint-plugin-nextfriday";

export default [nextfriday.configs["react/recommended"], ...nextfriday.configs.sonarjs, ...nextfriday.configs.unicorn];

| Config | Plugin | Description | | --------- | --------------------- | ---------------------------------------------------------------------------------------------------------- | | sonarjs | eslint-plugin-sonarjs | SonarJS recommended rules for bug detection and code quality | | unicorn | eslint-plugin-unicorn | Unicorn recommended rules (with filename-case and prevent-abbreviations off, no-null off in JSX/TSX) |

Manual Configuration

If you prefer to configure rules manually:

import nextfriday from "eslint-plugin-nextfriday";

export default [
  {
    plugins: {
      nextfriday,
    },
    rules: {
      // Variable Naming
      "nextfriday/no-single-char-variables": "error",
      "nextfriday/no-lazy-identifiers": "error",
      "nextfriday/boolean-naming-prefix": "error",
      "nextfriday/enforce-constant-case": "error",

      // File Naming
      "nextfriday/file-kebab-case": "error",
      "nextfriday/jsx-pascal-case": "error",
      "nextfriday/md-filename-case-restriction": "error",

      // Code Style
      "nextfriday/no-emoji": "error",
      "nextfriday/prefer-destructuring-params": "error",
      "nextfriday/prefer-function-declaration": "error",
      "nextfriday/require-explicit-return-type": "error",
      "nextfriday/no-complex-inline-return": "error",
      "nextfriday/no-logic-in-params": "error",
      "nextfriday/enforce-hook-naming": "error",
      "nextfriday/enforce-service-naming": "error",
      "nextfriday/enforce-sorted-destructuring": "error",
      "nextfriday/no-env-fallback": "error",
      "nextfriday/no-inline-default-export": "error",
      "nextfriday/newline-after-multiline-block": "error",
      "nextfriday/newline-before-return": "error",
      "nextfriday/no-inline-nested-object": "error",
      "nextfriday/prefer-async-await": "error",
      "nextfriday/enforce-curly-newline": "error",
      "nextfriday/no-nested-ternary": "error",
      "nextfriday/prefer-guard-clause": "error",

      // Import Optimization
      "nextfriday/no-relative-imports": "error",
      "nextfriday/prefer-import-type": "error",
      "nextfriday/prefer-react-import-types": "error",
      "nextfriday/sort-exports": "error",
      "nextfriday/sort-imports": "error",

      // Type Patterns
      "nextfriday/enforce-type-declaration-order": "error",
      "nextfriday/no-nested-interface-declaration": "error",
      "nextfriday/prefer-named-param-types": "error",
      "nextfriday/prefer-inline-literal-union": "error",
      "nextfriday/prefer-inline-type-export": "error",
      "nextfriday/prefer-interface-over-inline-types": "error",
      "nextfriday/sort-type-alphabetically": "error",
      "nextfriday/sort-type-required-first": "error",

      // React/JSX
      "nextfriday/jsx-newline-between-elements": "error",
      "nextfriday/jsx-no-inline-object-prop": "error",
      "nextfriday/jsx-no-newline-single-line-elements": "error",
      "nextfriday/jsx-no-non-component-function": "error",
      "nextfriday/jsx-no-ternary-null": "error",
      "nextfriday/jsx-no-variable-in-callback": "error",
      "nextfriday/jsx-require-suspense": "error",
      "nextfriday/jsx-simple-props": "error",
      "nextfriday/jsx-sort-props": "error",
      "nextfriday/prefer-jsx-template-literals": "error",
      "nextfriday/react-props-destructure": "error",
      "nextfriday/enforce-props-suffix": "error",
      "nextfriday/enforce-readonly-component-props": "error",

      // Next.js
      "nextfriday/nextjs-require-public-env": "error",
    },
  },
];

Note: This plugin requires ESLint 9+ and only supports the flat config format. Legacy .eslintrc configurations are not supported.

Rules

Variable Naming Rules

| Rule | Description | Fixable | | ------------------------------------------------------------------------ | --------------------------------------------------------------------- | ------- | | no-single-char-variables | Disallow single character variable names (e.g., d, u, l) | ❌ | | no-lazy-identifiers | Disallow lazy identifiers like xxx, asdf, qwerty | ❌ | | boolean-naming-prefix | Enforce boolean variables to have prefix (is, has, should, can, etc.) | ❌ | | enforce-camel-case | Ban snake_case and restrict PascalCase to React components | ❌ | | enforce-constant-case | Enforce SCREAMING_SNAKE_CASE for global static constant values | ❌ | | enforce-property-case | Enforce camelCase for unquoted object property keys | ❌ | | no-misleading-constant-case | Disallow SCREAMING_SNAKE_CASE in local scope and for dynamic values | ❌ |

File Naming Rules

| Rule | Description | Fixable | | -------------------------------------------------------------------------- | ---------------------------------------------------- | ------- | | file-kebab-case | Enforce kebab-case filenames for .ts and .js files | ❌ | | jsx-pascal-case | Enforce PascalCase filenames for .jsx and .tsx files | ❌ | | md-filename-case-restriction | Enforce SNAKE_CASE filenames for .md files | ❌ |

Code Style Rules

| Rule | Description | Fixable | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------- | ------- | | no-emoji | Disallow emoji characters in source code | ❌ | | prefer-destructuring-params | Enforce destructuring for functions with multiple parameters | ❌ | | prefer-function-declaration | Enforce function declarations over arrow functions in .ts files | ❌ | | require-explicit-return-type | Require explicit return types on functions for better documentation | ❌ | | no-complex-inline-return | Disallow complex inline expressions in return - extract to const first | ❌ | | no-logic-in-params | Disallow logic/conditions in function parameters - extract to const | ❌ | | enforce-hook-naming | Enforce 'use' prefix for functions in *.hook.ts files | ❌ | | enforce-service-naming | Enforce 'fetch' prefix for async functions in *.service.ts files | ❌ | | enforce-sorted-destructuring | Enforce alphabetical sorting of destructured properties | ✅ | | no-env-fallback | Disallow fallback values for environment variables | ❌ | | no-inline-default-export | Disallow inline default exports - declare first, then export | ❌ | | no-direct-date | Disallow direct usage of Date constructor and methods | ❌ | | newline-after-multiline-block | Require a blank line after multi-line statements | ✅ | | newline-before-return | Require a blank line before return statements | ✅ | | no-inline-nested-object | Require nested objects and arrays to span multiple lines | ✅ | | no-inline-return-properties | Require return object properties to use shorthand notation | ❌ | | prefer-async-await | Enforce async/await over .then() promise chains | ❌ | | enforce-curly-newline | Enforce curly braces for multi-line if, forbid for single-line | ✅ | | no-nested-ternary | Disallow nested ternary expressions | ❌ | | prefer-guard-clause | Enforce guard clause pattern instead of nested if statements | ❌ |

Import Optimization Rules

| Rule | Description | Fixable | | -------------------------------------------------------------------- | --------------------------------------------------------- | ------- | | no-relative-imports | Disallow relative imports with ../ - use absolute imports | ❌ | | prefer-import-type | Enforce using 'import type' for type-only imports | ✅ | | prefer-react-import-types | Enforce direct imports from 'react' instead of React.X | ✅ | | sort-exports | Enforce a consistent ordering of export groups | ✅ | | sort-imports | Enforce a consistent ordering of import groups | ✅ |

Type Pattern Rules

| Rule | Description | Fixable | | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | ------- | | enforce-type-declaration-order | Enforce referenced types are declared after their consumer | ❌ | | no-nested-interface-declaration | Disallow inline object types in interface/type properties | ❌ | | prefer-named-param-types | Enforce named types for function parameters with object types | ❌ | | prefer-inline-literal-union | Enforce inlining literal union types for better IDE hover info | ✅ | | prefer-inline-type-export | Require type/interface exports inline at the declaration | ✅ | | prefer-interface-over-inline-types | Enforce interface declarations over inline types for React props | ❌ | | sort-type-alphabetically | Enforce A-Z sorting of properties within type groups | ✅ | | sort-type-required-first | Enforce required properties before optional in types/interfaces | ✅ |

React/JSX Rules

| Rule | Description | Fixable | | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | ------- | | jsx-newline-between-elements | Require empty lines between sibling multi-line JSX children | ✅ | | jsx-no-inline-object-prop | Disallow inline object literals in JSX props | ❌ | | jsx-no-newline-single-line-elements | Disallow empty lines between single-line sibling JSX elements | ✅ | | jsx-no-non-component-function | Disallow non-component functions at top level in .tsx/.jsx files | ❌ | | jsx-no-ternary-null | Enforce logical AND over ternary with null/undefined in JSX | ✅ | | jsx-no-variable-in-callback | Disallow variable declarations inside callback functions in JSX | ❌ | | jsx-require-suspense | Require lazy-loaded components to be wrapped in Suspense | ❌ | | jsx-simple-props | Enforce simple prop values (strings, variables, callbacks, ReactNode) | ❌ | | jsx-sort-props | Enforce JSX props are sorted by value type | ❌ | | prefer-jsx-template-literals | Enforce template literals instead of mixing text and JSX expressions | ✅ | | react-props-destructure | Enforce destructuring props inside React component body | ❌ | | enforce-props-suffix | Enforce 'Props' suffix for interfaces and types in *.tsx files | ❌ | | enforce-readonly-component-props | Enforce Readonly wrapper for React component props | ✅ |

Next.js Rules

| Rule | Description | Fixable | | -------------------------------------------------------------------- | ------------------------------------------------------------- | ------- | | nextjs-require-public-env | Require NEXTPUBLIC prefix for env vars in client components | ❌ |

Configurations

Configuration Presets Overview

| Preset | Severity | Base Rules | JSX Rules | Next.js Rules | Total Rules | | -------------------- | -------- | ---------- | --------- | ------------- | ----------- | | base | warn | 37 | 0 | 0 | 37 | | base/recommended | error | 37 | 0 | 0 | 37 | | react | warn | 37 | 15 | 0 | 52 | | react/recommended | error | 37 | 15 | 0 | 52 | | nextjs | warn | 37 | 15 | 1 | 53 | | nextjs/recommended | error | 37 | 15 | 1 | 53 |

Base Configuration Rules (37 rules)

Included in base, base/recommended, and all other presets:

  • nextfriday/boolean-naming-prefix
  • nextfriday/enforce-constant-case
  • nextfriday/enforce-curly-newline
  • nextfriday/enforce-hook-naming
  • nextfriday/enforce-service-naming
  • nextfriday/enforce-sorted-destructuring
  • nextfriday/enforce-type-declaration-order
  • nextfriday/file-kebab-case
  • nextfriday/md-filename-case-restriction
  • nextfriday/newline-after-multiline-block
  • nextfriday/newline-before-return
  • nextfriday/no-complex-inline-return
  • nextfriday/no-direct-date
  • nextfriday/no-emoji
  • nextfriday/no-env-fallback
  • nextfriday/no-inline-default-export
  • nextfriday/no-inline-nested-object
  • nextfriday/no-lazy-identifiers
  • nextfriday/no-logic-in-params
  • nextfriday/no-nested-interface-declaration
  • nextfriday/no-nested-ternary
  • nextfriday/no-relative-imports
  • nextfriday/no-single-char-variables
  • nextfriday/prefer-async-await
  • nextfriday/prefer-destructuring-params
  • nextfriday/prefer-function-declaration
  • nextfriday/prefer-guard-clause
  • nextfriday/prefer-import-type
  • nextfriday/prefer-inline-literal-union
  • nextfriday/prefer-inline-type-export
  • nextfriday/prefer-named-param-types
  • nextfriday/prefer-react-import-types
  • nextfriday/require-explicit-return-type
  • nextfriday/sort-exports
  • nextfriday/sort-imports
  • nextfriday/sort-type-alphabetically
  • nextfriday/sort-type-required-first

JSX Rules (15 rules)

Additionally included in react, react/recommended, nextjs, nextjs/recommended:

  • nextfriday/enforce-props-suffix
  • nextfriday/enforce-readonly-component-props
  • nextfriday/jsx-newline-between-elements
  • nextfriday/jsx-no-inline-object-prop
  • nextfriday/jsx-no-newline-single-line-elements
  • nextfriday/jsx-no-non-component-function
  • nextfriday/jsx-no-ternary-null
  • nextfriday/jsx-no-variable-in-callback
  • nextfriday/jsx-pascal-case
  • nextfriday/jsx-require-suspense
  • nextfriday/jsx-simple-props
  • nextfriday/jsx-sort-props
  • nextfriday/prefer-interface-over-inline-types
  • nextfriday/prefer-jsx-template-literals
  • nextfriday/react-props-destructure

Next.js Only Rules (1 rule)

Additionally included in nextjs, nextjs/recommended only:

  • nextfriday/nextjs-require-public-env

Severity Levels

  • base / react / nextjs: All rules set to "warn"
  • base/recommended / react/recommended / nextjs/recommended: All rules set to "error"

Features

  • Variable naming enforcement: Prevent cryptic single-character names and enforce boolean prefixes
  • File naming enforcement: Ensure consistent file naming conventions (kebab-case, PascalCase, SNAKE_CASE)
  • Function style: Enforce function declarations over arrow functions in utility files
  • Import optimization: Automatically suggests better import patterns for TypeScript
  • Code cleanup: Helps remove unnecessary explicit type annotations
  • React component conventions: Enforces naming standards and patterns for JSX/TSX files
  • Clean code practices: Prevents emoji usage, enforces parameter destructuring, and more
  • Formatting rules: Enforces consistent blank lines around multi-line blocks and return statements

Agent Skill

This plugin ships with an Agent Skill that teaches AI coding assistants (Claude Code, Cursor, etc.) all 53 rules so they generate compliant code from the start.

npx skills add next-friday/eslint-plugin-nextfriday --skill eslint-plugin-nextfriday

Once installed, AI assistants will automatically follow the naming, code style, type, JSX, import, and formatting patterns enforced by this plugin — reducing lint errors to zero.

Need Help?

If you encounter any issues or have questions:

License

MIT