From ed78cacd7fa44f5fcae024f3ca053853d616ed99 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 8 Aug 2025 13:57:40 +0000 Subject: [PATCH 1/2] Initial plan From 6caa1715d585f87529eb77b8aeee7cc33c1dc5de Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 8 Aug 2025 14:06:10 +0000 Subject: [PATCH 2/2] Update oxlint config to use @eggjs/oxlint-config Co-authored-by: fengmk2 <156269+fengmk2@users.noreply.github.com> --- .oxlintrc.json | 134 +------------------------------------------------ package.json | 1 + 2 files changed, 3 insertions(+), 132 deletions(-) diff --git a/.oxlintrc.json b/.oxlintrc.json index 1dbb0ab2..293dc293 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -1,143 +1,13 @@ { "$schema": "./node_modules/oxlint/configuration_schema.json", + "extends": ["./node_modules/@eggjs/oxlint-config/.oxlintrc.json"], "env": { "node": true, "mocha": true }, - "categories": { - "correctness": "error", - "perf": "error", - "nursery": "error", - "restriction": "error", - "style": "error", - "pedantic": "error", - "suspicious": "error" - }, - "plugins": [ - "import", - "typescript", - "unicorn", - "jsdoc", - "node", - "promise", - "oxc" - ], "rules": { - // eslint - "constructor-super": "error", - "getter-return": "error", - "no-undef": "error", - "no-unreachable": "error", - "no-var": "error", - "no-eq-null": "error", - "no-await-in-loop": "allow", - "eqeqeq": ["error", "smart"], - "init-declarations": "allow", - "curly": "allow", - "no-ternary": "allow", - "max-params": ["error", 5], - "no-await-expression-member": "error", - "no-continue": "allow", - "guard-for-in": "allow", - "func-style": "allow", - "sort-imports": "allow", - "yoda": "allow", - "sort-keys": "allow", - "no-magic-numbers": "allow", - "no-duplicate-imports": "error", - "no-multi-assign": "error", - "func-names": "error", - "default-param-last": "error", - "prefer-object-spread": "error", - "no-undefined": "allow", - "no-plusplus": "allow", - // maybe warn "no-console": "warn", - "no-extraneous-class": "allow", - "no-empty-function": "allow", - "max-depth": ["error", 6], - "max-lines-per-function": "allow", - "no-lonely-if": "error", - "max-lines": "allow", - "require-await": "allow", - "max-nested-callbacks": ["error", 5], - "max-classes-per-file": "allow", - "radix": "allow", - "no-negated-condition": "error", - "no-else-return": "error", - "no-throw-literal": "error", - - // import - "import/exports-last": "allow", - "import/max-dependencies": "allow", - "import/no-cycle": "error", - "import/no-anonymous-default-export": "allow", - "import/no-namespace": "error", - "import/named": "error", - "import/export": "error", - "import/no-default-export": "allow", - "import/unambiguous": "error", - "import/group-exports": "allow", - - // promise - "promise/no-return-wrap": "error", - "promise/param-names": "error", - "promise/prefer-await-to-callbacks": "error", - "promise/prefer-await-to-then": "error", - "promise/prefer-catch": "error", - "promise/no-return-in-finally": "error", - "promise/avoid-new": "error", - - // unicorn - "unicorn/error-message": "error", - "unicorn/no-null": "allow", - "unicorn/filename-case": "allow", - "unicorn/prefer-structured-clone": "error", - "unicorn/prefer-logical-operator-over-ternary": "error", - "unicorn/prefer-number-properties": "error", - "unicorn/prefer-array-some": "error", - "unicorn/prefer-string-slice": "error", - // "unicorn/no-null": "error", - "unicorn/throw-new-error": "error", - "unicorn/catch-error-name": "allow", - "unicorn/prefer-spread": "allow", - "unicorn/numeric-separators-style": "error", - "unicorn/prefer-string-raw": "error", - "unicorn/text-encoding-identifier-case": "error", - "unicorn/no-array-for-each": "error", - "unicorn/explicit-length-check": "error", - "unicorn/no-lonely-if": "error", - "unicorn/no-useless-undefined": "allow", - "unicorn/prefer-date-now": "error", - "unicorn/no-static-only-class": "allow", - "unicorn/no-typeof-undefined": "error", - "unicorn/prefer-negative-index": "error", - "unicorn/no-anonymous-default-export": "allow", - - // oxc - "oxc/no-map-spread": "error", - "oxc/no-rest-spread-properties": "allow", - "oxc/no-optional-chaining": "allow", - "oxc/no-async-await": "allow", - - // typescript - "typescript/explicit-function-return-type": "allow", - "typescript/consistent-type-imports": "error", - "typescript/consistent-type-definitions": "error", - "typescript/consistent-indexed-object-style": "allow", - "typescript/no-inferrable-types": "error", - "typescript/array-type": "error", - "typescript/no-non-null-assertion": "error", - "typescript/no-explicit-any": "error", - "typescript/no-import-type-side-effects": "error", - "typescript/no-dynamic-delete": "error", - "typescript/prefer-ts-expect-error": "error", - "typescript/ban-ts-comment": "error", - "typescript/prefer-enum-initializers": "error", - - // jsdoc - "jsdoc/require-returns": "allow", - "jsdoc/require-param": "allow" + "no-empty-function": "allow" }, "ignorePatterns": ["index.d.ts", "test/fixtures/**", "__snapshots__"] } diff --git a/package.json b/package.json index 300a7fb0..25820304 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ }, "devDependencies": { "@arethetypeswrong/cli": "^0.15.3", + "@eggjs/oxlint-config": "^1.0.0", "@eggjs/tsconfig": "^1.1.0", "@types/mime": "^3.0.1", "@types/ms": "^0.7.31",