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

@nightgrey/eslint-config

v1.0.0-alpha.3

Published

**This configuration is still in alpha and currently being tested.**

Downloads

1

Readme

@nightgrey/eslint-config [ALPHA]

This configuration is still in alpha and currently being tested.

This package provides grey's ESLint configuration. It provides opinionated defaults for TypeScript projects with a few different (optional) flavours.

If you want to use this configuration or even just parts of it as a base for your own configuration, the configuration is modular, and you can install just parts of it to construct your own configuration, too.

Attention: This configuration is written in ESLint's flat configuration style. You can read more about it in the ESLint documentation.

Features

  • TypeScript configuration
  • Opinionated configuration
  • Modular configuration split in bases, addons and overrides.
    • Bases provide the core configuration.
    • Addons provide appropriate plugins and common-sense rules. For example, eslint-config-addon-jest provides the Jest plugin, automatically applies globals for Node.js, and makes sure dev dependency in *.test.[ext] files are allowed!
    • Overrides provide rules for specific files. For example, eslint-config-override-development-files allows imports of dev dependencies in the project root.

Packages

Configuration

Addons

Bases

Overrides

Table of Contents

Getting started

npm install --save-dev @nightgrey/eslint-config

eslint.config.js

const nightgreyEslintConfig = require('@nightgrey/eslint-config');
const globals = require('globals');

/** @type {import('eslint').Linter.FlatConfig} */
const configuration = {
  // Your own configuration goes here, after the base configuration.

  // Important: You have to set your own language options depending on your project.
  // This code here assumes a CommonJS  project with ES2021 globals and TypeScript.
  // For more information, see https://eslint.org/docs/user-guide/configuring/language-options
  languageOptions: {
    sourceType: 'commonjs',
    parserOptions: {
      ecmaVersion: 'latest',
      project: './tsconfig.json',
    },
    globals: {
      ...globals.node,
      ...globals.es2021,
    },
  },
};

// Then, make sure to export the configuration array and to spread `nightgreyEslintConfig` first!

/** @type {Array<import('eslint').Linter.FlatConfig>} */
module.exports = [...nightgreyEslintConfig, configuration];

Usage

To use addons or overrides, you have to install them as dependencies and add them to your configuration.

This is a configuration with all addons and overrides installed.

eslint.config.js

const eslintConfigGreys = require('@nightgrey/eslint-config');
const { prettierAddon } = require('@nightgrey/eslint-config-addon-prettier');
const { reactAddon } = require('@nightgrey/eslint-config-addon-react');
const { nextAddon } = require('@nightgrey/eslint-config-addon-next');
const { jestAddon } = require('@nightgrey/eslint-config-addon-jest');
const { vitestAddon } = require('@nightgrey/eslint-config-addon-vitest');
const {
  developmentFilesOverrides,
} = require('@nightgrey/eslint-config-override-development-files');
const {
  indexFilesOverrides,
} = require('@nightgrey/eslint-config-override-index-files');
const {
  testingLibraryReactAddon,
} = require('@nightgrey/eslint-config-addon-testing-library-react');
const globals = require('globals');

/** @type {import('eslint').Linter.FlatConfig} */
const configuration = {
  // Your own configuration goes here.
  // See `Getting started` above for an example.
};

// Order:
// 1. Bases (or eslintConfigGrey)
// 2. Addons
// 3. Your configuration
// 4. Overrides
// Always last: Prettier addon

/** @type {Array<import('eslint').Linter.FlatConfig>} */
module.exports = [
  // Bases
  ...eslintConfigGrey,
  // Addons
  reactAddon,
  nextAddon,
  jestAddon,
  testingLibraryReactAddon,
  // Your configuration
  configuration,
  // Overrides have to be added after addons and your own configuration.
  developmentFilesOverrides,
  indexFilesOverrides,
  // Important: It is recommended to add the prettier addon last.
  prettierAddon,
];