mattermost/webapp/platform/eslint-plugin
Harrison Healey 13a6e06093
MM-64380 Remove compass components (#33744)
* Remove Flex component

* Remove Heading component

* Remove StatusIcon component

* Migrate IconButton from Compass Components repo

* Remove unused variants of IconButton and move into GlobalHeader

We only actually used IconButton in a limited set of locations (all
currently in the global header), and if I tried to test other
variations, they seemed to often have issues (like white text on a white
background). Most of those seemed to be because the theme in the
CompassThemeProvider was missing fields and fell back to defaults that
didn't make sense, but there were also enough errors in IconButtonRoot
(like invalid transitions or other logical errors) that lead me to just
rip out everything we don't currently use.

* Remove CompassThemeProvider

* Remove remaining references to @mattermost/compass-components

* Remove prop that's no longer needed
2025-08-20 17:16:11 -04:00
..
configs MM-64380 Remove compass components (#33744) 2025-08-20 17:16:11 -04:00
rules Move the shared ESLint plugin/config into the monorepo (#24670) 2023-10-05 14:47:51 -04:00
index.js Move the shared ESLint plugin/config into the monorepo (#24670) 2023-10-05 14:47:51 -04:00
LICENSE.txt Move the shared ESLint plugin/config into the monorepo (#24670) 2023-10-05 14:47:51 -04:00
package.json Fixathon: Web app dependency updates part 1 (#29036) 2024-11-06 13:40:19 -05:00
README.md Move the shared ESLint plugin/config into the monorepo (#24670) 2023-10-05 14:47:51 -04:00

@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"/>;
}