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

@libs-for-dev/eslint-rules

v2.4.0

Published

Libs for Dev ESLint rules

Readme

Strict ESLint rules for libs-for-dev repositories

The strictest ESLint configuration for modern JavaScript/TypeScript development

Table of Contents

Features

  • 🎯 Zero-config setup for common project types
  • 🔧 Comprehensive rule sets for JS, TS, Vue, React, Svelte and more
  • 🎨 Built-in stylistic rules (no Prettier needed)
  • 📝 Strict file naming conventions
  • ✨ Best practices enforcement

Requirements

  • Node.js >=24.7.0
  • ESLint >=9.0.0 <10.0.0

Installation

⚠️ Important: This package uses peer dependencies. You must install the required peer dependencies separately based on your project type (React, Vue, Svelte, etc.). See the Peer Dependencies section below for detailed installation instructions.

Basic Installation

Install with your favorite package manager:

# npm
npm install --save-dev @libs-for-dev/eslint-rules

# yarn
yarn add -D @libs-for-dev/eslint-rules

# pnpm
pnpm add -D @libs-for-dev/eslint-rules

# bun
bun add -D @libs-for-dev/eslint-rules

Peer Dependencies

This package requires several peer dependencies that must be installed separately based on your project type:

Required for all projects:

# ESLint (required)
npm install --save-dev eslint@^9.0.0

For React projects:

npm install --save-dev eslint-plugin-react@^7.37.5 eslint-plugin-react-hooks@^5.2.0 eslint-plugin-react-perf@^3.3.3 react@^19.1.1

For Vue projects:

npm install --save-dev eslint-plugin-vue@^10.4.0 eslint-plugin-vue-scoped-css@^2.12.0 eslint-plugin-vuejs-accessibility@^2.4.1 vue@^3.5.21 vue-eslint-parser@^10.2.0

For Svelte projects:

npm install --save-dev eslint-plugin-svelte@^3.12.3 svelte@^5.38.10 svelte-eslint-parser@^1.3.2

Complete Installation Examples

React + TypeScript project:

npm install --save-dev @libs-for-dev/eslint-rules eslint@^9.0.0 eslint-plugin-react@^7.37.5 eslint-plugin-react-hooks@^5.2.0 eslint-plugin-react-perf@^3.3.3 react@^19.1.1 typescript@^5.9.2

Vue + TypeScript project:

npm install --save-dev @libs-for-dev/eslint-rules eslint@^9.0.0 eslint-plugin-vue@^10.4.0 eslint-plugin-vue-scoped-css@^2.12.0 eslint-plugin-vuejs-accessibility@^2.4.1 vue@^3.5.21 vue-eslint-parser@^10.2.0 typescript@^5.9.2

Svelte + TypeScript project:

npm install --save-dev @libs-for-dev/eslint-rules eslint@^9.0.0 eslint-plugin-svelte@^3.12.3 svelte@^5.38.10 svelte-eslint-parser@^1.3.2 typescript@^5.9.2

Supported File Types

This package provides the strictest ESLint rules for next type of files:

Usage

Basic Configuration

Create eslint.config.mjs in your project root:

import { configs } from '@libs-for-dev/eslint-rules'

export default [
  configs.ignores,
  configs.javascript,
  configs.json,
  configs.markdown,
  configs.packageJson,
]

TypeScript Project

import { configs } from '@libs-for-dev/eslint-rules'

export default [
  configs.ignores,
  configs.typescript,
  configs.json,
  configs.markdown,
  configs.packageJson,
]

Vue.js Project

import { configs } from '@libs-for-dev/eslint-rules'

export default [
  configs.ignores,
  configs.typescript, // if using TypeScript
  configs.vue,
  configs.json,
  configs.markdown,
  configs.packageJson,
]

Customization

import { configs } from '@libs-for-dev/eslint-rules'

export default [
  configs.typescript,
  configs.vue,
  {
    files: configs.vue.files,
    languageOptions: configs.vue.languageOptions,
    plugins: configs.vue.plugins,
    rules: {
      'vue/block-lang': ['error', { script: { lang: 'js' } }],
    },
  },
  {
    plugins: {
      ...configs.javascript.plugins,
    },
    rules: {
      'check-file/filename-naming-convention': [
        'error', { '**/*.vue': 'CAMEL_CASE' },
      ],
    },
  },
  {
    files: ['**/*.test.ts'],
    rules: {
      'max-lines-per-function': ['error', { max: 80 }],
    },
  },
  {
    files: ['/some/specific/folder/*.ts'],
    rules: {
      'max-lines': 'off',
    },
  }
]

ESLint Rules Overview

Code Quality Rules

  • Error Prevention

    • no-unused-vars - Prevent unused variables
    • no-undef - Prevent usage of undeclared variables
    • no-console - Disallow console.log and similar methods
    • no-debugger - Disallow debugger statements
  • Best Practices

    • prefer-arrow - Enforce using arrow functions
    • prefer-const - Require const declarations for variables that are never reassigned
    • no-var - Prevent usage of var
    • promise/catch-or-return - Enforce handling of Promises rejection

Style Rules

  • Formatting

    • @stylistic/indent - Enforce consistent indentation
    • @stylistic/quotes - Enforce consistent quote style
    • @stylistic/semi - Enforce consistent semicolon usage
    • @stylistic/comma-dangle - Enforce consistent comma style
  • Naming Conventions

    • check-file/filename-naming-convention - Enforce file naming conventions
    • check-file/folder-naming-convention - Enforce folder naming conventions

TypeScript Specific

  • Type Safety
    • @typescript-eslint/strict-boolean-expressions
    • @typescript-eslint/no-explicit-any
    • @typescript-eslint/explicit-function-return-type
    • @typescript-eslint/explicit-member-accessibility

React Specific

  • Hooks

    • react-hooks/rules-of-hooks - Enforce Rules of Hooks
    • react-hooks/exhaustive-deps - Verify dependencies array
  • Accessibility

    • jsx-a11y/alt-text - Enforce alt text for images
    • jsx-a11y/click-events-have-key-events - Ensure keyboard accessibility

Vue Specific

  • Template

    • vue/no-unused-components - Prevent unused components
    • vue/valid-template-root - Enforce valid template root
    • vue/multi-word-component-names - Enforce multi-word component names
  • Accessibility

    • vuejs-accessibility/alt-text - Enforce alt text for images
    • vuejs-accessibility/click-events-have-key-events - Ensure keyboard accessibility

Testing (Vitest)

  • Best Practices
    • vitest/expect-expect - Enforce expecting test results
    • vitest/no-disabled-tests - Disallow disabled tests
    • vitest/no-focused-tests - Disallow focused tests

Documentation

  • JSDoc
    • jsdoc/require-jsdoc - Require JSDoc comments
    • jsdoc/require-param - Require parameter documentation
    • jsdoc/require-returns - Require return documentation

Import/Export

  • Organization
    • import-x/order - Enforce import order
    • import-x/no-duplicates - Prevent duplicate imports
    • perfectionist/sort-imports - Sort import statements

Performance

  • React

    • react-perf/jsx-no-new-object-as-prop - Prevent new objects in props
    • react-perf/jsx-no-new-array-as-prop - Prevent new arrays in props
  • Vue

    • vue/no-async-in-computed-properties - Prevent async computed properties
    • vue/no-side-effects-in-computed-properties - Prevent side effects in computed

Regular Expressions

  • Safety
    • regexp/no-empty-group - Disallow empty regex groups
    • regexp/no-useless-quantifier - Prevent useless quantifiers

Package.json

  • Maintenance
    • package-json/sort-fields - Enforce consistent field ordering
    • package-json/valid-dependencies - Ensure valid dependencies