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

@yungezeit/eslint-base

v0.0.23

Published

Personal base ESLint flat config

Readme

@yungezeit/eslint-base

Personal ESLint flat base configuration.

[!NOTE] This preset is used as a dependency by all other presets in this repository. Therefore if you plan on using e.g. @yungezeit/eslint-vue or @yungezeit/eslint-typescript, in your project, you don't need to explicitly install this preset.

Features

  • Lint ES modules based on @eslint/js's recommended rules.
  • Lint regexes within ES modules using eslint-plugin-regexp and its recommended rules.
  • Lint JSON and JSONc files using eslint-plugin-jsonc and its recommended rules.
  • Lint YAML files using eslint-plugin-yml and its recommended rules.
  • Lint code inside Markdown files using eslint-plugin-markdown and its recommended rules.
  • Lint and sort package.json properties to structural consistency.
  • Uses eslint-plugin-import to lint import/export statements.

Install

# using pnpm
pnpm add -D @yungezeit/eslint-base
# using npm
npm add -D @yungezeit/eslint-base
# using yarn
yarn add -D @yungezeit/eslint-base
# using bun
bun add -D @yungezeit/eslint-base

Usage

Raw configuration

You may simply spread the raw configuration array:

// eslint.config.js
import basePreset from '@yungezeit/eslint-base';

export default [...basePreset];

Configuration function

Alternatively, you can use the createBaseConfig function to create a base ESLint configuration array. Using this function lets you tweak the base configuration behaviour by passing some options as a second argument.

// eslint.config.js
import { createBaseConfig } from '@yungezeit/eslint-base';

export default createBaseConfig([ /** Your configs… */], {
  /** (optional) Internal patterns passed to `enforceImportOrder` (see below). */
  internalPatterns: [],
  /** (optional) Should node environment be supported? */
  node: true,
});

VSCode

You may want to add the following settings to your .vscode/settings.json:

{
  // Turn on ESLint for preset's supported languages if needed.
  "eslint.validate": [
    "javascript", "javascriptreact",
    "json", "jsonc", "json5", "markdown", "yaml",
  ],
  // If you want ESLint to autofix problems on save.
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit",
  }
}

Imports order

enforceImportOrder(internalPatterns?: string[])

This function creates a configuration with an import/order rule that enforces :

  1. a specific order of import groups
  2. new lines between import groups
  3. alphabetized imports

Here's the expected order of import groups :

  1. "builtin": builtin node modules.
  2. "external": external modules (deps).
  3. "internal": internal modules (your own modules).
  4. "parent", "index" and "sibling": relative imports.

You may pass an array of minimatch patterns to match imports that should be considered internal.

Example configuration

import { enforceImportOrder } from '@yungezeit/eslint-base';
const config = enforceImportOrder(['#database', '@components/**']);

Example output

import fs from 'node:fs';

import chalk from 'chalk';
import { minimatch } from 'minimatch';

import { database, tables } from '#database';
import { Button } from '@components/button';
import { Input } from '@components/input';

import { foo } from '../parent';
import { bar, baz } from '.';
import { bro } from './sibling';