Skip to content

Commit 20dc82f

Browse files
committed
Support oxlint
1 parent f52269c commit 20dc82f

File tree

4 files changed

+27
-6
lines changed

4 files changed

+27
-6
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"changes":{"package.json":"Patch"},"note":"Support oxlint","date":"2026-01-22T15:25:57.906162800Z"}

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ bun add -d eslint-plugin-devup
1818

1919
## Usage
2020

21+
### ESLint
22+
2123
Create an `eslint.config.mjs` file in your project root.
2224

2325
```js
@@ -26,6 +28,16 @@ import { configs } from "eslint-plugin-devup";
2628
export default configs.recommended;
2729
```
2830

31+
### Oxlint
32+
33+
Create an `.oxlintrc.json` file in your project root.
34+
35+
```json
36+
{
37+
"extends": ["eslint-plugin-devup/oxlintrc"]
38+
}
39+
```
40+
2941
## Test
3042

3143
Coverage score must be 100%.

oxlintrc.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
"devup/ui/no-useless-tailing-nulls": "error",
6161
"devup/ui/style-order-range": "error",
6262

63+
"devup/mdx/remark": "error",
64+
6365
"simple-import-sort/imports": "error",
6466
"simple-import-sort/exports": "error",
6567

src/oxlint.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// @ts-ignore - named export for rules
1212
import { rules as devupUiRules } from '@devup-ui/eslint-plugin'
1313
import type { Rule } from 'eslint'
14-
// @ts-ignore
14+
import { rules as mdxRules } from 'eslint-plugin-mdx'
1515
import eslintPluginPrettier from 'eslint-plugin-prettier'
1616

1717
import { appPage, component, componentInterface } from './rules'
@@ -49,13 +49,16 @@ function toKebabCase(str: string): string {
4949
}
5050

5151
/**
52-
* Build wrapped devup-ui rules with "ui/" prefix
52+
* Build wrapped rules from external plugin with prefix
5353
*/
54-
function buildDevupUiRules(): Record<string, Rule.RuleModule> {
54+
function buildWrappedRules(
55+
externalRules: Record<string, unknown>,
56+
prefix: string,
57+
): Record<string, Rule.RuleModule> {
5558
const rules: Record<string, Rule.RuleModule> = {}
56-
for (const [name, rule] of Object.entries(devupUiRules)) {
59+
for (const [name, rule] of Object.entries(externalRules)) {
5760
const kebabName = toKebabCase(name)
58-
rules[`ui/${kebabName}`] = wrapRuleForOxlint(
61+
rules[`${prefix}/${kebabName}`] = wrapRuleForOxlint(
5962
rule as unknown as Rule.RuleModule,
6063
)
6164
}
@@ -80,7 +83,10 @@ const plugin = {
8083
prettier: wrapRuleForOxlint(eslintPluginPrettier.rules!.prettier),
8184

8285
// @devup-ui/eslint-plugin rules (auto-wrapped for oxlint compatibility)
83-
...buildDevupUiRules(),
86+
...buildWrappedRules(devupUiRules, 'ui'),
87+
88+
// eslint-plugin-mdx rules (auto-wrapped for oxlint compatibility)
89+
...buildWrappedRules(mdxRules, 'mdx'),
8490
},
8591
}
8692

0 commit comments

Comments
 (0)