From c53b1c1f78ab2ac790cf7d3d8d22810e440a47e9 Mon Sep 17 00:00:00 2001 From: gcch Date: Mon, 30 Mar 2026 15:50:50 +0200 Subject: [PATCH] =?UTF-8?q?en=20cours:=20r=C3=A8gles=20ESLint/Oxlint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - eslint --- bun.lock | 66 +++---- dist/index.mjs | 366 ++++++++++++++++++++++++++++++-------- index.ts | 12 +- justfile | 26 +-- package.json | 10 +- rules/eslint.ts | 424 +++++++++++++++++++++++++++++++++++++------- rules/old-eslint.ts | 87 +++++++++ 7 files changed, 799 insertions(+), 192 deletions(-) create mode 100644 rules/old-eslint.ts diff --git a/bun.lock b/bun.lock index 07231e0..a10b341 100644 --- a/bun.lock +++ b/bun.lock @@ -6,8 +6,8 @@ "name": "@gcch/configuration-oxlint", "dependencies": { "globals": "^17.4.0", - "oxlint": "^1.57.0", - "oxlint-tsgolint": "^0.18.1", + "oxlint": "^1.58.0", + "oxlint-tsgolint": "^0.19.0", }, "devDependencies": { "@arethetypeswrong/core": "^0.18.2", @@ -19,7 +19,7 @@ "eslint-plugin-jsx-a11y": "^6.10.2", "eslint-plugin-perfectionist": "^5.7.0", "eslint-plugin-sonarjs": "^4.0.2", - "knip": "^6.1.0", + "knip": "^6.1.1", "prettier": "^3.8.1", "publint": "^0.3.18", "tsdown": "^0.21.7", @@ -34,8 +34,8 @@ "eslint-plugin-jsx-a11y": "^6.10.2", "eslint-plugin-perfectionist": "^5.7.0", "eslint-plugin-sonarjs": "^4.0.2", - "oxlint": "^1.57.0", - "oxlint-tsgolint": "^0.18.1", + "oxlint": "^1.58.0", + "oxlint-tsgolint": "^0.19.0", "typescript": "^6.0.2", }, }, @@ -200,55 +200,55 @@ "@oxc-resolver/binding-win32-x64-msvc": ["@oxc-resolver/binding-win32-x64-msvc@11.19.1", "", { "os": "win32", "cpu": "x64" }, "sha512-6hIU3RQu45B+VNTY4Ru8ppFwjVS/S5qwYyGhBotmjxfEKk41I2DlGtRfGJndZ5+6lneE2pwloqunlOyZuX/XAw=="], - "@oxlint-tsgolint/darwin-arm64": ["@oxlint-tsgolint/darwin-arm64@0.18.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-CxSd15ZwHn70UJFTXVvy76bZ9zwI097cVyjvUFmYRJwvkQF3VnrTf2oe1gomUacErksvtqLgn9OKvZhLMYwvog=="], + "@oxlint-tsgolint/darwin-arm64": ["@oxlint-tsgolint/darwin-arm64@0.19.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-FVOIp5Njte8Z6PpINz7sL5blqSro0pAL8VAHYQ+K5Xm4cOrPQ6DGIhH14oXnbRjzn8Kl69qjz8TPteyn8EqwsQ=="], - "@oxlint-tsgolint/darwin-x64": ["@oxlint-tsgolint/darwin-x64@0.18.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-LE7VW/T/VcKhl3Z1ev5BusrxdlQ3DWweSeOB+qpBeur2h8+vCWq+M7tCO29C7lveBDfx1+rNwj4aiUVlA+Qs+g=="], + "@oxlint-tsgolint/darwin-x64": ["@oxlint-tsgolint/darwin-x64@0.19.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-GakDTDACePvqOFq3N4oQCl8SyMMa7VBnqV0gDcXPuK50jdWCUqlxM9tgRJarjyIVvmDEJRGYOen+4uBtVwg4Aw=="], - "@oxlint-tsgolint/linux-arm64": ["@oxlint-tsgolint/linux-arm64@0.18.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-2AG8YIXVJJbnM0rcsJmzzWOjZXBu5REwowgUpbHZueF7OYM3wR7Xu8pXEpAojEHAtYYZ3X4rpPoetomkJx7kCw=="], + "@oxlint-tsgolint/linux-arm64": ["@oxlint-tsgolint/linux-arm64@0.19.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-Ya0R7somo+KDhhkPtENJ9Q28Fost+aqA3MPe86pEqgmukHFc/KO65PgShOSbIFjZNptELEQvsWL8gDxYZWhH3w=="], - "@oxlint-tsgolint/linux-x64": ["@oxlint-tsgolint/linux-x64@0.18.1", "", { "os": "linux", "cpu": "x64" }, "sha512-f8vDYPEdiwpA2JaDEkadTXfuqIgweQ8zcL4SX75EN2kkW2oAynjN7cd8m86uXDgB0JrcyOywbRtwnXdiIzXn2A=="], + "@oxlint-tsgolint/linux-x64": ["@oxlint-tsgolint/linux-x64@0.19.0", "", { "os": "linux", "cpu": "x64" }, "sha512-yFH378jWc1k/oJmpk+TKpWbKvFieJJvsOHxVMSNFc+ukqs44ZSHVt4HFfAhXAt/bzVK2f7EIDTGp8Hm1OjoJ6Q=="], - "@oxlint-tsgolint/win32-arm64": ["@oxlint-tsgolint/win32-arm64@0.18.1", "", { "os": "win32", "cpu": "arm64" }, "sha512-fBdML05KMDAL9ebWeoHIzkyI86Eq6r9YH5UDRuXJ9vAIo1EnKo0ti7hLUxNdc2dy2FF/T4k98p5wkkXvLyXqfA=="], + "@oxlint-tsgolint/win32-arm64": ["@oxlint-tsgolint/win32-arm64@0.19.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-R6NyAtha7OWxh7NGBeFxqDTGAVl1Xj4xLa8Qj39PKbIDqBeVW8BIb+1nEnRp+Mo/VpRoeoFAcqlBsuMcUMd26Q=="], - "@oxlint-tsgolint/win32-x64": ["@oxlint-tsgolint/win32-x64@0.18.1", "", { "os": "win32", "cpu": "x64" }, "sha512-cYZMhNrsq9ZZ3OUWHyawqiS+c8HfieYG0zuZP2LbEuWWPfdZM/22iAlo608J+27G1s9RXQhvgX6VekwWbXbD7A=="], + "@oxlint-tsgolint/win32-x64": ["@oxlint-tsgolint/win32-x64@0.19.0", "", { "os": "win32", "cpu": "x64" }, "sha512-2ePvxcbS5tPOmrQvxR8Kc+IqzdTtlrGeMDv+jjTYfkTFPmh2rF9yxVchi/4WM6js3gt2UauQeMV/tfnZNemENQ=="], - "@oxlint/binding-android-arm-eabi": ["@oxlint/binding-android-arm-eabi@1.57.0", "", { "os": "android", "cpu": "arm" }, "sha512-C7EiyfAJG4B70496eV543nKiq5cH0o/xIh/ufbjQz3SIvHhlDDsyn+mRFh+aW8KskTyUpyH2LGWL8p2oN6bl1A=="], + "@oxlint/binding-android-arm-eabi": ["@oxlint/binding-android-arm-eabi@1.58.0", "", { "os": "android", "cpu": "arm" }, "sha512-1T7UN3SsWWxpWyWGn1cT3ASNJOo+pI3eUkmEl7HgtowapcV8kslYpFQcYn431VuxghXakPNlbjRwhqmR37PFOg=="], - "@oxlint/binding-android-arm64": ["@oxlint/binding-android-arm64@1.57.0", "", { "os": "android", "cpu": "arm64" }, "sha512-9i80AresjZ/FZf5xK8tKFbhQnijD4s1eOZw6/FHUwD59HEZbVLRc2C88ADYJfLZrF5XofWDiRX/Ja9KefCLy7w=="], + "@oxlint/binding-android-arm64": ["@oxlint/binding-android-arm64@1.58.0", "", { "os": "android", "cpu": "arm64" }, "sha512-GryzujxuiRv2YFF7bRy8mKcxlbuAN+euVUtGJt9KKbLT8JBUIosamVhcthLh+VEr6KE6cjeVMAQxKAzJcoN7dg=="], - "@oxlint/binding-darwin-arm64": ["@oxlint/binding-darwin-arm64@1.57.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-0eUfhRz5L2yKa9I8k3qpyl37XK3oBS5BvrgdVIx599WZK63P8sMbg+0s4IuxmIiZuBK68Ek+Z+gcKgeYf0otsg=="], + "@oxlint/binding-darwin-arm64": ["@oxlint/binding-darwin-arm64@1.58.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-7/bRSJIwl4GxeZL9rPZ11anNTyUO9epZrfEJH/ZMla3+/gbQ6xZixh9nOhsZ0QwsTW7/5J2A/fHbD1udC5DQQA=="], - "@oxlint/binding-darwin-x64": ["@oxlint/binding-darwin-x64@1.57.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-UvrSuzBaYOue+QMAcuDITe0k/Vhj6KZGjfnI6x+NkxBTke/VoM7ZisaxgNY0LWuBkTnd1OmeQfEQdQ48fRjkQg=="], + "@oxlint/binding-darwin-x64": ["@oxlint/binding-darwin-x64@1.58.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-EqdtJSiHweS2vfILNrpyJ6HUwpEq2g7+4Zx1FPi4hu3Hu7tC3znF6ufbXO8Ub2LD4mGgznjI7kSdku9NDD1Mkg=="], - "@oxlint/binding-freebsd-x64": ["@oxlint/binding-freebsd-x64@1.57.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-wtQq0dCoiw4bUwlsNVDJJ3pxJA218fOezpgtLKrbQqUtQJcM9yP8z+I9fu14aHg0uyAxIY+99toL6uBa2r7nxA=="], + "@oxlint/binding-freebsd-x64": ["@oxlint/binding-freebsd-x64@1.58.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-VQt5TH4M42mY20F545G637RKxV/yjwVtKk2vfXuazfReSIiuvWBnv+FVSvIV5fKVTJNjt3GSJibh6JecbhGdBw=="], - "@oxlint/binding-linux-arm-gnueabihf": ["@oxlint/binding-linux-arm-gnueabihf@1.57.0", "", { "os": "linux", "cpu": "arm" }, "sha512-qxFWl2BBBFcT4djKa+OtMdnLgoHEJXpqjyGwz8OhW35ImoCwR5qtAGqApNYce5260FQqoAHW8S8eZTjiX67Tsg=="], + "@oxlint/binding-linux-arm-gnueabihf": ["@oxlint/binding-linux-arm-gnueabihf@1.58.0", "", { "os": "linux", "cpu": "arm" }, "sha512-fBYcj4ucwpAtjJT3oeBdFBYKvNyjRSK+cyuvBOTQjh0jvKp4yeA4S/D0IsCHus/VPaNG5L48qQkh+Vjy3HL2/Q=="], - "@oxlint/binding-linux-arm-musleabihf": ["@oxlint/binding-linux-arm-musleabihf@1.57.0", "", { "os": "linux", "cpu": "arm" }, "sha512-SQoIsBU7J0bDW15/f0/RvxHfY3Y0+eB/caKBQtNFbuerTiA6JCYx9P1MrrFTwY2dTm/lMgTSgskvCEYk2AtG/Q=="], + "@oxlint/binding-linux-arm-musleabihf": ["@oxlint/binding-linux-arm-musleabihf@1.58.0", "", { "os": "linux", "cpu": "arm" }, "sha512-0BeuFfwlUHlJ1xpEdSD1YO3vByEFGPg36uLjK1JgFaxFb4W6w17F8ET8sz5cheZ4+x5f2xzdnRrrWv83E3Yd8g=="], - "@oxlint/binding-linux-arm64-gnu": ["@oxlint/binding-linux-arm64-gnu@1.57.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-jqxYd1W6WMeozsCmqe9Rzbu3SRrGTyGDAipRlRggetyYbUksJqJKvUNTQtZR/KFoJPb+grnSm5SHhdWrywv3RQ=="], + "@oxlint/binding-linux-arm64-gnu": ["@oxlint/binding-linux-arm64-gnu@1.58.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-TXlZgnPTlxrQzxG9ZXU7BNwx1Ilrr17P3GwZY0If2EzrinqRH3zXPc3HrRcBJgcsoZNMuNL5YivtkJYgp467UQ=="], - "@oxlint/binding-linux-arm64-musl": ["@oxlint/binding-linux-arm64-musl@1.57.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-i66WyEPVEvq9bxRUCJ/MP5EBfnTDN3nhwEdFZFTO5MmLLvzngfWEG3NSdXQzTT3vk5B9i6C2XSIYBh+aG6uqyg=="], + "@oxlint/binding-linux-arm64-musl": ["@oxlint/binding-linux-arm64-musl@1.58.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-zSoYRo5dxHLcUx93Stl2hW3hSNjPt99O70eRVWt5A1zwJ+FPjeCCANCD2a9R4JbHsdcl11TIQOjyigcRVOH2mw=="], - "@oxlint/binding-linux-ppc64-gnu": ["@oxlint/binding-linux-ppc64-gnu@1.57.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-oMZDCwz4NobclZU3pH+V1/upVlJZiZvne4jQP+zhJwt+lmio4XXr4qG47CehvrW1Lx2YZiIHuxM2D4YpkG3KVA=="], + "@oxlint/binding-linux-ppc64-gnu": ["@oxlint/binding-linux-ppc64-gnu@1.58.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-NQ0U/lqxH2/VxBYeAIvMNUK1y0a1bJ3ZicqkF2c6wfakbEciP9jvIE4yNzCFpZaqeIeRYaV7AVGqEO1yrfVPjA=="], - "@oxlint/binding-linux-riscv64-gnu": ["@oxlint/binding-linux-riscv64-gnu@1.57.0", "", { "os": "linux", "cpu": "none" }, "sha512-uoBnjJ3MMEBbfnWC1jSFr7/nSCkcQYa72NYoNtLl1imshDnWSolYCjzb8LVCwYCCfLJXD+0gBLD7fyC14c0+0g=="], + "@oxlint/binding-linux-riscv64-gnu": ["@oxlint/binding-linux-riscv64-gnu@1.58.0", "", { "os": "linux", "cpu": "none" }, "sha512-X9J+kr3gIC9FT8GuZt0ekzpNUtkBVzMVU4KiKDSlocyQuEgi3gBbXYN8UkQiV77FTusLDPsovjo95YedHr+3yg=="], - "@oxlint/binding-linux-riscv64-musl": ["@oxlint/binding-linux-riscv64-musl@1.57.0", "", { "os": "linux", "cpu": "none" }, "sha512-BdrwD7haPZ8a9KrZhKJRSj6jwCor+Z8tHFZ3PT89Y3Jq5v3LfMfEePeAmD0LOTWpiTmzSzdmyw9ijneapiVHKQ=="], + "@oxlint/binding-linux-riscv64-musl": ["@oxlint/binding-linux-riscv64-musl@1.58.0", "", { "os": "linux", "cpu": "none" }, "sha512-CDze3pi1OO3Wvb/QsXjmLEY4XPKGM6kIo82ssNOgmcl1IdndF9VSGAE38YLhADWmOac7fjqhBw82LozuUVxD0Q=="], - "@oxlint/binding-linux-s390x-gnu": ["@oxlint/binding-linux-s390x-gnu@1.57.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-BNs+7ZNsRstVg2tpNxAXfMX/Iv5oZh204dVyb8Z37+/gCh+yZqNTlg6YwCLIMPSk5wLWIGOaQjT0GUOahKYImw=="], + "@oxlint/binding-linux-s390x-gnu": ["@oxlint/binding-linux-s390x-gnu@1.58.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-b/89glbxFaEAcA6Uf1FvCNecBJEgcUTsV1quzrqXM/o4R1M4u+2KCVuyGCayN2UpsRWtGGLb+Ver0tBBpxaPog=="], - "@oxlint/binding-linux-x64-gnu": ["@oxlint/binding-linux-x64-gnu@1.57.0", "", { "os": "linux", "cpu": "x64" }, "sha512-AghS18w+XcENcAX0+BQGLiqjpqpaxKJa4cWWP0OWNLacs27vHBxu7TYkv9LUSGe5w8lOJHeMxcYfZNOAPqw2bg=="], + "@oxlint/binding-linux-x64-gnu": ["@oxlint/binding-linux-x64-gnu@1.58.0", "", { "os": "linux", "cpu": "x64" }, "sha512-0/yYpkq9VJFCEcuRlrViGj8pJUFFvNS4EkEREaN7CB1EcLXJIaVSSa5eCihwBGXtOZxhnblWgxks9juRdNQI7w=="], - "@oxlint/binding-linux-x64-musl": ["@oxlint/binding-linux-x64-musl@1.57.0", "", { "os": "linux", "cpu": "x64" }, "sha512-E/FV3GB8phu/Rpkhz5T96hAiJlGzn91qX5yj5gU754P5cmVGXY1Jw/VSjDSlZBCY3VHjsVLdzgdkJaomEmcNOg=="], + "@oxlint/binding-linux-x64-musl": ["@oxlint/binding-linux-x64-musl@1.58.0", "", { "os": "linux", "cpu": "x64" }, "sha512-hr6FNvmcAXiH+JxSvaJ4SJ1HofkdqEElXICW9sm3/Rd5eC3t7kzvmLyRAB3NngKO2wzXRCAm4Z/mGWfrsS4X8w=="], - "@oxlint/binding-openharmony-arm64": ["@oxlint/binding-openharmony-arm64@1.57.0", "", { "os": "none", "cpu": "arm64" }, "sha512-xvZ2yZt0nUVfU14iuGv3V25jpr9pov5N0Wr28RXnHFxHCRxNDMtYPHV61gGLhN9IlXM96gI4pyYpLSJC5ClLCQ=="], + "@oxlint/binding-openharmony-arm64": ["@oxlint/binding-openharmony-arm64@1.58.0", "", { "os": "none", "cpu": "arm64" }, "sha512-R+O368VXgRql1K6Xar+FEo7NEwfo13EibPMoTv3sesYQedRXd6m30Dh/7lZMxnrQVFfeo4EOfYIP4FpcgWQNHg=="], - "@oxlint/binding-win32-arm64-msvc": ["@oxlint/binding-win32-arm64-msvc@1.57.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-Z4D8Pd0AyHBKeazhdIXeUUy5sIS3Mo0veOlzlDECg6PhRRKgEsBJCCV1n+keUZtQ04OP+i7+itS3kOykUyNhDg=="], + "@oxlint/binding-win32-arm64-msvc": ["@oxlint/binding-win32-arm64-msvc@1.58.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-Q0FZiAY/3c4YRj4z3h9K1PgaByrifrfbBoODSeX7gy97UtB7pySPUQfC2B/GbxWU6k7CzQrRy5gME10PltLAFQ=="], - "@oxlint/binding-win32-ia32-msvc": ["@oxlint/binding-win32-ia32-msvc@1.57.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-StOZ9nFMVKvevicbQfql6Pouu9pgbeQnu60Fvhz2S6yfMaii+wnueLnqQ5I1JPgNF0Syew4voBlAaHD13wH6tw=="], + "@oxlint/binding-win32-ia32-msvc": ["@oxlint/binding-win32-ia32-msvc@1.58.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-Y8FKBABrSPp9H0QkRLHDHOSUgM/309a3IvOVgPcVxYcX70wxJrk608CuTg7w+C6vEd724X5wJoNkBcGYfH7nNQ=="], - "@oxlint/binding-win32-x64-msvc": ["@oxlint/binding-win32-x64-msvc@1.57.0", "", { "os": "win32", "cpu": "x64" }, "sha512-6PuxhYgth8TuW0+ABPOIkGdBYw+qYGxgIdXPHSVpiCDm+hqTTWCmC739St1Xni0DJBt8HnSHTG67i1y6gr8qrA=="], + "@oxlint/binding-win32-x64-msvc": ["@oxlint/binding-win32-x64-msvc@1.58.0", "", { "os": "win32", "cpu": "x64" }, "sha512-bCn5rbiz5My+Bj7M09sDcnqW0QJyINRVxdZ65x1/Y2tGrMwherwK/lpk+HRQCKvXa8pcaQdF5KY5j54VGZLwNg=="], "@pkgr/core": ["@pkgr/core@0.2.9", "", {}, "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA=="], @@ -678,7 +678,7 @@ "keyv": ["keyv@4.5.4", "", { "dependencies": { "json-buffer": "3.0.1" } }, "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw=="], - "knip": ["knip@6.1.0", "", { "dependencies": { "@nodelib/fs.walk": "^1.2.3", "fast-glob": "^3.3.3", "formatly": "^0.3.0", "get-tsconfig": "4.13.7", "jiti": "^2.6.0", "minimist": "^1.2.8", "oxc-parser": "^0.121.0", "oxc-resolver": "^11.19.1", "picocolors": "^1.1.1", "picomatch": "^4.0.1", "smol-toml": "^1.6.1", "strip-json-comments": "5.0.3", "unbash": "^2.2.0", "yaml": "^2.8.2", "zod": "^4.1.11" }, "bin": { "knip": "bin/knip.js", "knip-bun": "bin/knip-bun.js" } }, "sha512-n5eVbJP7HXmwTsiJcELWJe2O1ESxyCTNxJzRTIECDYDTM465qnqk7fL2dv6ae3NUFvFWorZvGlh9mcwxwJ5Xgw=="], + "knip": ["knip@6.1.1", "", { "dependencies": { "@nodelib/fs.walk": "^1.2.3", "fast-glob": "^3.3.3", "formatly": "^0.3.0", "get-tsconfig": "4.13.7", "jiti": "^2.6.0", "minimist": "^1.2.8", "oxc-parser": "^0.121.0", "oxc-resolver": "^11.19.1", "picocolors": "^1.1.1", "picomatch": "^4.0.1", "smol-toml": "^1.6.1", "strip-json-comments": "5.0.3", "unbash": "^2.2.0", "yaml": "^2.8.2", "zod": "^4.1.11" }, "bin": { "knip": "bin/knip.js", "knip-bun": "bin/knip-bun.js" } }, "sha512-BC/kbdxwCgv+p/3YkGbtlLxbOXhQDuR+CeKKFEpJyKb3BFwG1gZa+CMWSqAnPi+kUexz74m327d3zWxyn2fMew=="], "language-subtag-registry": ["language-subtag-registry@0.3.23", "", {}, "sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ=="], @@ -784,9 +784,9 @@ "oxc-resolver": ["oxc-resolver@11.19.1", "", { "optionalDependencies": { "@oxc-resolver/binding-android-arm-eabi": "11.19.1", "@oxc-resolver/binding-android-arm64": "11.19.1", "@oxc-resolver/binding-darwin-arm64": "11.19.1", "@oxc-resolver/binding-darwin-x64": "11.19.1", "@oxc-resolver/binding-freebsd-x64": "11.19.1", "@oxc-resolver/binding-linux-arm-gnueabihf": "11.19.1", "@oxc-resolver/binding-linux-arm-musleabihf": "11.19.1", "@oxc-resolver/binding-linux-arm64-gnu": "11.19.1", "@oxc-resolver/binding-linux-arm64-musl": "11.19.1", "@oxc-resolver/binding-linux-ppc64-gnu": "11.19.1", "@oxc-resolver/binding-linux-riscv64-gnu": "11.19.1", "@oxc-resolver/binding-linux-riscv64-musl": "11.19.1", "@oxc-resolver/binding-linux-s390x-gnu": "11.19.1", "@oxc-resolver/binding-linux-x64-gnu": "11.19.1", "@oxc-resolver/binding-linux-x64-musl": "11.19.1", "@oxc-resolver/binding-openharmony-arm64": "11.19.1", "@oxc-resolver/binding-wasm32-wasi": "11.19.1", "@oxc-resolver/binding-win32-arm64-msvc": "11.19.1", "@oxc-resolver/binding-win32-ia32-msvc": "11.19.1", "@oxc-resolver/binding-win32-x64-msvc": "11.19.1" } }, "sha512-qE/CIg/spwrTBFt5aKmwe3ifeDdLfA2NESN30E42X/lII5ClF8V7Wt6WIJhcGZjp0/Q+nQ+9vgxGk//xZNX2hg=="], - "oxlint": ["oxlint@1.57.0", "", { "optionalDependencies": { "@oxlint/binding-android-arm-eabi": "1.57.0", "@oxlint/binding-android-arm64": "1.57.0", "@oxlint/binding-darwin-arm64": "1.57.0", "@oxlint/binding-darwin-x64": "1.57.0", "@oxlint/binding-freebsd-x64": "1.57.0", "@oxlint/binding-linux-arm-gnueabihf": "1.57.0", "@oxlint/binding-linux-arm-musleabihf": "1.57.0", "@oxlint/binding-linux-arm64-gnu": "1.57.0", "@oxlint/binding-linux-arm64-musl": "1.57.0", "@oxlint/binding-linux-ppc64-gnu": "1.57.0", "@oxlint/binding-linux-riscv64-gnu": "1.57.0", "@oxlint/binding-linux-riscv64-musl": "1.57.0", "@oxlint/binding-linux-s390x-gnu": "1.57.0", "@oxlint/binding-linux-x64-gnu": "1.57.0", "@oxlint/binding-linux-x64-musl": "1.57.0", "@oxlint/binding-openharmony-arm64": "1.57.0", "@oxlint/binding-win32-arm64-msvc": "1.57.0", "@oxlint/binding-win32-ia32-msvc": "1.57.0", "@oxlint/binding-win32-x64-msvc": "1.57.0" }, "peerDependencies": { "oxlint-tsgolint": ">=0.15.0" }, "optionalPeers": ["oxlint-tsgolint"], "bin": { "oxlint": "bin/oxlint" } }, "sha512-DGFsuBX5MFZX9yiDdtKjTrYPq45CZ8Fft6qCltJITYZxfwYjVdGf/6wycGYTACloauwIPxUnYhBVeZbHvleGhw=="], + "oxlint": ["oxlint@1.58.0", "", { "optionalDependencies": { "@oxlint/binding-android-arm-eabi": "1.58.0", "@oxlint/binding-android-arm64": "1.58.0", "@oxlint/binding-darwin-arm64": "1.58.0", "@oxlint/binding-darwin-x64": "1.58.0", "@oxlint/binding-freebsd-x64": "1.58.0", "@oxlint/binding-linux-arm-gnueabihf": "1.58.0", "@oxlint/binding-linux-arm-musleabihf": "1.58.0", "@oxlint/binding-linux-arm64-gnu": "1.58.0", "@oxlint/binding-linux-arm64-musl": "1.58.0", "@oxlint/binding-linux-ppc64-gnu": "1.58.0", "@oxlint/binding-linux-riscv64-gnu": "1.58.0", "@oxlint/binding-linux-riscv64-musl": "1.58.0", "@oxlint/binding-linux-s390x-gnu": "1.58.0", "@oxlint/binding-linux-x64-gnu": "1.58.0", "@oxlint/binding-linux-x64-musl": "1.58.0", "@oxlint/binding-openharmony-arm64": "1.58.0", "@oxlint/binding-win32-arm64-msvc": "1.58.0", "@oxlint/binding-win32-ia32-msvc": "1.58.0", "@oxlint/binding-win32-x64-msvc": "1.58.0" }, "peerDependencies": { "oxlint-tsgolint": ">=0.18.0" }, "optionalPeers": ["oxlint-tsgolint"], "bin": { "oxlint": "bin/oxlint" } }, "sha512-t4s9leczDMqlvOSjnbCQe7gtoLkWgBGZ7sBdCJ9EOj5IXFSG/X7OAzK4yuH4iW+4cAYe8kLFbC8tuYMwWZm+Cg=="], - "oxlint-tsgolint": ["oxlint-tsgolint@0.18.1", "", { "optionalDependencies": { "@oxlint-tsgolint/darwin-arm64": "0.18.1", "@oxlint-tsgolint/darwin-x64": "0.18.1", "@oxlint-tsgolint/linux-arm64": "0.18.1", "@oxlint-tsgolint/linux-x64": "0.18.1", "@oxlint-tsgolint/win32-arm64": "0.18.1", "@oxlint-tsgolint/win32-x64": "0.18.1" }, "bin": { "tsgolint": "bin/tsgolint.js" } }, "sha512-Hgb0wMfuXBYL0ddY+1hAG8IIfC40ADwPnBuUaC6ENAuCtTF4dHwsy7mCYtQ2e7LoGvfoSJRY0+kqQRiembJ/jQ=="], + "oxlint-tsgolint": ["oxlint-tsgolint@0.19.0", "", { "optionalDependencies": { "@oxlint-tsgolint/darwin-arm64": "0.19.0", "@oxlint-tsgolint/darwin-x64": "0.19.0", "@oxlint-tsgolint/linux-arm64": "0.19.0", "@oxlint-tsgolint/linux-x64": "0.19.0", "@oxlint-tsgolint/win32-arm64": "0.19.0", "@oxlint-tsgolint/win32-x64": "0.19.0" }, "bin": { "tsgolint": "bin/tsgolint.js" } }, "sha512-pSzUmDjMyjC8iUUZ7fCLo0D1iUaYIfodd/WIQ6Zra11YkjkUQk3BOFoW4I5ec6uZ/0s2FEmxtiZ7hiTXFRp1cg=="], "p-limit": ["p-limit@3.1.0", "", { "dependencies": { "yocto-queue": "^0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="], diff --git a/dist/index.mjs b/dist/index.mjs index ed323c0..dd76cc7 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -82,71 +82,297 @@ const functionalRules = { //#endregion //#region ../rules/eslint.ts const esLintRules = { - "array-callback-return": [ - "error", + "eslint/accessor-pairs": ["deny", { enforceForTSTypes: true }], + "eslint/array-callback-return": ["deny", { checkForEach: true }], + "eslint/arrow-body-style": ["deny", "as-needed", { requireReturnForObjectLiteral: false }], + "eslint/block-scoped-var": "deny", + "eslint/capitalized-comments": [ + "deny", + "always", { - allowVoid: true, - checkForEach: true, + block: { ignoreConsecutiveComments: true }, + line: { ignoreConsecutiveComments: true }, + }, + ], + "eslint/constructor-super": "deny", + "eslint/curly": ["deny", "all"], + "eslint/default-case": "deny", + "eslint/default-case-last": "deny", + "eslint/default-param-last": "deny", + "eslint/eqeqeq": "deny", + "eslint/for-direction": "deny", + "eslint/func-names": "allow", + "eslint/func-style": ["deny", "expression", { allowArrowFunctions: true }], + "eslint/getter-return": "deny", + "eslint/grouped-accessor-pairs": ["deny", "setBeforeGet", { enforceForTSTypes: true }], + "eslint/guard-for-in": "deny", + "eslint/id-length": "deny", + "eslint/init-declarations": ["deny", "always"], + "eslint/new-cap": [ + "deny", + { + capIsNew: false, + newIsCap: true, + properties: true, + }, + ], + "eslint/no-alert": "deny", + "eslint/no-array-constructor": "deny", + "eslint/no-async-promise-executor": "deny", + "eslint/no-await-in-loop": "deny", + "eslint/no-bitwise": "deny", + "eslint/no-caller": "deny", + "eslint/no-case-declarations": "deny", + "eslint/no-class-assign": "deny", + "eslint/no-compare-neg-zero": "deny", + "eslint/no-cond-assign": "deny", + "eslint/no-console": "allow", + "eslint/no-const-assign": "deny", + "eslint/no-constant-binary-expression": "deny", + "eslint/no-constant-condition": ["deny", { checkLoops: "allExceptWhileTrue" }], + "eslint/no-constructor-return": "deny", + "eslint/no-continue": "allow", + "eslint/no-control-regex": "deny", + "eslint/no-debugger": "deny", + "eslint/no-delete-var": "deny", + "eslint/no-div-regex": "allow", + "eslint/no-dupe-class-members": "deny", + "eslint/no-dupe-else-if": "deny", + "eslint/no-dupe-keys": "deny", + "eslint/no-duplicate-case": "deny", + "eslint/no-duplicate-imports": [ + "deny", + { + allowSeparateTypeImports: true, + includeExports: false, + }, + ], + "eslint/no-else-return": "allow", + "eslint/no-empty": ["deny", { allowEmptyCatch: false }], + "eslint/no-empty-character-class": "deny", + "eslint/no-empty-function": ["deny", { allow: [] }], + "eslint/no-empty-pattern": "deny", + "eslint/no-empty-static-block": "deny", + "eslint/no-eq-null": "deny", + "eslint/no-eval": "deny", + "eslint/no-ex-assign": "deny", + "eslint/no-extend-native": "deny", + "eslint/no-extra-bind": "deny", + "eslint/no-extra-boolean-cast": ["deny", { enforceForInnerExpressions: true }], + "eslint/no-extra-label": "deny", + "eslint/no-fallthrough": [ + "deny", + { + allowEmptyCase: false, + reportUnusedFallthroughComment: true, + }, + ], + "eslint/no-func-assign": "deny", + "eslint/no-global-assign": "deny", + "eslint/no-implicit-coercion": [ + "deny", + { + allow: [], + boolean: true, + disallowTemplateShorthand: false, + number: true, + string: true, + }, + ], + "eslint/no-import-assign": "deny", + "eslint/no-inline-comments": "deny", + "eslint/no-inner-declarations": ["deny", "both", "disallow"], + "eslint/no-invalid-regexp": "deny", + "eslint/no-irregular-whitespace": "deny", + "eslint/no-iterator": "deny", + "eslint/no-label-var": "deny", + "eslint/no-labels": "deny", + "eslint/no-lone-blocks": "deny", + "eslint/no-lonely-if": "deny", + "eslint/no-loop-func": "deny", + "eslint/no-loss-of-precision": "deny", + "eslint/no-magic-numbers": [ + "warn", + { + detectObjects: true, + enforceConst: true, + ignoreEnums: true, + ignoreNumericLiteralTypes: true, + ignoreTypeIndexes: true, + }, + ], + "eslint/no-misleading-character-class": "deny", + "eslint/no-multi-assign": "deny", + "eslint/no-multi-str": "deny", + "eslint/no-negated-condition": "deny", + "eslint/no-nested-ternary": "deny", + "eslint/no-new": "deny", + "eslint/no-new-func": "deny", + "eslint/no-new-native-nonconstructor": "deny", + "eslint/no-new-wrappers": "deny", + "eslint/no-nonoctal-decimal-escape": "deny", + "eslint/no-obj-calls": "deny", + "eslint/no-object-constructor": "deny", + "eslint/no-param-reassign": [ + "deny", + { + ignorePropertyModificationsFor: [], + props: true, + }, + ], + "eslint/no-plusplus": "deny", + "eslint/no-promise-executor-return": "deny", + "eslint/no-proto": "deny", + "eslint/no-prototype-builtins": "deny", + "eslint/no-redeclare": ["deny", { builtinGlobals: true }], + "eslint/no-regex-spaces": "deny", + "eslint/no-return-assign": ["deny", "always"], + "eslint/no-script-url": "deny", + "eslint/no-self-assign": ["deny", { props: true }], + "eslint/no-self-compare": "deny", + "eslint/no-sequences": ["deny", { allowInParentheses: false }], + "eslint/no-setter-return": "deny", + "eslint/no-shadow": [ + "deny", + { + builtinGlobals: true, + hoist: "functions-and-types", + ignoreFunctionTypeParameterNameValueShadow: true, + ignoreOnInitialization: false, + ignoreTypeValueShadow: true, + }, + ], + "eslint/no-shadow-restricted-names": ["deny", { reportGlobalThis: true }], + "eslint/no-sparse-arrays": "deny", + "eslint/no-template-curly-in-string": "deny", + "eslint/no-ternary": "deny", + "eslint/no-this-before-super": "deny", + "eslint/no-throw-literal": "allow", + "eslint/no-unassigned-vars": "deny", + "eslint/no-undef": ["deny", { typeof: true }], + "eslint/no-undefined": "deny", + "eslint/no-unexpected-multiline": "deny", + "eslint/no-unmodified-loop-condition": "deny", + "eslint/no-unneeded-ternary": ["deny", { defaultAssignment: false }], + "eslint/no-unreachable": "deny", + "eslint/no-unsafe-finally": "deny", + "eslint/no-unsafe-negation": ["deny", { enforceForOrderingRelations: true }], + "eslint/no-unsafe-optional-chaining": ["deny", { disallowArithmeticOperators: true }], + "eslint/no-unused-expressions": [ + "deny", + { + allowShortCircuit: false, + allowTaggedTemplates: false, + allowTernary: false, + enforceForJSX: true, + }, + ], + "eslint/no-unused-labels": "deny", + "eslint/no-unused-private-class-members": "deny", + "eslint/no-unused-vars": [ + "deny", + { + args: "all", + caughtErrors: "all", + fix: { + ignoreClassWithStaticInitBlock: false, + ignoreRestSiblings: false, + ignoreUsingDeclarations: false, + imports: "suggestion", + reportVarsOnlyUsedAsTypes: false, + variables: "suggestion", + vars: "all", + }, + }, + ], + "eslint/no-use-before-define": [ + "deny", + { + allowNamedExports: false, + classes: true, + enums: true, + functions: true, + ignoreTypeReferences: true, + typedefs: true, + variables: true, + }, + ], + "eslint/no-useless-backreference": "deny", + "eslint/no-useless-call": "deny", + "eslint/no-useless-catch": "deny", + "eslint/no-useless-computed-key": ["deny", { enforceForClassMembers: true }], + "eslint/no-useless-concat": "deny", + "eslint/no-useless-constructor": "deny", + "eslint/no-useless-escape": "deny", + "eslint/no-useless-rename": [ + "deny", + { + ignoreDestructuring: false, + ignoreExport: false, + ignoreImport: false, + }, + ], + "eslint/no-useless-return": "deny", + "eslint/no-var": "deny", + "eslint/no-void": ["deny", { allowAsStatement: false }], + "eslint/no-warning-comments": ["warn", { location: "anywhere" }], + "eslint/no-with": "deny", + "eslint/operator-assignment": ["deny", "never"], + "eslint/prefer-const": [ + "deny", + { + destructuring: "any", + ignoreReadBeforeAssign: true, + }, + ], + "eslint/prefer-destructuring": [ + "deny", + { + AssignmentExpression: { + array: true, + object: true, + }, + enforceForRenamedProperties: false, + VariableDeclarator: { + array: true, + object: true, + }, + }, + ], + "eslint/prefer-exponentiation-operator": "deny", + "eslint/prefer-numeric-literals": "deny", + "eslint/prefer-object-has-own": "deny", + "eslint/prefer-object-spread": "deny", + "eslint/prefer-promise-reject-errors": ["deny", { allowEmptyReject: false }], + "eslint/prefer-rest-params": "deny", + "eslint/prefer-spread": "deny", + "eslint/prefer-template": "deny", + "eslint/preserve-caught-error": "allow", + "eslint/radix": "deny", + "eslint/require-await": "allow", + "eslint/require-yield": "deny", + "eslint/sort-imports": "allow", + "eslint/sort-keys": "allow", + "eslint/sort-vars": "allow", + "eslint/symbol-description": "deny", + "eslint/unicode-bom": ["deny", "never"], + "eslint/use-isnan": [ + "deny", + { + enforceForIndexOf: true, + enforceForSwitchCase: true, + }, + ], + "eslint/valid-typeof": ["deny", { requireStringLiterals: true }], + "eslint/vars-on-top": "deny", + "eslint/yoda": [ + "deny", + "never", + { + exceptRange: false, + onlyEquality: false, }, ], - "for-direction": "error", - "max-params": ["error", { max: 3 }], - "no-array-constructor": "error", - "no-async-promise-executor": "error", - "no-case-declarations": "error", - "no-compare-neg-zero": "error", - "no-cond-assign": "error", - "no-constant-binary-expression": "error", - "no-constant-condition": "error", - "no-control-regex": "error", - "no-debugger": "error", - "no-delete-var": "error", - "no-dupe-else-if": "error", - "no-duplicate-case": "error", - "no-duplicate-imports": ["error", { allowSeparateTypeImports: true }], - "no-empty": "error", - "no-empty-character-class": "error", - "no-empty-function": "error", - "no-empty-pattern": "error", - "no-empty-static-block": "error", - "no-ex-assign": "error", - "no-extra-boolean-cast": "error", - "no-fallthrough": "error", - "no-global-assign": "error", - "no-invalid-regexp": "error", - "no-irregular-whitespace": "error", - "no-loss-of-precision": "error", - "no-misleading-character-class": "error", - "no-nonoctal-decimal-escape": "error", - "no-param-reassign": "error", - "no-prototype-builtins": "error", - "no-regex-spaces": "error", - "no-self-assign": "error", - "no-shadow-restricted-names": "error", - "no-sparse-arrays": "error", - "no-unassigned-vars": "error", - "no-unexpected-multiline": "error", - "no-unneeded-ternary": ["error", { defaultAssignment: false }], - "no-unsafe-finally": "error", - "no-unsafe-optional-chaining": "error", - "no-unused-expressions": "error", - "no-unused-labels": "error", - "no-unused-private-class-members": "error", - "no-unused-vars": "error", - "no-useless-backreference": "error", - "no-useless-catch": "error", - "no-useless-constructor": "error", - "no-useless-escape": "error", - "no-var": "error", - "prefer-const": "error", - "prefer-rest-params": "error", - "prefer-spread": "error", - "preserve-caught-error": "error", - "require-yield": "error", - "sort-imports": "off", - "use-isnan": "error", - "valid-typeof": "error", - yoda: ["error", "never"], }; //#endregion @@ -752,7 +978,7 @@ const unicornRules = { "unicorn/prefer-string-starts-ends-with": "error", "unicorn/prefer-string-trim-start-end": "error", "unicorn/prefer-structured-clone": "error", - "unicorn/prefer-ternary": "error", + "unicorn/prefer-ternary": "off", "unicorn/prefer-top-level-await": "error", "unicorn/prefer-type-error": "error", "unicorn/relative-url-style": "error", @@ -768,12 +994,12 @@ const unicornRules = { //#region ../index.ts const config = defineConfig({ categories: { - correctness: "warn", - nursery: "warn", - pedantic: "warn", - perf: "error", - style: "error", - suspicious: "error", + correctness: "off", + nursery: "off", + pedantic: "off", + perf: "off", + style: "off", + suspicious: "off", }, env: { browser: true, @@ -781,7 +1007,7 @@ const config = defineConfig({ es2026: true, node: true, }, - ignorePatterns: ["dist/**/*"], + ignorePatterns: [".astro", ".cache", "dist/**/*"], jsPlugins: ["eslint-plugin-functional", "eslint-plugin-perfectionist", "eslint-plugin-sonarjs"], options: { reportUnusedDisableDirectives: "warn", diff --git a/index.ts b/index.ts index 7bc9a60..cf0b2fe 100644 --- a/index.ts +++ b/index.ts @@ -11,12 +11,12 @@ import unicornRules from "./rules/unicorn"; const config: OxlintConfig = defineConfig({ categories: { - correctness: "warn", - nursery: "warn", - pedantic: "warn", - perf: "error", - style: "error", - suspicious: "error", + correctness: "off", + nursery: "off", + pedantic: "off", + perf: "off", + style: "off", + suspicious: "off", }, env: { browser: true, diff --git a/justfile b/justfile index 29dd6c8..5fe63b9 100644 --- a/justfile +++ b/justfile @@ -15,16 +15,26 @@ format: update: bun update --interactive -# Analyse le code TypeScript avec Oxlint. +# Reporte les soucis du code TypeScript avec Oxlint. lint-js: + bun --bun oxlint \ + --config cfg/oxlint.config.ts + +# Fixe le code TypeScript avec Oxlint. +fix-js: bun --bun oxlint \ --config cfg/oxlint.config.ts \ --fix-dangerously # Analyse le code mort et les dépendances inutilisées du projet. find-dead-code: - -bun --bun knip --cache --cache-location ".cache/knipcache" --strict - -bun --bun knip --cache --cache-location ".cache/knipcache" --production --strict + -bun --bun knip \ + --cache --cache-location ".cache/knipcache" \ + --strict + -bun --bun knip \ + --cache --cache-location ".cache/knipcache" \ + --production \ + --strict # Compile le projet. build: @@ -32,17 +42,9 @@ build: --config "cfg/tsdown.config.ts" \ --attw --publint -# Nettoie le dosiser de compilation. +# Nettoie le dossier de compilation. clean: rm -rf .cache/ rm -rf bun.lock rm -rf node_modules/ rm -rfv dist/ - -# Nettoie le dossier de cache. -clean-cache: - rm -rf .cache/ - -# Publie le paquet sur le registre local. -publish: - npm publish --registry http://localhost:4873 diff --git a/package.json b/package.json index 1f4f471..c109853 100644 --- a/package.json +++ b/package.json @@ -17,14 +17,14 @@ "eslint-plugin-jsx-a11y": "^6.10.2", "eslint-plugin-perfectionist": "^5.7.0", "eslint-plugin-sonarjs": "^4.0.2", - "oxlint": "^1.57.0", - "oxlint-tsgolint": "^0.18.1", + "oxlint": "^1.58.0", + "oxlint-tsgolint": "^0.19.0", "typescript": "^6.0.2" }, "dependencies": { "globals": "^17.4.0", - "oxlint": "^1.57.0", - "oxlint-tsgolint": "^0.18.1" + "oxlint": "^1.58.0", + "oxlint-tsgolint": "^0.19.0" }, "optionalDependencies": { "eslint-plugin-astro": "^1.6.0" @@ -40,7 +40,7 @@ "eslint-plugin-jsx-a11y": "^6.10.2", "eslint-plugin-perfectionist": "^5.7.0", "eslint-plugin-sonarjs": "^4.0.2", - "knip": "^6.1.0", + "knip": "^6.1.1", "prettier": "^3.8.1", "publint": "^0.3.18", "tsdown": "^0.21.7", diff --git a/rules/eslint.ts b/rules/eslint.ts index 672d087..1dda2ad 100644 --- a/rules/eslint.ts +++ b/rules/eslint.ts @@ -1,87 +1,379 @@ import type { DummyRuleMap } from "oxlint"; const esLintRules: DummyRuleMap = { - "array-callback-return": [ - "error", + "eslint/accessor-pairs": ["deny", { enforceForTSTypes: true }], + "eslint/array-callback-return": [ + "deny", { - allowVoid: true, checkForEach: true, }, ], - "for-direction": "error", - "max-params": [ - "error", + "eslint/arrow-body-style": [ + "deny", + "as-needed", { - max: 3, + requireReturnForObjectLiteral: false, }, ], - "no-array-constructor": "error", - "no-async-promise-executor": "error", - "no-case-declarations": "error", - "no-compare-neg-zero": "error", - "no-cond-assign": "error", - "no-constant-binary-expression": "error", - "no-constant-condition": "error", - "no-control-regex": "error", - "no-debugger": "error", - "no-delete-var": "error", - "no-dupe-else-if": "error", - "no-duplicate-case": "error", - "no-duplicate-imports": [ - "error", + "eslint/block-scoped-var": "deny", + "eslint/capitalized-comments": [ + "deny", + "always", + { + block: { + ignoreConsecutiveComments: true, + }, + line: { + ignoreConsecutiveComments: true, + }, + }, + ], + "eslint/constructor-super": "deny", + "eslint/curly": ["deny", "all"], + "eslint/default-case": "deny", + "eslint/default-case-last": "deny", + "eslint/default-param-last": "deny", + "eslint/eqeqeq": "deny", + "eslint/for-direction": "deny", + "eslint/func-names": "allow", + "eslint/func-style": [ + "deny", + "expression", + { + allowArrowFunctions: true, + }, + ], + "eslint/getter-return": "deny", + "eslint/grouped-accessor-pairs": [ + "deny", + "setBeforeGet", + { + enforceForTSTypes: true, + }, + ], + "eslint/guard-for-in": "deny", + "eslint/id-length": "deny", + "eslint/init-declarations": ["deny", "always"], + "eslint/new-cap": [ + "deny", + { + capIsNew: false, + newIsCap: true, + properties: true, + }, + ], + "eslint/no-alert": "deny", + "eslint/no-array-constructor": "deny", + "eslint/no-async-promise-executor": "deny", + "eslint/no-await-in-loop": "deny", + "eslint/no-bitwise": "deny", + "eslint/no-caller": "deny", + "eslint/no-case-declarations": "deny", + "eslint/no-class-assign": "deny", + "eslint/no-compare-neg-zero": "deny", + "eslint/no-cond-assign": "deny", + "eslint/no-console": "allow", + "eslint/no-const-assign": "deny", + "eslint/no-constant-binary-expression": "deny", + "eslint/no-constant-condition": [ + "deny", + { + checkLoops: "allExceptWhileTrue", + }, + ], + "eslint/no-constructor-return": "deny", + "eslint/no-continue": "allow", + "eslint/no-control-regex": "deny", + "eslint/no-debugger": "deny", + "eslint/no-delete-var": "deny", + "eslint/no-div-regex": "allow", + "eslint/no-dupe-class-members": "deny", + "eslint/no-dupe-else-if": "deny", + "eslint/no-dupe-keys": "deny", + "eslint/no-duplicate-case": "deny", + "eslint/no-duplicate-imports": [ + "deny", { allowSeparateTypeImports: true, + includeExports: false, }, ], - "no-empty": "error", - "no-empty-character-class": "error", - "no-empty-function": "error", - "no-empty-pattern": "error", - "no-empty-static-block": "error", - "no-ex-assign": "error", - "no-extra-boolean-cast": "error", - "no-fallthrough": "error", - "no-global-assign": "error", - "no-invalid-regexp": "error", - "no-irregular-whitespace": "error", - "no-loss-of-precision": "error", - "no-misleading-character-class": "error", - "no-nonoctal-decimal-escape": "error", - "no-param-reassign": "error", - "no-prototype-builtins": "error", - "no-regex-spaces": "error", - "no-self-assign": "error", - "no-shadow-restricted-names": "error", - "no-sparse-arrays": "error", - "no-unassigned-vars": "error", - "no-unexpected-multiline": "error", - "no-unneeded-ternary": [ - "error", + "eslint/no-else-return": "allow", + "eslint/no-empty": [ + "deny", + { + allowEmptyCatch: false, + }, + ], + "eslint/no-empty-character-class": "deny", + "eslint/no-empty-function": [ + "deny", + { + allow: [], + }, + ], + "eslint/no-empty-pattern": "deny", + "eslint/no-empty-static-block": "deny", + "eslint/no-eq-null": "deny", + "eslint/no-eval": "deny", + "eslint/no-ex-assign": "deny", + "eslint/no-extend-native": "deny", + "eslint/no-extra-bind": "deny", + "eslint/no-extra-boolean-cast": [ + "deny", + { + enforceForInnerExpressions: true, + }, + ], + "eslint/no-extra-label": "deny", + "eslint/no-fallthrough": [ + "deny", + { + allowEmptyCase: false, + reportUnusedFallthroughComment: true, + }, + ], + "eslint/no-func-assign": "deny", + "eslint/no-global-assign": "deny", + "eslint/no-implicit-coercion": [ + "deny", + { + allow: [], + boolean: true, + disallowTemplateShorthand: false, + number: true, + string: true, + }, + ], + "eslint/no-import-assign": "deny", + "eslint/no-inline-comments": "deny", + "eslint/no-inner-declarations": ["deny", "both", "disallow"], + "eslint/no-invalid-regexp": "deny", + "eslint/no-irregular-whitespace": "deny", + "eslint/no-iterator": "deny", + "eslint/no-label-var": "deny", + "eslint/no-labels": "deny", + "eslint/no-lone-blocks": "deny", + "eslint/no-lonely-if": "deny", + "eslint/no-loop-func": "deny", + "eslint/no-loss-of-precision": "deny", + "eslint/no-magic-numbers": [ + "warn", + { + detectObjects: true, + enforceConst: true, + ignoreEnums: true, + ignoreNumericLiteralTypes: true, + ignoreTypeIndexes: true, + }, + ], + "eslint/no-misleading-character-class": "deny", + "eslint/no-multi-assign": "deny", + "eslint/no-multi-str": "deny", + "eslint/no-negated-condition": "deny", + "eslint/no-nested-ternary": "deny", + "eslint/no-new": "deny", + "eslint/no-new-func": "deny", + "eslint/no-new-native-nonconstructor": "deny", + "eslint/no-new-wrappers": "deny", + "eslint/no-nonoctal-decimal-escape": "deny", + "eslint/no-obj-calls": "deny", + "eslint/no-object-constructor": "deny", + "eslint/no-param-reassign": [ + "deny", + { + // Sera mis à jour avec les propriétés concernées (p. ex. modifications d'objets DOM). + ignorePropertyModificationsFor: [], + props: true, + }, + ], + "eslint/no-plusplus": "deny", + "eslint/no-promise-executor-return": "deny", + "eslint/no-proto": "deny", + "eslint/no-prototype-builtins": "deny", + "eslint/no-redeclare": [ + "deny", + { + builtinGlobals: true, + }, + ], + "eslint/no-regex-spaces": "deny", + "eslint/no-return-assign": ["deny", "always"], + "eslint/no-script-url": "deny", + "eslint/no-self-assign": [ + "deny", + { + props: true, + }, + ], + "eslint/no-self-compare": "deny", + "eslint/no-sequences": [ + "deny", + { + allowInParentheses: false, + }, + ], + "eslint/no-setter-return": "deny", + "eslint/no-shadow": [ + "deny", + { + builtinGlobals: true, + hoist: "functions-and-types", + ignoreFunctionTypeParameterNameValueShadow: true, + ignoreOnInitialization: false, + ignoreTypeValueShadow: true, + }, + ], + "eslint/no-shadow-restricted-names": [ + "deny", + { + reportGlobalThis: true, + }, + ], + "eslint/no-sparse-arrays": "deny", + "eslint/no-template-curly-in-string": "deny", + "eslint/no-ternary": "deny", + "eslint/no-this-before-super": "deny", + // This rule has been deprecated, please instead use typescript/only-throw-error. + "eslint/no-throw-literal": "allow", + "eslint/no-unassigned-vars": "deny", + "eslint/no-undef": ["deny", { typeof: true }], + "eslint/no-undefined": "deny", + "eslint/no-unexpected-multiline": "deny", + "eslint/no-unmodified-loop-condition": "deny", + "eslint/no-unneeded-ternary": [ + "deny", { defaultAssignment: false, }, ], - "no-unsafe-finally": "error", - "no-unsafe-optional-chaining": "error", - "no-unused-expressions": "error", - "no-unused-labels": "error", - "no-unused-private-class-members": "error", - "no-unused-vars": "error", - "no-useless-backreference": "error", - "no-useless-catch": "error", - "no-useless-constructor": "error", - "no-useless-escape": "error", - "no-var": "error", - "prefer-const": "error", - "prefer-rest-params": "error", - "prefer-spread": "error", - "preserve-caught-error": "error", - "require-yield": "error", - // Rentre en conflit avec perfectionnist. - "sort-imports": "off", - "use-isnan": "error", - "valid-typeof": "error", - yoda: ["error", "never"], + "eslint/no-unreachable": "deny", + "eslint/no-unsafe-finally": "deny", + "eslint/no-unsafe-negation": ["deny", { enforceForOrderingRelations: true }], + "eslint/no-unsafe-optional-chaining": ["deny", { disallowArithmeticOperators: true }], + "eslint/no-unused-expressions": [ + "deny", + { + allowShortCircuit: false, + allowTaggedTemplates: false, + allowTernary: false, + enforceForJSX: true, + }, + ], + "eslint/no-unused-labels": "deny", + "eslint/no-unused-private-class-members": "deny", + "eslint/no-unused-vars": [ + "deny", + { + args: "all", + caughtErrors: "all", + fix: { + ignoreClassWithStaticInitBlock: false, + ignoreRestSiblings: false, + ignoreUsingDeclarations: false, + imports: "suggestion", + reportVarsOnlyUsedAsTypes: false, + variables: "suggestion", + vars: "all", + }, + }, + ], + "eslint/no-use-before-define": [ + "deny", + { + allowNamedExports: false, + classes: true, + enums: true, + functions: true, + ignoreTypeReferences: true, + typedefs: true, + variables: true, + }, + ], + "eslint/no-useless-backreference": "deny", + "eslint/no-useless-call": "deny", + "eslint/no-useless-catch": "deny", + "eslint/no-useless-computed-key": [ + "deny", + { + enforceForClassMembers: true, + }, + ], + "eslint/no-useless-concat": "deny", + "eslint/no-useless-constructor": "deny", + "eslint/no-useless-escape": "deny", + "eslint/no-useless-rename": [ + "deny", + { + ignoreDestructuring: false, + ignoreExport: false, + ignoreImport: false, + }, + ], + "eslint/no-useless-return": "deny", + "eslint/no-var": "deny", + "eslint/no-void": ["deny", { allowAsStatement: false }], + "eslint/no-warning-comments": ["warn", { location: "anywhere" }], + "eslint/no-with": "deny", + "eslint/operator-assignment": ["deny", "never"], + "eslint/prefer-const": [ + "deny", + { + destructuring: "any", + ignoreReadBeforeAssign: true, + }, + ], + "eslint/prefer-destructuring": [ + "deny", + { + AssignmentExpression: { + array: true, + object: true, + }, + enforceForRenamedProperties: false, + VariableDeclarator: { + array: true, + object: true, + }, + }, + ], + "eslint/prefer-exponentiation-operator": "deny", + "eslint/prefer-numeric-literals": "deny", + "eslint/prefer-object-has-own": "deny", + "eslint/prefer-object-spread": "deny", + "eslint/prefer-promise-reject-errors": ["deny", { allowEmptyReject: false }], + "eslint/prefer-rest-params": "deny", + "eslint/prefer-spread": "deny", + "eslint/prefer-template": "deny", + // Pas forcément nécessaire. + "eslint/preserve-caught-error": "allow", + "eslint/radix": "deny", + // This rule is inferior to the accuracy of the type-aware typescript/require-await rule. + "eslint/require-await": "allow", + "eslint/require-yield": "deny", + // Rentre en conflit avec Perfectionnist. + "eslint/sort-imports": "allow", + // Rentre en conflit avec Perfectionnist. + "eslint/sort-keys": "allow", + "eslint/sort-vars": "allow", + "eslint/symbol-description": "deny", + "eslint/unicode-bom": ["deny", "never"], + "eslint/use-isnan": ["deny", { enforceForIndexOf: true, enforceForSwitchCase: true }], + "eslint/valid-typeof": [ + "deny", + { + requireStringLiterals: true, + }, + ], + "eslint/vars-on-top": "deny", + "eslint/yoda": [ + "deny", + "never", + { + exceptRange: false, + onlyEquality: false, + }, + ], }; export default esLintRules; diff --git a/rules/old-eslint.ts b/rules/old-eslint.ts new file mode 100644 index 0000000..672d087 --- /dev/null +++ b/rules/old-eslint.ts @@ -0,0 +1,87 @@ +import type { DummyRuleMap } from "oxlint"; + +const esLintRules: DummyRuleMap = { + "array-callback-return": [ + "error", + { + allowVoid: true, + checkForEach: true, + }, + ], + "for-direction": "error", + "max-params": [ + "error", + { + max: 3, + }, + ], + "no-array-constructor": "error", + "no-async-promise-executor": "error", + "no-case-declarations": "error", + "no-compare-neg-zero": "error", + "no-cond-assign": "error", + "no-constant-binary-expression": "error", + "no-constant-condition": "error", + "no-control-regex": "error", + "no-debugger": "error", + "no-delete-var": "error", + "no-dupe-else-if": "error", + "no-duplicate-case": "error", + "no-duplicate-imports": [ + "error", + { + allowSeparateTypeImports: true, + }, + ], + "no-empty": "error", + "no-empty-character-class": "error", + "no-empty-function": "error", + "no-empty-pattern": "error", + "no-empty-static-block": "error", + "no-ex-assign": "error", + "no-extra-boolean-cast": "error", + "no-fallthrough": "error", + "no-global-assign": "error", + "no-invalid-regexp": "error", + "no-irregular-whitespace": "error", + "no-loss-of-precision": "error", + "no-misleading-character-class": "error", + "no-nonoctal-decimal-escape": "error", + "no-param-reassign": "error", + "no-prototype-builtins": "error", + "no-regex-spaces": "error", + "no-self-assign": "error", + "no-shadow-restricted-names": "error", + "no-sparse-arrays": "error", + "no-unassigned-vars": "error", + "no-unexpected-multiline": "error", + "no-unneeded-ternary": [ + "error", + { + defaultAssignment: false, + }, + ], + "no-unsafe-finally": "error", + "no-unsafe-optional-chaining": "error", + "no-unused-expressions": "error", + "no-unused-labels": "error", + "no-unused-private-class-members": "error", + "no-unused-vars": "error", + "no-useless-backreference": "error", + "no-useless-catch": "error", + "no-useless-constructor": "error", + "no-useless-escape": "error", + "no-var": "error", + "prefer-const": "error", + "prefer-rest-params": "error", + "prefer-spread": "error", + "preserve-caught-error": "error", + "require-yield": "error", + // Rentre en conflit avec perfectionnist. + "sort-imports": "off", + "use-isnan": "error", + "valid-typeof": "error", + yoda: ["error", "never"], +}; + +export default esLintRules;