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

@bachman-dev/eslint-config

v1.0.0

Published

This is an [ESLint Shared Configuration](https://eslint.org/docs/latest/extend/shareable-configs) for use in all Bachman Dev projects. It contains highly opinionated rules from ESLint and typescript-eslint to help conform to our coding style.

Downloads

41

Readme

@bachman-dev/eslint-config

This is an ESLint Shared Configuration for use in all Bachman Dev projects. It contains highly opinionated rules from ESLint and typescript-eslint to help conform to our coding style.

[!WARNING]
This configuration is in an early stage of development. Use at your own risk!

Should I Use This?

In terms of using this config as-is, unless you're contributing code that's under the @bachman-dev Organization... probably not. However, use of the source code to make your own shareable ESLint config is encouraged, especially if its structure could be of some help to others.

Installation

TypeScript (and Maybe Some JavaScript e.g. Config Files)

Install the following packages:

pnpm add --save-dev typescript eslint @eslint/js typescript-eslint eslint-config-prettier @bachman-dev/eslint-config

Add the following to your eslint.config.js:

import bachmanDev from "@bachman-dev/eslint-config";
import eslint from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import tseslint from "typescript-eslint";

export default tseslint.config(
  {
    // Replace output folder if needed, e.g. "dist"
    ignores: ["dist/**"],
  },
  eslint.configs.recommended,
  ...tseslint.configs.strictTypeChecked,
  ...tseslint.configs.stylisticTypeChecked,
  bachmanDev({ language: "typescript" }),
  {
    languageOptions: {
      parserOptions: {
        projectService: true,
        tsconfigRootDir: import.meta.dirname,
      },
    },
  },
  {
    files: ["**/*.js"],
    ...tseslint.configs.disableTypeChecked,
  },
  {
    files: ["**/*.js"],
    ...bachmanDev({ language: "javascript-in-typescript" }),
  },
  eslintConfigPrettier,
);

Plain JavaScript

Install the following packages:

pnpm add --save-dev eslint @eslint/js eslint-config-prettier @bachman-dev/eslint-config
import bachmanDev from "@bachman-dev/eslint-config";
import eslint from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";

export default [
  {
    // Replace output folder if needed, e.g. "dist"
    ignores: ["dist/**"],
  },
  eslint.configs.recommended,
  bachmanDev({ language: "javascript" }),
  eslintConfigPrettier,
];

Rulesets

The following rulesets are applied to your ESLint configuration depending on language:

Configuration

The rules enabled by this configuration are highly opinionated, but some exceptions are made for niche projects.

language

Typically either set to javascript or typescript when configuring across all files. For projects with a mixture of JavaScript and TypeScript, you should include the config with the language set to javascript-in-typescript, with a files property on the config object limited to only JavaScript files. See the above Installation instructions for an example.

allowBitwise

When set to true, we allow Bitwise Operators such as &, |, <<, >>, etc. These normally indicate a typo, but some programs such as Discord bots rely on them heavily. So this option can be enabled instead of disabling the rule per line many times.

allowConsole

Permits plain calls to console methods when set to true.

[!WARNING] Logging via the built-in "console" object can be convenient, but usually leads to excess outputs hanging around; it's best to use a logging framework (or make your own service, disabling this rule in your own methods) so that logging is centralized, configurable, and not (as often) subject to misplaced log-prints that make it into production. Consider this before enabling this config option.

requireParameterProperties

Older TypeScript projects didn't take advantage of Parameter Properties, so as a temporary means, this option can be set to false to soften the blow when it comes to linting errors when enabling this config.

[!TIP] Updating the code to adhere to this rule should be done sooner than later if this option is set to false.

Contributing

Generally speaking, this project doesn't accept outside contributions with a couple of exceptions:

  1. Security Vulnerability Reports -- see SECURITY.md
  2. Pull Requests opened against existing open Issues accepting Pull Requests

Thank you for your understanding!