Skip to content

Latest commit

 

History

History
53 lines (39 loc) · 978 Bytes

forbid.md

File metadata and controls

53 lines (39 loc) · 978 Bytes

index/forbid

Use this rule to forbid files named index

👎 Fail

The following file structure will fail the check

entities
└── book
    ├── model
    |   └── index.ts
    └── ui
        ├── card.tsx
        ├── row.tsx
        └── index.ts

If entities/book/ui/index.ts looks like this:

export { Card } from "./card";
export { Row } from "./row";

And entities/book/model/index.ts looks like this:

import { createEvent, createStore } from "effector";

const addBook = createEvent();

export const $books = createStore([]).on(addBook, (list, book) => [
  ...list,
  book,
]);

👍 Pass

To pass the check, the file structure can be changed as follows

entities
└── book
    ├── model.ts
    └── ui
        ├── card.tsx
        └── row.tsx

index.js files containing only re-exports should be deleted, other modules should be renamed.