mirror of
https://github.com/mattermost/mattermost.git
synced 2026-02-03 20:40:00 -05:00
* 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 |
||
|---|---|---|
| .. | ||
| configs | ||
| rules | ||
| index.js | ||
| LICENSE.txt | ||
| package.json | ||
| README.md | ||
@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());
};
}
use-external-link
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"/>;
}