Use this rule to allow only import
and export
statements in index
files.
The following file structure will fail the check
pages
└── catalog
├── content/
├── sidebar/
└── index.tsx
If pages/catalog/index.ts
looks like this:
import Content from "./content";
import Sidebar from "./sidebar";
export const Page = () => {
return (
<React.Fragment>
<Sidebar />
<Content />
</React.Fragment>
);
};
To pass the check, the file structure can be changed as follows
pages
└── catalog
├── content/
├── sidebar/
└── page.tsx
index.js
files should be either deleted or renamed.