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-matrix-org

v1.2.1

Published

ESLint rules and configs used by Matrix.org projects

Downloads

15,857

Readme

eslint-plugin-matrix-org

eslint-plugin-matrix-org contains ESLint rules and configs used by Matrix.org projects. It codifies https://github.com/vector-im/element-web/blob/develop/code_style.md.

This package contains several main ESLint configs for different project styles:

  • matrix-org/javascript: The style for native JavaScript projects.
  • matrix-org/babel: The style for Babel JavaScript projects. It extends matrix-org/javascript.
  • matrix-org/typescript: The style for TypeScript projects. It extends matrix-org/javascript.

There are also some mixin configs that can be used together with any of the above:

  • matrix-org/react: The style for React projects.
  • matrix-org/jest: The style for projects that use Jest for testing.

Getting started

Add this package as a development dependency:

yarn add eslint-plugin-matrix-org --dev

You can then add any of the following to your ESLint config:

Standard native JavaScript

{
    plugins: [
        "matrix-org",
    ],
    extends: [
        "plugin:matrix-org/javascript",
    ]
}

Standard Babel JavaScript

{
    plugins: [
        "matrix-org",
    ],
    extends: [
        "plugin:matrix-org/babel",
    ]
}

Standard TypeScript

{
    plugins: [
        "matrix-org",
    ],
    extends: [
        "plugin:matrix-org/typescript",
    ]
}

Standard native JavaScript with React

{
    plugins: [
        "matrix-org",
    ],
    extends: [
        "plugin:matrix-org/javascript",
        "plugin:matrix-org/react",
    ]
}

Standard Babel JavaScript with React

{
    plugins: [
        "matrix-org",
    ],
    extends: [
        "plugin:matrix-org/babel",
        "plugin:matrix-org/react",
    ]
}

Standard TypeScript with React

{
    plugins: [
        "matrix-org",
    ],
    extends: [
        "plugin:matrix-org/typescript",
        "plugin:matrix-org/react",
    ]
}

Standard TypeScript with React, jsx a11y, and Jest

{
    plugins: [
        "matrix-org",
    ],
    extends: [
        "plugin:matrix-org/typescript",
        "plugin:matrix-org/react",
        "plugin:matrix-org/a11y"
        "plugin:matrix-org/jest"
    ]
}

To require a copyright header:

{
    plugins: [
        "matrix-org",
    ],
    rules: [
        "matrix-org/require-copyright-header": "error",
        // provide a header template as a string to insert on --fix
        // the current year can be inserted into the template with the placeholder `%%CURRENT_YEAR%%`
        "matrix-org/require-copyright-header": ["error", HEADER_TEMPLATE]
    ]
}

This package does not hold any dependencies itself, as it causes conflicts the versions of the same dependencies downstream and also would imply installing the union of all tools. You should expect that you may need to add some of the following depending on the configs you enable:

  • @babel/core
  • @babel/eslint-parser
  • @babel/eslint-plugin
  • @typescript-eslint/eslint-plugin
  • @typescript-eslint/parser
  • eslint
  • eslint-config-google
  • eslint-config-prettier
  • eslint-plugin-deprecate
  • eslint-plugin-jest
  • eslint-plugin-jsx-a11y
  • eslint-plugin-react
  • eslint-plugin-react-hooks
  • eslint-plugin-import
  • eslint-plugin-unicorn
  • prettier
  • typescript

Releasing

Use "Run workflow". Refer to SemVer for versioning semantics. This workflow will bump the version, publish NPM, and create a GitHub release.