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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@susisu/eslint-config

v0.0.92

Published

My ESLint config

Downloads

850

Readme

@susisu/eslint-config

CI

Requirements

  • eslint >= 9.10.0 < 10

Installation

# npm
npm i -D eslint @susisu/eslint-config
# yarn
yarn add -D eslint @susisu/eslint-config
# pnpm
pnpm add -D eslint @susisu/eslint-config

Usage

NOTE: Formatting rules are not enabled. I recommend using Prettier.

The package provides a factory function that configures all language settings and rules for each file type.

Minimum setup

import { config } from "@susisu/eslint-config";

export default config({
  tsconfigRootDir: import.meta.dirname,
});

Options and custom configs

export default config(
  // Options
  {
    // Enable recommended rules. (default: true)
    recommendedRules: true,
    // Default sourceType for .js files.  (default: "module")
    jsSourceType: "module",
    // Set languageOptions.parserOptions.projectService for TypeScript files. (default: true)
    // If both `tsProjectService` and `tsProject` are enabled, only `tsProjectService` will have effect.
    tsProjectService: true,
    // Set languageOptions.parserOptions.project for TypeScript files. (default: false)
    tsProject: false,
    // Set languageOptions.parserOptions.tsconfigRootDir for TypeScript files. (default: undefined)
    tsconfigRootDir: undefined,
    // If true, mixes eslint-config-prettier to disable formatting rules. (default: true)
    prettier: true,
  },
  // Custom configs
  [
    {
      files: ["/path/to/file.js"],
      // Configs in `extends` are expanded in the same way as tseslint.config() does.
      // See https://typescript-eslint.io/packages/typescript-eslint#flat-config-extends
      extends: [somePlugin.recommended],
      rules: {
        "no-console": "off",
      },
    },
  ],
);
);

What does config() do?

  • Set linter options
    • Enable reportUnusedDisableDirectives
  • Install plugins
  • Set language options for JS and TS files
    • Set sourceType: "module" for .js, .mjs, .ts, .tsx, .cts, .ctsx, .mts, .mtsx
    • Set sourceType: "commonjs" for .cjs
    • Enable typescript-eslint parser and typed linting for TS files
  • Enable recommended rules
  • Apply custom configs
  • Disable rules that can conflict with Prettier

See the source code for more details.

Error levels

  • error: problems that should be fixed in most of the projects and contexts
  • warn: problems that might be fixed depending on the project or context, or just notifications (like highlighting TODO comments)

License

MIT License

Author

Susisu (GitHub, Twitter)