Skip to content

Commit

Permalink
Testing: Prevent of direct usage of Reakit
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Jan 11, 2021
1 parent 0050135 commit 1c334db
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"]',
Expand Down

0 comments on commit 1c334db

Please sign in to comment.