diff --git a/.eslintrc.js b/.eslintrc.js index d9f2b3ae8e132..c327b2bb0ebf9 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -54,6 +54,28 @@ module.exports = { }, ], '@wordpress/no-unsafe-wp-apis': 'off', + 'no-restricted-imports': [ + 'error', + { + paths: [ + { + name: 'lodash', + importNames: [ 'memoize' ], + message: 'Please use `memize` instead.', + }, + { + name: 'reakit', + message: 'Please use `@wordpress/components` instead.', + }, + { + name: 'redux', + importNames: [ 'combineReducers' ], + message: + 'Please use `combineReducers` from `@wordpress/data` instead.', + }, + ], + }, + ], 'no-restricted-syntax': [ 'error', // NOTE: We can't include the forward slash in our regex or @@ -79,16 +101,6 @@ module.exports = { message: 'Deprecated functions must be removed before releasing this version.', }, - { - 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', - }, { selector: 'CallExpression[callee.object.name="page"][callee.property.name="waitFor"]',