Skip to content
Merged
Show file tree
Hide file tree
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
25 changes: 25 additions & 0 deletions oxlint-plugin.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Oxlint JS plugin which provides built-in ESLint rules.
*/

import assert from "node:assert";
import { builtinRules } from "eslint/use-at-your-own-risk";

import type { Rule } from "eslint";

// ESLint rules to export in this plugin
const RULES = ["prefer-const"];

const rules: Record<string, Rule.RuleModule> = {};
for (const ruleName of RULES) {
const rule = builtinRules.get(ruleName);
assert(rule != null, `Cannot find rule '${ruleName}'`);
rules[ruleName] = rule;
}

export default {
meta: {
name: "eslint-js",
},
rules,
};
4 changes: 3 additions & 1 deletion oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"promise",
"vitest"
],
"jsPlugins": ["./oxlint-plugin.mts"],
"categories": {
"correctness": "error",
"perf": "error"
Expand All @@ -21,7 +22,8 @@
"prefer-destructuring": ["error", {
"VariableDeclarator": { "array": false, "object": true }
}],
"typescript/consistent-indexed-object-style": ["error", "record"]
"typescript/consistent-indexed-object-style": ["error", "record"],
"eslint-js/prefer-const": ["error", { "destructuring": "all" }]
},
"overrides": [
{
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@arethetypeswrong/core": "0.18.2",
"@napi-rs/cli": "catalog:",
"emnapi": "1.6.0",
"eslint": "^9.39.1",
"oxfmt": "^0.16.0",
"oxlint": "^1.29.0",
"oxlint-tsgolint": "0.8.3",
Expand Down
90 changes: 90 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading