From 1f118656af39ee8939a94c1534935c47b66967f3 Mon Sep 17 00:00:00 2001 From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Date: Thu, 8 Aug 2024 19:07:24 +1000 Subject: [PATCH 1/2] WIP: disable rules covered by oxlint --- oxlint.json | 9 +++ package.json | 1 + packages/config/package.json | 3 +- packages/config/src/eslint/index.js | 2 + pnpm-lock.yaml | 98 +++++++++++++++++++++++++++++ 5 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 oxlint.json diff --git a/oxlint.json b/oxlint.json new file mode 100644 index 0000000..507b2b7 --- /dev/null +++ b/oxlint.json @@ -0,0 +1,9 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": ["import", "unicorn", "jsdoc"], + "categories": { + "correctness": "deny", + "perf": "deny", + "suspicious": "deny" + } +} diff --git a/package.json b/package.json index bd2b4d1..0245cd9 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@types/node": "^20.16.2", "jsdom": "^25.0.1", "nx": "^19.8.10", + "oxlint": "^0.11.0", "prettier": "^3.3.3", "publint": "^0.2.12", "sherif": "^1.0.1", diff --git a/packages/config/package.json b/packages/config/package.json index 077c244..936f992 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -16,7 +16,7 @@ }, "scripts": { "test:types": "tsc", - "test:eslint": "eslint ./bin ./src", + "test:eslint": "oxlint -c ../../oxlint.json && eslint ./bin ./src", "test:build": "publint --strict" }, "type": "module", @@ -67,6 +67,7 @@ "esbuild-register": "^3.6.0", "eslint-plugin-import-x": "^4.4.0", "eslint-plugin-n": "^17.12.0", + "eslint-plugin-oxlint": "^0.11.0", "globals": "^15.11.0", "interpret": "^3.1.1", "jsonfile": "^6.1.0", diff --git a/packages/config/src/eslint/index.js b/packages/config/src/eslint/index.js index cc7ce4b..07da73a 100644 --- a/packages/config/src/eslint/index.js +++ b/packages/config/src/eslint/index.js @@ -2,6 +2,7 @@ import tseslint from 'typescript-eslint' import stylisticJs from '@stylistic/eslint-plugin-js' import pluginImport from 'eslint-plugin-import-x' import pluginNode from 'eslint-plugin-n' +import pluginOxlint from 'eslint-plugin-oxlint' import globals from 'globals' import { javascriptRules } from './javascript.js' import { importRules } from './import.js' @@ -59,6 +60,7 @@ export const tanstackConfig = [ ...importRules, ...nodeRules, ...stylisticRules, + ...pluginOxlint.configs['flat/recommended'].rules, }, }, ] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b3b1ddd..2c5b4d3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,9 @@ importers: nx: specifier: ^19.8.10 version: 19.8.10 + oxlint: + specifier: ^0.11.0 + version: 0.11.0 prettier: specifier: ^3.3.3 version: 3.3.3 @@ -106,6 +109,9 @@ importers: eslint-plugin-n: specifier: ^17.12.0 version: 17.12.0(eslint@9.14.0) + eslint-plugin-oxlint: + specifier: ^0.11.0 + version: 0.11.0 globals: specifier: ^15.11.0 version: 15.11.0 @@ -600,6 +606,46 @@ packages: cpu: [x64] os: [win32] + '@oxlint/darwin-arm64@0.11.0': + resolution: {integrity: sha512-qQ1C5yvRYECp+FP8DCOSqNX4+e72xXyApJ2O8QyIeYFuGGF2MoDVQz3NYJEOjOfArZ9YXGsELwM3UFtjTGIZVg==} + cpu: [arm64] + os: [darwin] + + '@oxlint/darwin-x64@0.11.0': + resolution: {integrity: sha512-pAqp6/6+mAIPr8WBndzmEuRbcXW8WNdn80hd8fLeR9teJI8eMpTkYL6kQIU7VjJ3NxpmzBLO7nh979/bwmmuBQ==} + cpu: [x64] + os: [darwin] + + '@oxlint/linux-arm64-gnu@0.11.0': + resolution: {integrity: sha512-RmpjCWjX0RJ1MdIcqGQsOlXh9WgXnVgVolZLCs8MHqNuYtaIA+0VOxOhJOr7CQ0HmwV+ysPTAiQ2SVSI2tVJQQ==} + cpu: [arm64] + os: [linux] + + '@oxlint/linux-arm64-musl@0.11.0': + resolution: {integrity: sha512-totBeaOeZlblKRpSZi3svVWpJjFlhxR7Xzrh3nhPTgHMM3696qjzyb80Yg0K8gAlOrIDlBblLG0JnaxvdM2yjg==} + cpu: [arm64] + os: [linux] + + '@oxlint/linux-x64-gnu@0.11.0': + resolution: {integrity: sha512-tXiJ97WH4vwTIkGMnXYPx5NqwQiYLW9MbmnGkKkm5Xv/wpAaN761PkHRJT0zsYoAgoU3nZVp3qhit9MpHq1SQg==} + cpu: [x64] + os: [linux] + + '@oxlint/linux-x64-musl@0.11.0': + resolution: {integrity: sha512-LgjgD80fiz37g31t/jMm9kyDM31WPjcTkXXXU702WQsdhujXVUZDWid9/QeVvi51EVufyyekaTYgNR8REVVZZg==} + cpu: [x64] + os: [linux] + + '@oxlint/win32-arm64@0.11.0': + resolution: {integrity: sha512-lfANFSWt0vU6x9JQYeMEy6uy8wniZGYQt0nT45P3BwXIMhAJbEC3yEX+bP5x8eTQrgkDu4dwIDURGCeeUL/NdA==} + cpu: [arm64] + os: [win32] + + '@oxlint/win32-x64@0.11.0': + resolution: {integrity: sha512-5CHtAp82xbv0jnh/HGi3QE0ANBr3+R338MA0wgZXc7477Vuri0aSK0T9oRU+K/pVloPVJaWKSDCCZoiZIYckzg==} + cpu: [x64] + os: [win32] + '@rollup/pluginutils@5.1.3': resolution: {integrity: sha512-Pnsb6f32CD2W3uCaLZIzDmeFyQ2b8UWMFI7xtwUezpcGBDVDW6y9XgAWIlARiGAo6eNF5FK5aQTr0LFyNyqq5A==} engines: {node: '>=14.0.0'} @@ -1364,6 +1410,9 @@ packages: peerDependencies: eslint: '>=8.23.0' + eslint-plugin-oxlint@0.11.0: + resolution: {integrity: sha512-9CHYh1eLt2Z83ShLbvj79G6lqC2qLJBfsd7baGWOwDmLM2GXu2COi1r4tMMS2OI8gfB4s2uOgS8ZiYzHhN8uzQ==} + eslint-scope@8.2.0: resolution: {integrity: sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1802,6 +1851,9 @@ packages: jsonc-parser@3.2.0: resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} + jsonc-parser@3.3.1: + resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} + jsonfile@4.0.0: resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} @@ -2041,6 +2093,11 @@ packages: resolution: {integrity: sha512-zAKMgGXUim0Jyd6CXK9lraBnD3H5yPGBPPOkC23a2BG6hsm4Zu6OQSjQuEtV0BHDf4aKHcUFvJiGRrFuW3MG8g==} engines: {node: '>=10'} + oxlint@0.11.0: + resolution: {integrity: sha512-uY6/R4k5bECwJBR+y8CqGRcUb5hxNReziBjt5+pk6DKxj46DqMd6HwEk090KnaH1czVf23r8mcEsJYGowMWeIA==} + engines: {node: '>=14.*'} + hasBin: true + p-finally@1.0.0: resolution: {integrity: sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==} engines: {node: '>=4'} @@ -3177,6 +3234,30 @@ snapshots: '@nx/nx-win32-x64-msvc@19.8.10': optional: true + '@oxlint/darwin-arm64@0.11.0': + optional: true + + '@oxlint/darwin-x64@0.11.0': + optional: true + + '@oxlint/linux-arm64-gnu@0.11.0': + optional: true + + '@oxlint/linux-arm64-musl@0.11.0': + optional: true + + '@oxlint/linux-x64-gnu@0.11.0': + optional: true + + '@oxlint/linux-x64-musl@0.11.0': + optional: true + + '@oxlint/win32-arm64@0.11.0': + optional: true + + '@oxlint/win32-x64@0.11.0': + optional: true + '@rollup/pluginutils@5.1.3(rollup@4.24.3)': dependencies: '@types/estree': 1.0.6 @@ -4018,6 +4099,10 @@ snapshots: minimatch: 9.0.5 semver: 7.6.3 + eslint-plugin-oxlint@0.11.0: + dependencies: + jsonc-parser: 3.3.1 + eslint-scope@8.2.0: dependencies: esrecurse: 4.3.0 @@ -4463,6 +4548,8 @@ snapshots: jsonc-parser@3.2.0: {} + jsonc-parser@3.3.1: {} + jsonfile@4.0.0: optionalDependencies: graceful-fs: 4.2.11 @@ -4769,6 +4856,17 @@ snapshots: strip-ansi: 6.0.1 wcwidth: 1.0.1 + oxlint@0.11.0: + optionalDependencies: + '@oxlint/darwin-arm64': 0.11.0 + '@oxlint/darwin-x64': 0.11.0 + '@oxlint/linux-arm64-gnu': 0.11.0 + '@oxlint/linux-arm64-musl': 0.11.0 + '@oxlint/linux-x64-gnu': 0.11.0 + '@oxlint/linux-x64-musl': 0.11.0 + '@oxlint/win32-arm64': 0.11.0 + '@oxlint/win32-x64': 0.11.0 + p-finally@1.0.0: {} p-limit@3.1.0: From 5ba8d7c915aeaf2b946c45db151b926358cf7016 Mon Sep 17 00:00:00 2001 From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Date: Wed, 6 Nov 2024 09:30:20 +1100 Subject: [PATCH 2/2] Disable some rules --- oxlint.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/oxlint.json b/oxlint.json index 507b2b7..56038a4 100644 --- a/oxlint.json +++ b/oxlint.json @@ -5,5 +5,10 @@ "correctness": "deny", "perf": "deny", "suspicious": "deny" + }, + "rules": { + "eslint/no-await-in-loop": "allow", + "jsdoc/check-tag-names": "allow", + "oxc/no-accumulating-spread": "allow" } }