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-custom-formats

v1.0.0

Published

Custom ESLint rules for component/file/variable naming conventions.

Downloads

4

Readme

eslint-plugin-custom-formats

Custom ESLint rules to keep naming consistent across your codebase:

  • component-name: enforce PascalCase for component names
  • file-structure: enforce PascalCase for component file names
  • variable-name: enforce camelCase for variables, parameters, and bindings

Install

  1. Add the plugin to your project (published or via local linking)
  • npm: npm i -D eslint-plugin-custom-formats
  • pnpm: pnpm add -D eslint-plugin-custom-formats
  • yarn: yarn add -D eslint-plugin-custom-formats
  1. Ensure you have the appropriate parsers installed for your stack:
  • TypeScript: @typescript-eslint/parser
  • Vue (SFC): vue-eslint-parser
  • Svelte: svelte-eslint-parser (optional; current rules have limited Svelte support)

Usage (ESLint 9+ Flat Config)

Create or edit eslint.config.js:

// eslint.config.js (Flat config)
import tsParser from '@typescript-eslint/parser';
import customFormats from 'eslint-plugin-custom-formats';
import vueParser from 'vue-eslint-parser';

export default [
  {
    languageOptions: {
      parser: tsParser,
      parserOptions: {
        ecmaVersion: 'latest',
        sourceType: 'module',
        ecmaFeatures: { jsx: true },
      },
    },
    plugins: {
      'custom-formats': customFormats,
    },
    rules: {
      'custom-formats/component-name': 'error',
      'custom-formats/file-structure': 'error',
      'custom-formats/variable-name': 'error',
    },
  },
  {
    files: ['**/*.vue'],
    languageOptions: { parser: vueParser },
  },
  
];

Note: The plugin currently exports a legacy-style configs.recommended; for Flat config, prefer the manual wiring above.

Usage (Legacy .eslintrc)

.eslintrc.json example:

{
  "parser": "@typescript-eslint/parser",
  "plugins": ["custom-formats"],
  "extends": ["plugin:custom-formats/recommended"],
  "rules": {
    // You can override defaults here if needed
    // "custom-formats/variable-name": "warn"
  }
}

If you don’t want to use the recommended config, enable rules manually:

{
  "parser": "@typescript-eslint/parser",
  "plugins": ["custom-formats"],
  "rules": {
    "custom-formats/component-name": "error",
    "custom-formats/file-structure": "error",
    "custom-formats/variable-name": "error"
  }
}

Rules

  • custom-formats/component-name

    • Enforces PascalCase for component identifiers in JSX and Vue export default { name: "..." }.
    • Caveat: Intrinsic JSX elements like div are lowercase and will be flagged by the current rule. If you need to allow intrinsic tags, we can update the rule to skip known HTML/SVG tags.
  • custom-formats/file-structure

    • Enforces PascalCase filenames for components (.tsx, .vue).
  • custom-formats/variable-name

    • Enforces camelCase for variables, parameters, destructured bindings, defaults, rest elements, arrays, and catch clause parameters.
    • Does not enforce function names themselves (to avoid conflicts with component naming rules).

Framework notes

  • TypeScript: Use @typescript-eslint/parser and ensure parserOptions.project as needed for your setup.
  • Vue: Use vue-eslint-parser for *.vue files (Flat config override shown above).
  • Svelte: The parser is ESM-only; when testing in Jest, you may need ESM transforms. Current rules include placeholders for Svelte—enable when your toolchain supports it.

Development

  • Build: npm run build (outputs to dist/)
  • Test: npm test

Ensure your peerDependencies in package.json align with the tool versions you support, and update the RuleCreator docs URL to your real documentation site before publishing.