Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Igorkowalski94 committed Aug 30, 2024
1 parent 4a6736f commit 3a44794
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 51 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
<a href="https://github.com/sponsors/Igorkowalski94"><img src="https://img.shields.io/badge/Sponsor-%E2%9D%A4-red" alt="Sponsor" /></a>
</p>

## General information
## 📋 General information

[Playground](https://github.com/Igorkowalski94/eslint-plugin-project-structure-playground) for eslint-plugin-project-structure rules.

Become part of the community!<br>
Leave a ⭐ and share the link with your friends.<br>
If you have any questions or need help creating a configuration that meets your requirements [click here](https://github.com/Igorkowalski94/eslint-plugin-project-structure/discussions), issues / an idea for a new functionality [click here](https://github.com/Igorkowalski94/eslint-plugin-project-structure/issues/new/choose).

## Documentation
## 📚 Documentation

- [Migration guide to 2.2.0.](https://github.com/Igorkowalski94/eslint-plugin-project-structure/blob/main/documentation/migration-to-2.2.0.md)
- [project-structure-folder-structure](https://github.com/Igorkowalski94/eslint-plugin-project-structure/blob/main/documentation/project-structure-folder-structure.md)
Expand Down
33 changes: 13 additions & 20 deletions documentation/project-structure-folder-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@
- Folder recursion. You can nest a given folder structure recursively.
- Fewer repetitions and precise error messages, even for deeply nested folders (recursion), by representing the folder structure as a tree.

## General information
## 📋 General information

[Playground](https://github.com/Igorkowalski94/eslint-plugin-project-structure-playground) for eslint-plugin-project-structure rules.

Become part of the community!<br>
Leave a ⭐ and share the link with your friends.<br>
If you have any questions or need help creating a configuration that meets your requirements, [click here](https://github.com/Igorkowalski94/eslint-plugin-project-structure/discussions), issues / an idea for a new functionality [click here](https://github.com/Igorkowalski94/eslint-plugin-project-structure/issues/new/choose).

## Documentation
## 📚 Documentation

- [Migration guide to 2.2.0.](https://github.com/Igorkowalski94/eslint-plugin-project-structure/blob/main/documentation/migration-to-2.2.0.md)
- [project-structure-independent-modules](https://github.com/Igorkowalski94/eslint-plugin-project-structure/blob/main/documentation/project-structure-independent-modules.md)
- [project-structure-naming-rules](https://github.com/Igorkowalski94/eslint-plugin-project-structure/blob/main/documentation/project-structure-naming-rules.md)

## Go to
## ✈️ Go to

- [Installation](#installation)
- [Getting started](#getting-started)
- [Simple example](#simple-example-for-the-structure-below)
- [Advanced example](#advanced-example-for-the-structure-below)
- [Simple example](#simple-example-for-the-structure-below)
- [Advanced example](#advanced-example-for-the-structure-below)
- [API](#api)
- [ignorePatterns](#ignore-patterns)
- [name](#name)
Expand All @@ -46,9 +46,9 @@ If you have any questions or need help creating a configuration that meets your
- [structure](#structure)
- [rules](#rules)
- [ruleId](#ruleid)
- [Folder recursion](#folder-recursion)
- [Folder recursion](#folder-recursion)

## Installation
## 💾 Installation

```bsh
yarn add -D eslint-plugin-project-structure
Expand All @@ -58,7 +58,7 @@ yarn add -D eslint-plugin-project-structure
npm i --dev eslint-plugin-project-structure
```

## Getting started
## 🏁 Getting started

### Step 1

Expand Down Expand Up @@ -135,6 +135,9 @@ export default tseslint.config(

Create a `folderStructure.mjs` in the root of your project.<br>

> [!WARNING]
> Remember to include `// @ts-check`, otherwise type checking won't be enabled.
> [!NOTE]
> `folderStructure.json` and `folderStructure.yaml` are also supported. See an example in the [playground](https://github.com/Igorkowalski94/eslint-plugin-project-structure-playground) for eslint-plugin-project-structure rules.
Expand All @@ -152,11 +155,6 @@ Create a `folderStructure.mjs` in the root of your project.<br>
└── 📄 ComponentName.tsx
```

#### folderStructure.mjs

> [!WARNING]
> Remember to include `// @ts-check`, otherwise type checking won't be enabled.
```mjs
// @ts-check

Expand Down Expand Up @@ -227,11 +225,6 @@ export const folderStructureConfig = createFolderStructure({
└── 📄 useComplexParentComponentHook.ts
```

#### folderStructure.mjs

> [!WARNING]
> Remember to include `// @ts-check`, otherwise type checking won't be enabled.
```mjs
// @ts-check

Expand Down Expand Up @@ -303,7 +296,7 @@ export const folderStructureConfig = createFolderStructure({
});
```

## API:
## ⚙️ API:

### `ignorePatterns`: `string[] | undefined` <a id="ignore-patterns"></a>

Expand Down Expand Up @@ -620,7 +613,7 @@ This is useful if you want to get rid of a lot of repetition in your structure,
}
```

## Folder recursion
### Folder recursion

You can easily create recursions when you refer to the same [ruleId](#ruleid) that your rule has.<br>
Let's assume you want all files in the `src` folder to follow `{PascalCase}` with any file extension, and all folders to follow `{camelCase}`.<br>
Expand Down
37 changes: 15 additions & 22 deletions documentation/project-structure-independent-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@ where removing or editing one feature triggers a chain reaction that impacts the
- Support for path aliases. The plugin will automatically detect your tsconfig.json and use your settings. There is also an option to enter them manually.
- An option to create a separate configuration file with TypeScript support.

## General information
## 📋 General information

[Playground](https://github.com/Igorkowalski94/eslint-plugin-project-structure-playground) for eslint-plugin-project-structure rules.

Become part of the community!<br>
Leave a ⭐ and share the link with your friends.<br>
If you have any questions or need help creating a configuration that meets your requirements, [click here](https://github.com/Igorkowalski94/eslint-plugin-project-structure/discussions), issues / an idea for a new functionality [click here](https://github.com/Igorkowalski94/eslint-plugin-project-structure/issues/new/choose).

## Documentation
## 📚 Documentation

- [project-structure-folder-structure](https://github.com/Igorkowalski94/eslint-plugin-project-structure/blob/main/documentation/project-structure-folder-structure.md)
- [project-structure-naming-rules](https://github.com/Igorkowalski94/eslint-plugin-project-structure/blob/main/documentation/project-structure-naming-rules.md)

## Go to
## ✈️ Go to

- [Installation](#installation)
- [Getting started](#getting-started)
- [Simple example](#simple-example-for-the-folder-structure-below)
- [Advanced example](#advanced-example-for-the-folder-structure-below)
- [Simple example](#simple-example-for-the-folder-structure-below)
- [Advanced example](#advanced-example-for-the-folder-structure-below)
- [API](#api)
- [tsconfigPath](#tsconfig-path)
- [pathAliases](#path-aliases)
Expand All @@ -44,10 +44,10 @@ If you have any questions or need help creating a configuration that meets your
- [allowExternalImports](#allow-external-imports)
- [reusableImportPatterns](#reusable-import-patterns)
- [debugMode](#debug-mode)
- [{family}](#family)
- [{dirname}](#dirname)
- [{family}](#family)
- [{dirname}](#dirname)

## Installation
## 💾 Installation

```bsh
yarn add -D eslint-plugin-independent-modules
Expand All @@ -57,7 +57,7 @@ yarn add -D eslint-plugin-independent-modules
npm i --dev eslint-plugin-independent-modules
```

## Getting started
## 🏁 Getting started

### Step 1

Expand Down Expand Up @@ -103,6 +103,9 @@ export default tseslint.config({

Create a `independentModules.mjs` in the root of your project.<br>

> [!WARNING]
> Remember to include `// @ts-check`, otherwise type checking won't be enabled.
> [!NOTE]
> `independentModules.json` and `independentModules.yaml` are also supported. See an example in the [playground](https://github.com/Igorkowalski94/eslint-plugin-project-structure-playground) for eslint-plugin-project-structure rules.
Expand Down Expand Up @@ -130,11 +133,6 @@ Create a `independentModules.mjs` in the root of your project.<br>
└── 📄 Feature2.tsx Public.
```

#### independentModules.mjs

> [!WARNING]
> Remember to include `// @ts-check`, otherwise type checking won't be enabled.
```mjs
// @ts-check

Expand Down Expand Up @@ -197,11 +195,6 @@ export const independentModulesConfig = createIndependentModules({
```

#### independentModules.mjs

> [!WARNING]
> Remember to include `// @ts-check`, otherwise type checking won't be enabled.
```mjs
// @ts-check

Expand Down Expand Up @@ -253,7 +246,7 @@ export const independentModulesConfig = createIndependentModules({
});
```

## API:
## ⚙️ API:

### `tsconfigPath`: `string | undefined` <a id="tsconfig-path"></a>

Expand Down Expand Up @@ -515,7 +508,7 @@ The default value is `false`.
{ "debugMode": true }
```

## `{family}` <a id="family"></a>
### `{family}` <a id="family"></a>

`{family}` reference finds the common part between the import and the current file. <br>
By default, at least **two** common parts are required, [`baseUrl`](#path-aliases) is not taken into account.<br>
Expand Down Expand Up @@ -555,7 +548,7 @@ Import = "features/Feature2/Feature2.types.ts"
{family_1} = "features"
```

## `{dirname}` <a id="dirname"></a>
### `{dirname}` <a id="dirname"></a>

Reference to the directory of the file you are currently in.

Expand Down
14 changes: 7 additions & 7 deletions documentation/project-structure-naming-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@
- Build in case validation.
- An option to create a separate configuration file with TypeScript support.

## General information
## 📋 General information

[Playground](https://github.com/Igorkowalski94/eslint-plugin-project-structure-playground) for eslint-plugin-project-structure rules.

Become part of the community!<br>
Leave a ⭐ and share the link with your friends.<br>
If you have any questions or need help creating a configuration that meets your requirements, [click here](https://github.com/Igorkowalski94/eslint-plugin-project-structure/discussions), issues / an idea for a new functionality [click here](https://github.com/Igorkowalski94/eslint-plugin-project-structure/issues/new/choose).

## Documentation
## 📚 Documentation

- [project-structure-folder-structure](https://github.com/Igorkowalski94/eslint-plugin-project-structure/blob/main/documentation/project-structure-folder-structure.md)
- [project-structure-independent-modules](https://github.com/Igorkowalski94/eslint-plugin-project-structure/blob/main/documentation/project-structure-independent-modules.md)

## Go to
## ✈️ Go to

- [Installation](#installation)
- [Getting started](#getting-started)
- [Example](#example)
- [Example](#example)
- [API](#api)
- [filePattern](#file-pattern)
- [fileExportsRules, fileRootRules, fileRules](#file-rules)
Expand All @@ -43,7 +43,7 @@ If you have any questions or need help creating a configuration that meets your
- [format](#format)
- [references](#references)

## Installation
## 💾 Installation

```bsh
yarn add -D eslint-plugin-project-structure
Expand All @@ -53,7 +53,7 @@ yarn add -D eslint-plugin-project-structure
npm i --dev eslint-plugin-project-structure
```

## Getting started
## 🏁 Getting started

Add the following lines to `eslint.config.mjs`.

Expand Down Expand Up @@ -213,7 +213,7 @@ const transformUserData = ({
};
```

## API:
## ⚙️ API:

### `filePattern`: `string | string[]` <a id="file-pattern"></a>

Expand Down

0 comments on commit 3a44794

Please sign in to comment.