Skip to content

Commit bd4c495

Browse files
authored
Framework: Restrict combineReducers usage to data module (#16752)
* Core Data: Use combineReducers from data module * Framework: Restrict combineReducers usage to data module
1 parent bed7e0c commit bd4c495

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ module.exports = {
5757
selector: 'CallExpression[callee.name=/^(__|_x|_n|_nx)$/] Literal[value=/\\.{3}/]',
5858
message: 'Use ellipsis character (…) in place of three dots',
5959
},
60+
{
61+
selector: 'ImportDeclaration[source.value="redux"] Identifier.imported[name="combineReducers"]',
62+
message: 'Use `combineReducers` from `@wordpress/data`',
63+
},
6064
{
6165
selector: 'ImportDeclaration[source.value="lodash"] Identifier.imported[name="memoize"]',
6266
message: 'Use memize instead of Lodash’s memoize',

packages/core-data/src/queried-data/reducer.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
/**
22
* External dependencies
33
*/
4-
import { combineReducers } from 'redux';
54
import { keyBy, map, flowRight } from 'lodash';
65

6+
/**
7+
* WordPress dependencies
8+
*/
9+
import { combineReducers } from '@wordpress/data';
10+
711
/**
812
* Internal dependencies
913
*/

0 commit comments

Comments
 (0)