Skip to content

Commit e1684a5

Browse files
overlookmotelcamc314Copilot
authored
docs(linter/plugins): document plugin aliases (#712)
* docs(linter/plugins): document plugin aliases * Update src/docs/guide/usage/linter/js-plugins.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Cameron <cameron.clark@hey.com> --------- Signed-off-by: Cameron <cameron.clark@hey.com> Co-authored-by: Cameron <cameron.clark@hey.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 811cc2c commit e1684a5

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/docs/guide/usage/linter/js-plugins.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,38 @@ Paths are resolved relative to the config file itself.
5050
}
5151
```
5252

53+
### Plugin aliases
54+
55+
You can also define a different name (alias) for a plugin. This is useful if:
56+
57+
- Plugin name clashes with name of a native Oxlint plugin.
58+
- Plugin name is very long.
59+
- You want to use a plugin that Oxlint supports natively, but a specific rule you need is not yet implemented in Oxlint's native version.
60+
61+
```json
62+
{
63+
"jsPlugins": [
64+
// `jsdoc` is a reserved name, as Oxlint supports it natively
65+
{
66+
"name": "jsdoc-js",
67+
"specifier": "eslint-plugin-jsdoc"
68+
},
69+
// Shorten name
70+
{
71+
"name": "short",
72+
"specifier": "eslint-plugin-with-name-so-very-very-long"
73+
},
74+
// List plugins you don't want to alias as just specifiers
75+
"eslint-plugin-whatever"
76+
],
77+
"rules": {
78+
"jsdoc-js/check-alignment": "error",
79+
"short/rule1": "error",
80+
"whatever/rule2": "error"
81+
}
82+
}
83+
```
84+
5385
## Writing JS plugins
5486

5587
### ESLint-compatible API

0 commit comments

Comments
 (0)