From 436ba93986bf6f9a57b768dc47580f52eac49bc6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 9 Aug 2025 12:22:03 +0000 Subject: [PATCH 1/2] Initial plan From b64a896760f2195b2b732ab6b9cd70a4e1c126c7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 9 Aug 2025 12:30:48 +0000 Subject: [PATCH 2/2] Migrate from eslint to oxlint with @eggjs/oxlint-config Co-authored-by: fengmk2 <156269+fengmk2@users.noreply.github.com> --- .eslintrc | 6 ------ .oxlintrc.json | 45 +++++++++++++++++++++++++++++++++++++++++++++ package.json | 8 ++++---- 3 files changed, 49 insertions(+), 10 deletions(-) delete mode 100644 .eslintrc create mode 100644 .oxlintrc.json diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 9bcdb46..0000000 --- a/.eslintrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": [ - "eslint-config-egg/typescript", - "eslint-config-egg/lib/rules/enforce-node-prefix" - ] -} diff --git a/.oxlintrc.json b/.oxlintrc.json new file mode 100644 index 0000000..29677c6 --- /dev/null +++ b/.oxlintrc.json @@ -0,0 +1,45 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "env": { + "node": true, + "mocha": true + }, + "extends": [ + "./node_modules/@eggjs/oxlint-config/.oxlintrc.json" + ], + "rules": { + "typescript/no-explicit-any": "allow", + "typescript/prefer-function-type": "allow", + "typescript/no-non-null-assertion": "allow", + "typescript/prefer-ts-expect-error": "allow", + "typescript/no-inferrable-types": "allow", + "typescript/prefer-for-of": "allow", + "promise/prefer-await-to-callbacks": "allow", + "promise/prefer-await-to-then": "allow", + "unicorn/no-array-for-each": "allow", + "unicorn/numeric-separators-style": "allow", + "unicorn/prefer-global-this": "allow", + "unicorn/prefer-date-now": "allow", + "unicorn/no-await-expression-member": "allow", + "unicorn/consistent-assert": "allow", + "unicorn/consistent-function-scoping": "allow", + "unicorn/prefer-event-target": "allow", + "unicorn/prefer-number-properties": "allow", + "unicorn/prefer-type-error": "allow", + "import/no-named-as-default": "allow", + "import/no-named-as-default-member": "allow", + "import/no-unassigned-import": "allow", + "jsdoc/check-tag-names": "allow", + "require-yield": "allow", + "import/no-namespace": "allow", + "func-names": "allow", + "max-params": "allow", + "max-nested-callbacks": "allow", + "no-empty-function": "allow", + "no-else-return": "allow", + "no-lonely-if": "allow", + "no-negated-condition": "allow", + "no-unused-expressions": "allow", + "no-useless-escape": "allow" + } +} \ No newline at end of file diff --git a/package.json b/package.json index ab42421..a460d28 100644 --- a/package.json +++ b/package.json @@ -26,11 +26,11 @@ "devDependencies": { "@arethetypeswrong/cli": "^0.17.1", "@eggjs/bin": "7", + "@eggjs/oxlint-config": "1", "@eggjs/tsconfig": "1", "@types/mocha": "10", "@types/node": "22", - "eslint": "8", - "eslint-config-egg": "14", + "oxlint": "1", "pedding": "^2.0.1", "should": "^13.2.3", "tshy": "3", @@ -38,8 +38,8 @@ "typescript": "5" }, "scripts": { - "lint": "eslint --cache src test --ext .ts", - "pretest": "npm run lint -- --fix && npm run prepublishOnly", + "lint": "oxlint src test", + "pretest": "npm run lint && npm run prepublishOnly", "test": "egg-bin test", "preci": "npm run lint && npm run prepublishOnly && attw --pack", "ci": "egg-bin cov",