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

eslint-plugin-wkovacs64

v16.2.0

Published

@wKovacs64 ESLint plugin

Downloads

3,204

Readme

eslint-plugin-wkovacs64

My personal ESLint plugin.

npm Version Build Status

Install

npm install --save-dev eslint-plugin-wkovacs64

Be sure to install the appropriately versioned eslint peer dependency as well.

Usage

Several ESLint configs come bundled with this plugin. To use them, simply extend the relevant config(s) in your project's ESLint settings.

Core Configs

First, choose a single "core" config. It must come before the other configurations (described below) in your extends array.

| Project Type | Extends | | --------------- | -------------------------- | | Base (no React) | 'plugin:wkovacs64/base' | | React | 'plugin:wkovacs64/react' |

Feature Configs

Next, you may augment the core configuration by applying any combination of "feature" configs.

| Feature | Extends | | --------------- | ------------------------------------ | | Jest | 'plugin:wkovacs64/jest' | | jest-dom | 'plugin:wkovacs64/jest-dom' | | Testing Library | 'plugin:wkovacs64/testing-library' | | TypeScript | 'plugin:wkovacs64/typescript' |

⚠️ The typescript feature config requires the parserOptions.project property to be set in your ESLint config. See the TypeScript parser options for more information.

  • If you're using Cypress, you may need to add ignorePatterns: ['cypress.config.ts'] to your ESLint config.
  • If you're using the jest feature config, you may need to disable the @typescript-eslint/unbound-method rule and enable the jest/unbound-method rule instead.

Prettier Configs

Finally, you may apply the Prettier config. This must be last in your extends array.

| Extends | | ------------ | | 'prettier' |

Examples

Base "vanilla JS" project with Jest and Prettier:

module.exports = {
  extends: ['plugin:wkovacs64/base', 'plugin:wkovacs64/jest', 'prettier'],
};

React project with Jest, jest-dom, Testing Library, and Prettier:

module.exports = {
  extends: [
    'plugin:wkovacs64/react',
    'plugin:wkovacs64/jest',
    'plugin:wkovacs64/jest-dom',
    'plugin:wkovacs64/testing-library',
    'prettier',
  ],
};

Base project with Jest, TypeScript, and Prettier:

module.exports = {
  extends: [
    'plugin:wkovacs64/base',
    'plugin:wkovacs64/jest',
    'plugin:wkovacs64/typescript',
    'prettier',
  ],
  parserOptions: {
    project: 'tsconfig.json',
  },
};

Kitchen sink:

module.exports = {
  extends: [
    'plugin:wkovacs64/react',
    'plugin:wkovacs64/jest',
    'plugin:wkovacs64/jest-dom',
    'plugin:wkovacs64/testing-library',
    'plugin:wkovacs64/typescript',
    'prettier',
  ],
  parserOptions: {
    project: 'tsconfig.json',
  },
  ignorePatterns: ['cypress.config.ts'],
  overrides: [
    {
      files: ['src/**/*.test.ts'],
      rules: {
        '@typescript-eslint/unbound-method': 'off',
        'jest/unbound-method': 'error',
      },
    },
  ],
};

Inspiration

The dependency management overhead of separate shareable ESLint configs for each scenario finally got to me. At the time of this writing, I no longer care if I get peerDependency warnings about TypeScript in non-TypeScript projects (for example) anymore if it means managing a single dependency (this package). The implementation details of this project were heavily inspired by @shopify/eslint-plugin.

Warning

The resolution of the "bundled" plugins may only be working as a happy accident due to Yarn (flatter node_modules) and possibly ESLint hoisting (unreliable). But until ESLint provides an official way to include plugins as dependencies of shared configs, this will have to do. For reference:

License

This module is distributed under the MIT License.