diff --git a/docs/rules/no-reaching-inside.md b/docs/rules/no-reaching-inside.md index 5c620e285..031723d28 100644 --- a/docs/rules/no-reaching-inside.md +++ b/docs/rules/no-reaching-inside.md @@ -46,9 +46,9 @@ The following patterns are considered problems: * in my-project/entry.js */ -import { settings } from './app/index'; // Reaching into "./app" is not allowed -import userReducer from './reducer/user'; // Reaching into "./reducer" is not allowed -import configureStore from './redux/configureStore'; // Reaching into "./redux" is not allowed +import { settings } from './app/index'; // Reaching to "./app/index" is not allowed +import userReducer from './reducer/user'; // Reaching to "./reducer/user" is not allowed +import configureStore from './redux/configureStore'; // Reaching to "./redux/configureStore" is not allowed ``` The following patterns are NOT considered problems: diff --git a/tests/src/rules/no-reaching-inside.js b/tests/src/rules/no-reaching-inside.js index 508f19070..eb63ed512 100644 --- a/tests/src/rules/no-reaching-inside.js +++ b/tests/src/rules/no-reaching-inside.js @@ -56,6 +56,18 @@ ruleTester.run('no-reaching-inside', rule, { ], invalid: [ + test({ + code: 'import "./plugin2/index.js";\nimport "./plugin2/app/index"', + filename: testFilePath('./reaching-inside/plugins/plugin.js'), + options: [ { + allow: [ '*/index.js' ], + } ], + errors: [ { + message: 'Reaching to "./plugin2/app/index" is not allowed.', + line: 2, + column: 8, + } ], + }), test({ code: 'import "./app/index.js"', filename: testFilePath('./reaching-inside/plugins/plugin2/internal.js'),