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

@garavest/eslint-config

v2.1.1

Published

A highly opinionated ESLint Config used by Garavest LLC for internal and public projects.

Downloads

2

Readme

@garavest/eslint-config

npm version Github Actions Known Vulnerabilities

This package provides Garavest's eslint.config.js as an extendable, shareable config.

Usage

To use our config, you must use the new ESLint Flat Config, otherwise our config will result in errors. Our config is designed around using TypeScript; however, our config will also check your JavaScript files. Assuming you are using a Flat Config, using our config is very simple.

Standalone Usage

If you don't intend to extend (or modify) our config, import the config object, and then use the default config as shown below.

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

/** @type {import("eslint").Linter.FlatConfig[]} */
export default garavest.default;

Extended Usage

If you do wish to extend our config, you will need to export an array with our config spread in it as shown below:

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

/** @type {import("eslint").Linter.FlatConfig[]} */
export default [
  ...garavest.default
  // Your other configuration can go here
];

Alternatively, if you wish to take only parts of our config, you can spread parts of our config into your own. In the example below, we'll say you are only using Javascript.

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

/** @type {import("eslint").Linter.FlatConfig[]} */
export default [garavest.global, garavest.prettier, garavest.javascript];

Framework Support

You can bake your own framework support in or, optionally, we provide a config for Svelte that can be used with or without SvelteKit. To enable this, you can simply use the following snippet for the default config:

NOTE

The prettier plugin does NOT work with svelte because it checks for the parser which is not supported in flat configs. Therefore, you cannot use the default config with svelte.

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

/** @type {import("eslint").Linter.FlatConfig[]} */
export default [
  garavest.global,
  garavest.import,
  garavest.javascript,
  garavest.typescript,
  garavest.stylistic,
  garavest.svelte
];

API

TL;DR

Our package exports the following:

export const garavest = {
  default: defaultConfig,
  global: globalConfig,
  import: importConfig,
  javascript: javascriptConfig,
  prettier: prettierConfig,
  stylistic: stylisticConfig,
  svelte: svelteConfig,
  typescript: typescriptConfig
};

The API of the config is pretty simple. The config exports a single object called garavest that contains all the flat configs. Each config is documented below.

IMPORTANT NOTE

Nowhere in our config do we define a sourceType (except for eslint-plugin-import); however, we ALWAYS set the ecmaVersion to latest. We do this so that you can use whatever ecmaFeatures you want (that ESLint supports), but you are not locked into using modules or commonjs. Since sourceType is never defined, ESLint will default to what you specify in your package.json.

default

The default config is our "recommended" config with Javascript, Prettier, Typescript, Import, and Stylistic support enabled by default. The default config is functionally equivalent to the code snippet below.

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

/** @type {import("eslint").Linter.FlatConfig[]} */
export default [
  garavest.global,
  garavest.prettier,
  garavest.import,
  garavest.javascript,
  garavest.typescript,
  garavest.stylistic
];

global

The global config just sets some useful global options for ESLint. It can safely be omitted, if you prefer. The options set are:

  • ignore all files in the globalIgnores array
  • set ecmaVersion to "latest"
  • set reportUnusedDisableDirectives to true

NOTE

In version 3, the noInlineConfig option will also be turned on, so if you encounter bugs, let us know.

javascript

The javascript config contains all of the Javascript rules we use.

prettier

The prettier config basically just enables the Prettier plugin and enables Prettier errors.

svelte

The svelte config contains all of the Svelte/SvelteKit rules we use.

typescript

The typescript config contains all of the Typescript rules we use.

stylistic

The stylistic config contains our stylistic rules.