From b991d2e00c97d47cc0589b866cd9fb0bce8890e8 Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Thu, 25 Jul 2019 10:55:35 -0400 Subject: [PATCH 1/2] Core Data: Use combineReducers from data module --- packages/core-data/src/queried-data/reducer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/core-data/src/queried-data/reducer.js b/packages/core-data/src/queried-data/reducer.js index 2ddf82f9045f46..8e78544dcdbe2f 100644 --- a/packages/core-data/src/queried-data/reducer.js +++ b/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 */ From 76b772f908ca0183df3019d6f3c531db2aeab21d Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Thu, 25 Jul 2019 10:55:46 -0400 Subject: [PATCH 2/2] Framework: Restrict combineReducers usage to data module --- .eslintrc.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index 64ce20d480d398..2a6ad63b1eafc7 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -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',