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

@qvlt/config-eslint

v0.0.15

Published

ESLint configuration for Qvlt projects

Downloads

23

Readme

@qvlt/config-eslint

ESLint configuration for Qvlt projects.

Installation

pnpm add -D @qvlt/config-eslint

Note: eslint and all required plugins are included as dependencies, so you don't need to install them separately.

Usage

Base Configuration (TypeScript + JavaScript)

// eslint.config.js
import config from '@qvlt/config-eslint';

export default config;

React Configuration

// eslint.config.js
import reactConfig from '@qvlt/config-eslint/react.js';

export default reactConfig;

TypeScript Configuration

// eslint.config.js
import typescriptConfig from '@qvlt/config-eslint/typescript.js';

export default typescriptConfig;

Monorepo Helper

For monorepos with multiple TypeScript configurations:

// eslint.config.js
import config from '@qvlt/config-eslint';
import { monorepoResolver } from '@qvlt/config-eslint/monorepo.js';

export default [...config, monorepoResolver];

Type-Checked Preset

For projects that need stricter type-aware rules (slower but more thorough):

// eslint.config.js
import config from '@qvlt/config-eslint/typechecked.js';
import { monorepoResolver } from '@qvlt/config-eslint/monorepo.js';

export default [...config, monorepoResolver];

Note: The type-checked preset uses tseslint.configs.recommendedTypeChecked and requires a tsconfig.json file. It provides more thorough type checking but may be slower than the standard preset.

Package.json Scripts

{
  "scripts": {
    "lint": "eslint . --ext .ts,.tsx,.js,.jsx",
    "lint:fix": "eslint . --ext .ts,.tsx,.js,.jsx --fix",
    "format": "prettier --write .",
    "format:check": "prettier --check ."
  }
}

Note: This configuration uses eslint-config-prettier to disable ESLint rules that conflict with Prettier. Run Prettier separately via CLI for formatting.

TypeScript Resolver Configuration

The configuration uses eslint-import-resolver-typescript with alwaysTryTypes: true by default. For monorepos or projects with custom TypeScript configurations, you can override the resolver settings:

React Restricted Imports

The React configuration includes a no-restricted-imports rule that enforces using @/ prefix for internal imports. If your project doesn't use this alias, you can disable this rule:

// eslint.config.js
import reactConfig from '@qvlt/config-eslint/react.js';

export default [
  ...reactConfig,
  {
    rules: {
      'no-restricted-imports': 'off',
    },
  },
];
// eslint.config.js
import config from '@qvlt/config-eslint';

export default [
  ...config,
  {
    settings: {
      'import/resolver': {
        typescript: {
          project: ['apps/*/tsconfig.json', 'packages/*/tsconfig.json'],
        },
      },
    },
  },
];

Examples

See the example/ directory for complete working examples:

  • eslint.config.js - Base configuration
  • react-eslint.config.js - React configuration
  • typescript-eslint.config.js - TypeScript configuration
  • package.json - Example package.json with scripts

Features

  • TypeScript Support: Full TypeScript linting with recommended rules
  • React Support: Complete React, React Hooks, and JSX accessibility rules
  • Import Organization: Automatic import sorting and organization
  • Prettier Integration: Uses eslint-config-prettier to disable conflicting rules (run Prettier separately)
  • Test Files: Special rules for test and spec files
  • Config Files: Special rules for configuration files
  • Source Files: Enhanced rules for source code files

Rules Included

Import Rules

  • Import ordering and organization
  • No duplicate imports
  • No relative package imports
  • No self-imports
  • No useless path segments

TypeScript Rules

  • No unused variables (with underscore prefix exception)
  • No explicit any (warning)
  • No var requires
  • No non-null assertions (warning)
  • Ban TS comments (warning)

React Rules (in React config)

  • JSX key requirements
  • No duplicate props
  • No undefined JSX elements
  • React Hooks rules
  • React Refresh rules
  • Accessibility rules (jsx-a11y)

General Rules

  • No console statements (warning)
  • No debugger statements (error)
  • No alert statements (warning)
  • Prefer const over let
  • No unused expressions

File-Specific Rules

Test Files

  • Console statements allowed
  • any types allowed

Config Files

  • Console statements allowed
  • var requires allowed

Source Files

  • Enhanced import dependency checking
  • Import cycle warnings
  • Extension enforcement
  • Restricted import patterns (in React config - requires @ alias setup)

Dependencies

This package includes all necessary ESLint plugins and configurations as dependencies:

  • @eslint/js
  • eslint-config-prettier
  • eslint-import-resolver-typescript
  • eslint-plugin-import
  • eslint-plugin-jsx-a11y (React config)
  • eslint-plugin-react (React config)
  • eslint-plugin-react-hooks (React config)
  • eslint-plugin-react-refresh (React config)
  • typescript-eslint

Development

Setup

# Clone the repository
git clone https://github.com/qvlt/config-eslint.git
cd config-eslint

# Install dependencies
pnpm install

# Run linting on example
pnpm --filter example lint

Testing

The package includes an example project in the example/ directory that demonstrates all configurations. Run the example to test changes:

pnpm --filter example lint
pnpm --filter example type-check

Releasing

This package uses tag-based publishing with GitHub Actions for automated releases. See RELEASING.md for detailed instructions.

Quick release commands:

# 1. Manually update version in package.json
# Edit package.json: "version": "0.0.3"

# 2. Create and push git tag to trigger release
pnpm run release:tag

The GitHub Actions workflow will automatically:

  • Verify package.json version matches git tag
  • Run tests and linting
  • Publish to npm as public package
  • Create GitHub release with changelog

Contributing

Want to help? See CONTRIBUTING.md for guidelines.

License

MIT