Socket
Book a DemoInstallSign in
Socket

eslint-plugin-redux-reselect

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-redux-reselect

Eslint rules for reduxjs/reselect

1.1.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

eslint-plugin-redux-reselect

Eslint plugin for reduxjs/reselect Selector library for Redux

Install

npm i -D eslint-plugin-redux-reselect

NB! Don't forget to add reselect to eslint config plugins as well as add rules from below to your rules.

Rules

Currently has a few simple rules:

redux-reselect/assign-selector-to-variable

Enforces createSelector result to be directly assigned to the selector function.

incorrect:

const fooSelector = () => createSelector();

correct:

const fooSelector = createSelector();

redux-reselect/prefer-selector-ref

Enforces passing other selectors references into createSelector function

incorrect:

const makeUsers = () => createSelector(...);
const booksSelector = createSelector(
  makeUsers(),
  ...
);

correct:

const usersSelector = createSelector(...);
const booksSelector = createSelector(usersSelector, ...);

redux-reselect/selector-args-type

Enforces passing other selectors into createSelector function either by one array argument containing selectors, or by passing all of the selectors directly to a function (args)

You should specify either of the following options in the eslint config

  • array
  • args

e.g. redux-reselect/selector-args-type: [1, "array"]

redux-reselect/format-selector-name

  • Selector variable name should end with Selector
  • Nothing like makeSelect, select or selector at the start is allowed

incorrect:

const apples = createSelector();
const makeSelectBooks = createSelector();

correct:

const applesSelector = createSelector();
const booksSelector = createSelector();

Keywords

eslint

FAQs

Package last updated on 10 Mar 2019

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.