In my case I wanted to avoid importing unused modules into a built JS bundle for a lambda environment using a shared codebase. Using a nested eslint file I could prevent this kind of import: import {ModelA, ModelB} from 'src/models'
and instead encourage this kind of import: import {ModelA} from 'src/models/model-a'
{
"rules": {
"no-restricted-imports": [
"error",
{
// prevent barrel file imports to have more control over what ends up in the js bundle
"patterns": ["src/models", "!src/models/"]