Skip to content

Commit

Permalink
docs: πŸ“ add how to use typescript configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmy-guzman committed Nov 13, 2024
1 parent d52dfec commit 3e28585
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
## πŸ› οΈ Usage

_For a better experience, make sure to use [@jimmy.codes/prettier-config](https://github.com/jimmy-guzman/prettier-config) as well_
> [!NOTE]
> For a better experience, make sure to use [@jimmy.codes/prettier-config](https://github.com/jimmy-guzman/prettier-config) as well.
### πŸ”¨ Getting Started

Expand All @@ -29,18 +30,30 @@ import jimmyDotCodes from "@jimmy.codes/eslint-config";
export default jimmyDotCodes();
```

And if you're using [VS Code](https://code.visualstudio.com), make sure to enable [flat configuration](https://eslint.org/docs/v8.x/use/configure/configuration-files-new):
Or if you want to use [TypeScript configuration files](https://eslint.org/docs/latest/use/configure/configuration-files#typescript-configuration-files), you can do the following:

```jsonc
// .vscode/settings.json
Add `--flag unstable_ts_config` to your eslint script for example:

```json
{
"eslint.useFlatConfig": true,
"scripts": {
"lint": "eslint --flag unstable_ts_config ."
}
}
```

And add the following to your `.vscode/settings.json`:

```json
"eslint.options": {
"flags": ["unstable_ts_config"]
}
```

### πŸ”§ Configuration

**By default all rules are enabled based on the project's dependencies.**
> [!NOTE]
> By default all rules are enabled based on the project's dependencies.
This package contains rules that can be enabled or disabled as follows:

Expand Down Expand Up @@ -71,7 +84,7 @@ export default jimmyDotCodes({
});
```

Or you can turn off auto detection to enable rules based on a project's dependencies
Or you can turn off auto detection to enable rules based on a project's dependencies:

```js
import jimmyDotCodes from "@jimmy.codes/eslint-config";
Expand Down

0 comments on commit 3e28585

Please sign in to comment.