New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mattermost/eslint-plugin

Package Overview
Dependencies
Maintainers
8
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mattermost/eslint-plugin

ESLint configuration and custom rules used by Mattermost

  • 1.1.0-0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
321
decreased by-23.57%
Maintainers
8
Weekly downloads
 
Created
Source

@mattermost/eslint-plugin

An ESLint plugin containing the configuration used by Mattermost as well as support for custom rules specific to the Mattermost code base.

Custom Rules

no-dispatch-getstate

Prevents passing a redux store's getState into its dispatch as an unnecessary second argument.

We started doing this accidentally at some point because of a misunderstanding about how redux-thunk worked, so this stops anyone from making that same mistake again.

Examples of incorrect code for this rule:

export function someAction() {
    return (dispatch, getState) => {
        dispatch(doSomething(), getState);
    };
}

Examples of correct code for this rule:

export function someAction() {
    return (dispatch) => {
        dispatch(doSomething());
    };
}

Ensures that any link which opens a URL outside of Mattermost using target="_blank" uses the ExternalLink component.

Examples of incorrect code for this rule:

export function SomeLink() {
    return (
        <a
            href="https://example.com"
            target="_blank"
            rel="noopener noreferrer"
        />
    );
}

Examples of correct code for this rule:

import ExternalLink from 'components/external_link';

export function SomeLink() {
    return <ExternalLink href="https://example.com"/>;
}

FAQs

Package last updated on 07 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc