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 de1d812..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", @@ -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", @@ -25,11 +26,10 @@ "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", + "oxlint": "^1.11.1", "time-require": "^0.1.2", "tsd": "^0.28.1", "tshy": "^3.0.2",