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

stryker-eslint-plugin-meta-ignorer

v1.0.4

Published

Stryker ignorer for the meta property of ESLint plugin rules

Downloads

7

Readme

Stryker ESLint plugin meta ignorer

Provides an ignorer plugin for Stryker, for use in an ESLint plugin. It ignores the meta property of a rule, which contains a type, documentation and a schema.

Installation

Assuming you have Stryker installed and configured:

npm install --save-dev stryker-eslint-plugin-meta-ignorer

In your stryker.conf.mjs file, add or update the following two sections:

export default {
  ...,
  ignorers: ['ignore-meta'],
  plugins: ['@stryker-mutator/*', 'stryker-eslint-plugin-meta-ignorer']
};

What happens

A typical ESLint plugin will export a rule with some metadata:

export const theRule = {
  meta: {
    type: 'problem',
    docs: {
      description: '...',
    },
    schema: [],
  },
};

It's not very useful to have a coverage report for this data. Instead of manually asking Stryker to ignore (with // Stryker disable), this plugin will ignore it for you.

Ignored meta

It does this by looking for any object with a meta property that has at least the type, docs and schema properties (with the corresponding types).

A real example:

Ignored meta full example

Development

Start with npm install --force.

Linting is performed with npm run lint.

The tests are organized into two flavors.

  • The first is unit tests: npm run test:unit
    • These run the shouldIgnore, method that Stryker uses for the ignorer, directly with babel for traversal.
    • They use the fixtures as code and check that there is an ignored part or not, as appropriate.
    • They are the coverage measurers that Stryker uses for the testing of this package, via stryker-package.conf.mjs
  • The next is integration tests: npm run test:integration
    • These run the shouldIgnore method indirectly, using Stryker itself.
    • Each of the fixtures is given to Stryker as code to be mutated. The test code covers each fixture (from generator.test.mjs) in order to not let surviving mutants through.
    • The output generated by Stryker (as JSON) is then compared with a known "good" snapshot. The "good"ness was determined by checking whether Stryker actually ignores the parts it should in its output HTML.

The tests in generator.test.mjs and unit.test.mjs should stay aligned. See the prepack script for the typical order in which to run these.