1.1.3 • Published 8 years ago

eslint-plugin-trove v1.1.3

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

Eslint Plugin Trove Build Status

Rules

module-boundary:

  • Cannot reach into top-level notion-modules packages

no-state-prop:

  • Cannot access state properties directly inside mapStateToProps, must use function like getStatePropertyX(state)
  • Cannot access state properties directly inside createSelector

module-boundary

This rule will check all import/require to ensure it does not reach into a top-level notion-modules package

Valid
import { actionCreators } from 'notion-modules/thread';
Invalid
import { actionCreators } from 'notion-modules/thread/message';

no-state-prop

This rule will check mapStateToProps for code trying to access state properties directly.

Valid
import { connect } from 'react-redux';
import { getItem } from './selectors';

const App = () => {};

connect((state) => {
  return {
    item: getItem(state),
  };
})(App);
Invalid
import { connect } from 'react-redux';

const App = () => {};

connect((state) => {
  return {
    item: state.item,
  };
})(App);

This rule will check createSelector for code trying to access state properties directly.

Valid
import { createSelector } from 'reselect';
const getItem = (state) => state.item;

const getItemOpen = createSelector(
  getItem,
  (item) => item.open
);
Invalid
import { createSelector } from 'reselect';

const getItem = createSelector(
  (state) => state.item,
  (item) => item
);
1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago