Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
docs(readme): rewrite blockquote
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkeyl committed Apr 2, 2024
1 parent 0800ad6 commit 27b9324
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ yarn add -D @archoleat/eslint-flat-compatibility

## Usage

> \[!WARNING]
> Only supports compatibility with extends!
### Before

```js
Expand All @@ -59,11 +62,37 @@ export default defineFlatConfig([
// ...
```
## After
or
```js
import { path } from 'node:path';
import { fileURLToPath } from 'url';

import { defineFlatConfig } from 'eslint-define-config';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
resolvePluginsRelativeTo: __dirname,
});

export default defineFlatConfig([
...compat.extends(
'airbnb-typescript/base',
'plugin:import/recommended',
'plugin:import/typescript',
),
// ...
```
## After
```js
import { compatibility } from '@archoleat/eslint-flat-compatibility';
import { defineFlatConfig } from 'eslint-define-config';

export default defineFlatConfig([
...compatibility(
Expand Down

0 comments on commit 27b9324

Please sign in to comment.