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

@jmlweb/eslint-config-base

v3.0.4

Published

Base ESLint configuration for TypeScript projects with strict type checking and best practices

Readme

@jmlweb/eslint-config-base

npm version License: MIT Node.js ESLint

Strict ESLint flat config for TypeScript projects. Extends @jmlweb/eslint-config-base-js with strict type-checked rules.

🔧 Maintenance mode: only dependency and security updates, no new rules. For new projects use @jmlweb/oxlint-config-base. To move an existing project, see the migration guide.

✨ Features

  • 🔒 Strict type checking: strictTypeChecked and stylisticTypeChecked from typescript-eslint, with projectService
  • 🛡️ No any: no-explicit-any is an error
  • 📦 Type-only imports: inline type style, plus automatic import and export sorting
  • 🎯 Opinionated: no enums (use const maps), no default exports, no parameter mutation
  • 🎨 Prettier compatible: disables rules that conflict with Prettier

📦 Installation

npm install --save-dev @jmlweb/eslint-config-base eslint @eslint/js typescript-eslint eslint-config-prettier eslint-plugin-simple-import-sort

@jmlweb/eslint-config-base-js is a regular dependency and installs automatically.

💡 Upgrading? See the Migration Guide.

🚀 Quick Start

// eslint.config.js
import baseConfig from '@jmlweb/eslint-config-base';

export default [
  ...baseConfig,
  // Project-specific overrides
];

💡 Examples

Test overrides and ignores

// eslint.config.js
import baseConfig from '@jmlweb/eslint-config-base';

export default [
  ...baseConfig,
  {
    files: ['**/*.test.ts', '**/*.test.tsx'],
    rules: {
      '@typescript-eslint/no-explicit-any': 'off',
      'no-console': 'off',
    },
  },
  {
    ignores: ['dist/', 'build/', 'node_modules/'],
  },
];

Allow default exports in config files

// eslint.config.js
import baseConfig from '@jmlweb/eslint-config-base';

export default [
  ...baseConfig,
  {
    files: ['*.config.ts', '*.config.js'],
    rules: {
      'no-restricted-exports': 'off',
    },
  },
];

Less strict

// eslint.config.js
import baseConfig from '@jmlweb/eslint-config-base';

export default [
  ...baseConfig,
  {
    files: ['**/*.ts', '**/*.tsx'],
    rules: {
      '@typescript-eslint/no-explicit-any': 'warn',
      '@typescript-eslint/consistent-type-imports': 'off',
    },
  },
];

📋 Configuration Details

Applied to **/*.ts and **/*.tsx (plus the JavaScript rules from base-js for .js, .mjs and .cjs).

Included

  • ✅ typescript-eslint recommended, strictTypeChecked and stylisticTypeChecked
  • ✅ parserOptions.projectService: true (requires a tsconfig.json)
  • ✅ Import and export sorting, Prettier conflict resolution
  • ✅ All rules from @jmlweb/eslint-config-base-js

Key rules

| Rule | Setting | | -------------------------------------------------- | ------------------------------------------------ | | @typescript-eslint/no-explicit-any | error | | @typescript-eslint/explicit-function-return-type | off (return types are inferred) | | @typescript-eslint/no-unused-vars | error, _-prefixed args and variables ignored | | @typescript-eslint/consistent-type-imports | error, type-imports with inline fix | | @typescript-eslint/consistent-type-definitions | error, prefer type | | @typescript-eslint/no-require-imports | error | | @typescript-eslint/naming-convention | error, see below | | no-restricted-syntax (TSEnumDeclaration) | error, use const maps | | no-restricted-exports | error, no default exports | | no-param-reassign | error, including properties |

Naming: types PascalCase; variables camelCase or UPPER_CASE (exported consts may also be PascalCase); functions camelCase.

🔄 Import Sorting

Imports are sorted and type-only imports are enforced.

Before:

import { Component } from './component';
import React, { useState } from 'react';
import { User } from './types';
import fs from 'fs';

After eslint --fix:

import fs from 'fs';
import React, { useState } from 'react';
import { type User } from './types';
import { Component } from './component';

🎯 When to Use

  • ✅ TypeScript projects that want strict, type-aware linting
  • ✅ Teams that want one consistent style (named exports, const maps, immutability)
  • ✅ A base for the React, Node.js and Astro configs

For JavaScript-only projects use @jmlweb/eslint-config-base-js. For React, Node.js or Astro use -react, -node or -astro. For new projects prefer @jmlweb/oxlint-config-base.

🔧 Extending the Configuration

Spread the config, then add objects after it. Later entries win.

// eslint.config.js
import baseConfig from '@jmlweb/eslint-config-base';

export default [
  ...baseConfig,
  {
    files: ['**/*.ts'],
    rules: {
      '@typescript-eslint/explicit-function-return-type': 'error',
    },
  },
];

📝 Usage with Scripts

{
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint . --fix"
  }
}
npm run lint

📋 Requirements

  • Node.js >= 22.12.0
  • ESLint ^9.0.0 || ^10.0.0 (flat config)
  • TypeScript project with a tsconfig.json (versions supported by typescript-eslint 8)

📦 Peer Dependencies

  • eslint (^9.0.0 || ^10.0.0)
  • @eslint/js (^9.0.0 || ^10.0.0)
  • typescript-eslint (^8.0.0)
  • eslint-config-prettier (^9.1.0 || ^10.0.0)
  • eslint-plugin-simple-import-sort (^12.0.0 || ^13.0.0 || ^14.0.0)

🔗 Related Packages

🔄 Migration Guide

2.x to 3.0

Node.js 18 and 20 are end-of-life. Node.js >= 22.12.0 is now required: it is the first Node.js 22 release that can require() ES modules without a flag, which the CommonJS build needs to load ESM-only plugins. Peer ranges were also widened (eslint-plugin-simple-import-sort 13 and 14).

  1. Upgrade Node.js to 22.12.0 or later.
  2. Update the package: npm install --save-dev @jmlweb/eslint-config-base@latest.

See the Changelog.

📄 License

MIT