Skip to content

Commit

Permalink
docs: commonjs example
Browse files Browse the repository at this point in the history
  • Loading branch information
mightyiam committed Nov 16, 2024
1 parent 8d32bfc commit ae7ef4e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ It is expected that most version bumps will be major.

## Example config

Here is an example `eslint.config.js`.
Here are example [ESLint configuration files](https://eslint.org/docs/latest/use/configure/configuration-files).

ECMAScript Modules:

```js
import love from 'eslint-config-love'
Expand All @@ -44,6 +46,21 @@ export default [
]
```

CommonJS:

```js
module.exports = (async function config() {
const { default: love } = await import('eslint-config-love')

return [
{
...love,
files: ['**/*.js', '**/*.ts'],
},
]
})()
```

[Learn how to configure ESLint](https://eslint.org/docs/latest/use/configure/).

Note: the config exported by this package sets `languageOptions.parserOptions.project = true`.
Expand Down

0 comments on commit ae7ef4e

Please sign in to comment.