Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: commonjs example #1901

Merged
merged 1 commit into from
Nov 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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