Skip to content

Commit

Permalink
docs: Update README (#92)
Browse files Browse the repository at this point in the history
* docs: Update README

* Update code example
  • Loading branch information
nzakas authored Oct 7, 2022
1 parent 56755d9 commit adafd11
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ESLintRC Library

This repository contains the legacy ESLintRC configuration file format for ESLint.
This repository contains the legacy ESLintRC configuration file format for ESLint. This package is not intended for use outside of the ESLint ecosystem. It is ESLint-specific and not intended for use in other programs.

**Note:** This package is not intended for use outside of the ESLint ecosystem. It is ESLint-specific and not intended for use in other programs.
**Note:** This package is frozen except for critical bug fixes as ESLint moves to a new config system.

## Installation

Expand All @@ -16,14 +16,18 @@ npm install @eslint/eslintrc --save-dev
yarn add @eslint/eslintrc -D
```

## Future Usage

**Note:** This package is not intended for public use at this time. The following is an example of how it will be used in the future.
## Usage

The primary class in this package is `FlatCompat`, which is a utility to translate ESLintRC-style configs into flat configs. Here's how you use it inside of your `eslint.config.js` file:

```js
import { FlatCompat } from "@eslint/eslintrc";
import path from "path";
import { fileURLToPath } from "url";

// mimic CommonJS variables -- not needed if using CommonJS
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname, // optional; default: process.cwd()
Expand Down

0 comments on commit adafd11

Please sign in to comment.