Skip to content

Commit 2a53fcb

Browse files
committed
docs: add usage add a standalone ESLint plugin
close #295
1 parent 2c007d0 commit 2a53fcb

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ It started as a fork of [`eslint-plugin-import`] using [`get-tsconfig`] to repla
2828
- [Configuration (new: `eslint.config.*`)](#configuration-new-eslintconfig)
2929
- [JS example](#js-example)
3030
- [Typescript example](#typescript-example)
31+
- [As a standalone ESLint plugin](#as-a-standalone-eslint-plugin)
3132
- [Configuration (legacy: `.eslintrc*`)](#configuration-legacy-eslintrc)
3233
- [TypeScript](#typescript)
3334
- [Rules](#rules)
@@ -139,6 +140,28 @@ export default [
139140
> [!NOTE]
140141
> A complete list of available configuration can be found in [config/flat folders](src/config/flat)
141142
143+
### As a standalone ESLint plugin
144+
145+
```js
146+
import { importX } from 'eslint-plugin-import-x'
147+
148+
export default [
149+
{
150+
plugins: {
151+
'import-x': importX,
152+
},
153+
languageOptions: {
154+
ecmaVersion: 'latest',
155+
sourceType: 'module',
156+
},
157+
rules: {
158+
'import-x/no-dynamic-require': 'warn',
159+
'import-x/no-nodejs-modules': 'warn',
160+
},
161+
},
162+
]
163+
```
164+
142165
## Configuration (legacy: `.eslintrc*`)
143166

144167
> [!TIP]

0 commit comments

Comments
 (0)