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

@ton-ai-core/eslint-plugin-suggest-members

v1.6.17

Published

ESLint plugin suggesting potential corrections when accessing non-existent object members in TypeScript.

Readme

🔍 ESLint Plugin: suggest-members

npm version License: MIT TypeScript

Production-ready ESLint plugin that intelligently suggests corrections for typos in TypeScript/JavaScript code. Built with Functional Core, Imperative Shell architecture for maximum reliability and performance.

Key Features

  • 🎯 Smart Suggestions: Advanced similarity algorithms (Levenshtein + context analysis)
  • 🚀 TypeScript Integration: Full type-aware analysis with graceful fallbacks
  • High Performance: Optimized for large codebases with caching
  • 🛡️ Zero Breaking: Never interrupts your linting workflow
  • 🧪 100% Tested: Comprehensive test coverage with property-based testing
  • 📦 ESM Ready: Modern ES modules with TypeScript support

🎯 Real-World Examples

Export Suggestions (suggest-exports)

// ❌ Typo in React hook import
import { useStae, useEffect } from 'react'
//         ~~~~~~~ 
// ✅ ESLint Error: Module 'react' does not export 'useStae'. Did you mean:
//    - useState
//    - useRef  
//    - useMemo
//    - useCallback

Member Suggestions (suggest-members)

// ❌ Typo in localStorage method
localStorage.get1Item('token')
//           ~~~~~~~~
// ✅ ESLint Error: Property "get1Item" does not exist. Did you mean:
//    - getItem(key: string): string | null
//    - setItem(key: string, value: string)  
//    - removeItem(key: string)
//    - clear(): void

Module Path Suggestions (suggest-module-paths)

// ❌ Typo in file path
import styles from './HamsterKo1mbatPage.css'
//                  ~~~~~~~~~~~~~~~~~~~~~~
// ✅ ESLint Error: Cannot find module "./HamsterKo1mbatPage.css". Did you mean:
//    - ./HamsterKombatPage.css
//    - ./HamsterKombatPage.tsx
//    - ./HamsterKombatPage
//    - ../ThemeParamsPage.css

Import Suggestions (suggest-imports)

// ❌ Typo in named import
import { saveRe1f } from './hooks'
//       ~~~~~~~~
// ✅ ESLint Error: Variable "saveRe1f" is not defined. Did you mean:
//    - saveRef
//    - saveState
//    - useRef
//    - useState

📦 Installation

# npm
npm install -D @ton-ai-core/eslint-plugin-suggest-members

# yarn  
yarn add -D @ton-ai-core/eslint-plugin-suggest-members

# pnpm
pnpm add -D @ton-ai-core/eslint-plugin-suggest-members

⚙️ Configuration

ESLint v9+ (Flat Config)

// eslint.config.js
import suggestMembers from "@ton-ai-core/eslint-plugin-suggest-members";

export default [
  {
    files: ["**/*.{ts,tsx,js,jsx}"],
    plugins: { 
      "suggest-members": suggestMembers 
    },
    rules: {
      "suggest-members/suggest-exports": "error",
      "suggest-members/suggest-imports": "error", 
      "suggest-members/suggest-members": "error",
      "suggest-members/suggest-module-paths": "error"
    }
  }
];

ESLint v8 (Legacy Config)

{
  "plugins": ["@ton-ai-core/suggest-members"],
  "rules": {
    "@ton-ai-core/suggest-members/suggest-exports": "error",
    "@ton-ai-core/suggest-members/suggest-imports": "error",
    "@ton-ai-core/suggest-members/suggest-members": "error", 
    "@ton-ai-core/suggest-members/suggest-module-paths": "error"
  }
}

Recommended Configuration (Simplified Setup)

Instead of manually configuring each rule, you can use our recommended configuration that automatically enables all rules:

ESLint v9+ (Flat Config)

// eslint.config.js
import suggestMembers from "@ton-ai-core/eslint-plugin-suggest-members";

export default [
  {
    files: ["**/*.{ts,tsx,js,jsx}"],
    plugins: { 
      "suggest-members": suggestMembers 
    },
    ...suggestMembers.configs.recommended // Automatically enables all rules
  }
];

ESLint v8 (Legacy Config)

{
  "extends": ["plugin:@ton-ai-core/suggest-members/recommended"],
  "plugins": ["@ton-ai-core/suggest-members"]
}

TypeScript Integration

// tsconfig.json - Required for full functionality
{
  "compilerOptions": {
    "strict": true,
    "noImplicitAny": true
  },
  "include": ["src/**/*"]
}

🔧 Rules Reference

| Rule | Description | TypeScript Required | |------|-------------|-------------------| | suggest-exports | Suggests corrections for non-existent exports | ✅ Recommended | | suggest-imports | Suggests corrections for non-existent imports | ✅ Recommended |
| suggest-members | Suggests corrections for object properties/methods | ✅ Required | | suggest-module-paths | Suggests corrections for module paths | ❌ Filesystem only |

🚀 Performance & Reliability

Built for Scale

  • Fast: < 100ms analysis per file
  • 🧠 Smart Caching: Reuses TypeScript program instances
  • 🛡️ Graceful Fallbacks: Works without TypeScript service
  • 📊 Memory Efficient: Optimized for large codebases

Architecture Highlights

// Functional Core: Pure functions only
const calculateSimilarity = (target: string, candidates: readonly string[]): SimilarityScore[]

// Imperative Shell: Controlled effects  
const validateWithTypeScript = Effect.gen(function* (_) {
  const typeChecker = yield* _(TypeScriptService)
  const members = yield* _(getTypeMembers(type))
  return createSuggestions(members)
})

🧪 Testing & Quality

# Run all tests
npm test

# Test specific rules  
npm run test:rules

# Integration testing
npm run test:integration

# Lint and build
npm run build

Quality Metrics

  • 100% Test Coverage: 20/20 tests passing
  • Zero ESLint Errors: Clean codebase
  • TypeScript Strict: Full type safety
  • Performance: Benchmarked on 1000+ file projects

🤝 Contributing

We welcome contributions! Please see our ROADMAP.md for planned features.

Development Setup

git clone https://github.com/ton-ai-core/eslint-plugin-suggest-members.git
cd eslint-plugin-suggest-members
npm install
npm run build
npm test

Architecture Principles

  • 🏗️ Functional Core, Imperative Shell: Pure functions + controlled effects
  • 🔒 Type Safety: No any, exhaustive pattern matching
  • 🧪 Test-Driven: Property-based + unit + integration tests
  • 📚 Documentation: Every function has mathematical invariants

📋 Changelog

See CHANGELOG.md for detailed release notes.

🆘 Support

📄 License

MIT © TON AI


Made with ❤️ by the TON AI team