Skip to content

Commit

Permalink
Framework: Restrict combineReducers usage to data module (#16752)
Browse files Browse the repository at this point in the history
* Core Data: Use combineReducers from data module

* Framework: Restrict combineReducers usage to data module
  • Loading branch information
aduth committed Jul 25, 2019
1 parent bed7e0c commit bd4c495
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .eslintrc.js
Expand Up @@ -57,6 +57,10 @@ module.exports = {
selector: 'CallExpression[callee.name=/^(__|_x|_n|_nx)$/] Literal[value=/\\.{3}/]',
message: 'Use ellipsis character (…) in place of three dots',
},
{
selector: 'ImportDeclaration[source.value="redux"] Identifier.imported[name="combineReducers"]',
message: 'Use `combineReducers` from `@wordpress/data`',
},
{
selector: 'ImportDeclaration[source.value="lodash"] Identifier.imported[name="memoize"]',
message: 'Use memize instead of Lodash’s memoize',
Expand Down
6 changes: 5 additions & 1 deletion packages/core-data/src/queried-data/reducer.js
@@ -1,9 +1,13 @@
/**
* External dependencies
*/
import { combineReducers } from 'redux';
import { keyBy, map, flowRight } from 'lodash';

/**
* WordPress dependencies
*/
import { combineReducers } from '@wordpress/data';

/**
* Internal dependencies
*/
Expand Down

0 comments on commit bd4c495

Please sign in to comment.