From 4efd7ef178c10aabc1c93f5f83553947a754ef2c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 9 Aug 2025 12:14:35 +0000 Subject: [PATCH 1/3] Initial plan From 9e7fa3e5999a017504b12c9ce5cec954b9d804e2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 9 Aug 2025 12:19:41 +0000 Subject: [PATCH 2/3] Initial exploration and dependency installation for oxlint migration Co-authored-by: fengmk2 <156269+fengmk2@users.noreply.github.com> --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index de1d812..588c1b9 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ }, "devDependencies": { "@arethetypeswrong/cli": "^0.17.1", + "@eggjs/oxlint-config": "^1.0.0", "@eggjs/tsconfig": "^1.3.3", "@types/escape-html": "^1.0.4", "@types/mocha": "^10.0.6", @@ -30,6 +31,7 @@ "moment": "^2.22.2", "object-assign": "^4.1.1", "optimized": "^1.2.0", + "oxlint": "^1.11.1", "time-require": "^0.1.2", "tsd": "^0.28.1", "tshy": "^3.0.2", From 2a531d0bbf3b70ce6e8ce12a190609b958bc1e8b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 9 Aug 2025 12:23:49 +0000 Subject: [PATCH 3/3] Complete migration from ESLint to oxlint with @eggjs/oxlint-config Co-authored-by: fengmk2 <156269+fengmk2@users.noreply.github.com> --- .eslintrc | 6 ------ .oxlintrc.json | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 4 +--- 3 files changed, 51 insertions(+), 9 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..e90d357 --- /dev/null +++ b/.oxlintrc.json @@ -0,0 +1,50 @@ +{ + "$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/no-non-null-assertion": "allow", + "typescript/prefer-ts-expect-error": "allow", + "typescript/array-type": "allow", + "typescript/prefer-for-of": "allow", + "typescript/no-inferrable-types": "allow", + "typescript/consistent-type-imports": "allow", + "import/no-namespace": "allow", + "import/consistent-type-specifier-style": "allow", + "import/no-duplicates": "allow", + "no-useless-escape": "allow", + "prefer-exponentiation-operator": "allow", + "new-cap": "allow", + "func-names": "allow", + "no-empty-function": "allow", + "prefer-object-has-own": "allow", + "no-throw-literal": "allow", + "no-void": "allow", + "no-template-curly-in-string": "allow", + "no-duplicate-imports": "allow", + "promise/avoid-new": "allow", + "promise/param-names": "allow", + "promise/prefer-await-to-callbacks": "allow", + "promise/prefer-await-to-then": "allow", + "unicorn/no-new-array": "allow", + "unicorn/consistent-assert": "allow", + "unicorn/no-array-for-each": "allow", + "unicorn/numeric-separators-style": "allow", + "unicorn/prefer-code-point": "allow", + "unicorn/prefer-global-this": "allow", + "unicorn/prefer-string-replace-all": "allow", + "unicorn/prefer-type-error": "allow", + "unicorn/switch-case-braces": "allow", + "unicorn/prefer-string-raw": "allow", + "unicorn/prefer-number-properties": "allow", + "unicorn/prefer-string-slice": "allow", + "jsdoc/check-tag-names": "allow", + "jsdoc/no-defaults": "allow" + } +} \ No newline at end of file diff --git a/package.json b/package.json index 588c1b9..2270095 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "2.5.0", "description": "A collection of useful utilities.", "scripts": { - "lint": "eslint src test --ext ts", + "lint": "oxlint src test", "pretest": "npm run lint -- --fix && npm run prepublishOnly", "test": "egg-bin test", "test-local": "egg-bin test", @@ -26,8 +26,6 @@ "beautify-benchmark": "^0.2.4", "benchmark": "^2.1.4", "egg-bin": "^6.5.2", - "eslint": "^8.54.0", - "eslint-config-egg": "^13.0.0", "moment": "^2.22.2", "object-assign": "^4.1.1", "optimized": "^1.2.0",