From 5b499d512f4a5e53499d131aa62807fe4aaed386 Mon Sep 17 00:00:00 2001 From: Matsu Date: Thu, 1 Oct 2026 10:16:57 +0000 Subject: [PATCH] chore: Migrate backend storage lint to Oxlint (no-changelog) (#39991) --- .../@n8n/backend-network/eslint.config.mjs | 34 +------------ .../@n8n/backend-network/oxlint.config.mts | 7 +++ packages/@n8n/backend-network/package.json | 7 ++- packages/@n8n/blob-storage/eslint.config.mjs | 51 +++---------------- packages/@n8n/blob-storage/oxlint.config.mts | 7 +++ packages/@n8n/blob-storage/package.json | 9 ++-- pnpm-lock.yaml | 20 ++++++-- .../lint-parity/OXLINT_MIGRATION_BLOCKERS.md | 5 ++ turbo.json | 6 +++ 9 files changed, 60 insertions(+), 86 deletions(-) create mode 100644 packages/@n8n/backend-network/oxlint.config.mts create mode 100644 packages/@n8n/blob-storage/oxlint.config.mts diff --git a/packages/@n8n/backend-network/eslint.config.mjs b/packages/@n8n/backend-network/eslint.config.mjs index 2320b36958c..10b87e224ad 100644 --- a/packages/@n8n/backend-network/eslint.config.mjs +++ b/packages/@n8n/backend-network/eslint.config.mjs @@ -1,35 +1,3 @@ -import { defineConfig } from 'eslint/config'; import { backendConfig } from '@n8n/eslint-config/backend'; -export default defineConfig(backendConfig, { - rules: { - /** - * This package is full of HTTP header maps (`Content-Type`, `Authorization`, `X-Custom-Header`) - * and charset identifiers (`iso-8859-15`, `windows-1252`). - */ - '@typescript-eslint/naming-convention': [ - 'error', - { selector: 'default', format: ['camelCase'] }, - { selector: 'import', format: ['camelCase', 'PascalCase'] }, - { - selector: 'variable', - format: ['camelCase', 'snake_case', 'UPPER_CASE', 'PascalCase'], - leadingUnderscore: 'allowSingleOrDouble', - trailingUnderscore: 'allowSingleOrDouble', - }, - { - selector: 'property', - format: ['camelCase', 'snake_case', 'UPPER_CASE'], - leadingUnderscore: 'allowSingleOrDouble', - trailingUnderscore: 'allowSingleOrDouble', - }, - { selector: 'typeLike', format: ['PascalCase'] }, - { - selector: ['method', 'function', 'parameter'], - format: ['camelCase'], - leadingUnderscore: 'allowSingleOrDouble', - }, - { selector: ['objectLiteralProperty', 'typeProperty'], format: null }, - ], - }, -}); +export default backendConfig; diff --git a/packages/@n8n/backend-network/oxlint.config.mts b/packages/@n8n/backend-network/oxlint.config.mts new file mode 100644 index 00000000000..b50c92512db --- /dev/null +++ b/packages/@n8n/backend-network/oxlint.config.mts @@ -0,0 +1,7 @@ +import { backendConfig } from '@n8n/oxlint-config/backend'; +import { defineConfig } from 'oxlint'; + +export default defineConfig({ + extends: [backendConfig], + options: { typeAware: true }, +}); diff --git a/packages/@n8n/backend-network/package.json b/packages/@n8n/backend-network/package.json index 53265e2a043..cdf24fa9b43 100644 --- a/packages/@n8n/backend-network/package.json +++ b/packages/@n8n/backend-network/package.json @@ -9,8 +9,8 @@ "build:unchecked": "tsc -p tsconfig.build.json --noCheck", "format": "biome format --write .", "format:check": "biome ci .", - "lint": "eslint . --quiet", - "lint:fix": "eslint . --fix", + "lint": "oxlint --quiet", + "lint:fix": "oxlint --fix", "watch": "tsc -p tsconfig.build.json --watch", "test": "vitest run", "test:unit": "vitest run", @@ -84,12 +84,15 @@ "zod": "catalog:" }, "devDependencies": { + "@n8n/oxlint-config": "workspace:*", "@n8n/typescript-config": "workspace:*", "@n8n/vitest-config": "workspace:*", "@types/proxy-from-env": "catalog:", "@types/qs": "catalog:", "@vitest/coverage-v8": "catalog:", "nock": "catalog:", + "oxlint": "catalog:", + "oxlint-tsgolint": "catalog:", "typescript": "catalog:typescript", "vitest": "catalog:", "vitest-mock-extended": "catalog:" diff --git a/packages/@n8n/blob-storage/eslint.config.mjs b/packages/@n8n/blob-storage/eslint.config.mjs index 633e23c978b..a8580805086 100644 --- a/packages/@n8n/blob-storage/eslint.config.mjs +++ b/packages/@n8n/blob-storage/eslint.config.mjs @@ -1,47 +1,12 @@ import { defineConfig } from 'eslint/config'; import { backendConfig } from '@n8n/eslint-config/backend'; -export default defineConfig( - backendConfig, - { - // Relax type-aware unsafe rules for untyped mock plumbing, mirroring n8n-core - files: ['**/__tests__/**/*.ts'], - rules: { - '@typescript-eslint/no-unsafe-assignment': 'warn', - '@typescript-eslint/no-unsafe-argument': 'warn', - '@typescript-eslint/no-unsafe-member-access': 'warn', - }, +export default defineConfig(backendConfig, { + // Relax type-aware unsafe rules for untyped mock plumbing, mirroring n8n-core + files: ['**/__tests__/**/*.ts'], + rules: { + '@typescript-eslint/no-unsafe-assignment': 'warn', + '@typescript-eslint/no-unsafe-argument': 'warn', + '@typescript-eslint/no-unsafe-member-access': 'warn', }, - { - rules: { - /** - * This package is full of AWS SDK params (`Bucket`, `Key`, `Delete`) and - * HTTP header maps (`content-type`, `x-amz-meta-filename`). - */ - '@typescript-eslint/naming-convention': [ - 'error', - { selector: 'default', format: ['camelCase'] }, - { selector: 'import', format: ['camelCase', 'PascalCase'] }, - { - selector: 'variable', - format: ['camelCase', 'snake_case', 'UPPER_CASE', 'PascalCase'], - leadingUnderscore: 'allowSingleOrDouble', - trailingUnderscore: 'allowSingleOrDouble', - }, - { - selector: 'property', - format: ['camelCase', 'snake_case', 'UPPER_CASE'], - leadingUnderscore: 'allowSingleOrDouble', - trailingUnderscore: 'allowSingleOrDouble', - }, - { selector: 'typeLike', format: ['PascalCase'] }, - { - selector: ['method', 'function', 'parameter'], - format: ['camelCase'], - leadingUnderscore: 'allowSingleOrDouble', - }, - { selector: ['objectLiteralProperty', 'typeProperty'], format: null }, - ], - }, - }, -); +}); diff --git a/packages/@n8n/blob-storage/oxlint.config.mts b/packages/@n8n/blob-storage/oxlint.config.mts new file mode 100644 index 00000000000..b50c92512db --- /dev/null +++ b/packages/@n8n/blob-storage/oxlint.config.mts @@ -0,0 +1,7 @@ +import { backendConfig } from '@n8n/oxlint-config/backend'; +import { defineConfig } from 'oxlint'; + +export default defineConfig({ + extends: [backendConfig], + options: { typeAware: true }, +}); diff --git a/packages/@n8n/blob-storage/package.json b/packages/@n8n/blob-storage/package.json index a9ede9620b7..ad3cc62327a 100644 --- a/packages/@n8n/blob-storage/package.json +++ b/packages/@n8n/blob-storage/package.json @@ -10,8 +10,8 @@ "build:unchecked": "tsc -p tsconfig.build.json --noCheck", "format": "biome format --write .", "format:check": "biome ci .", - "lint": "eslint . --quiet", - "lint:fix": "eslint . --fix", + "lint": "oxlint --quiet", + "lint:fix": "oxlint --fix", "watch": "tsc -p tsconfig.build.json --watch", "test": "vitest run", "test:unit": "vitest run", @@ -51,12 +51,13 @@ "zod": "catalog:" }, "devDependencies": { - "@n8n/eslint-config": "workspace:*", + "@n8n/oxlint-config": "workspace:*", "@n8n/typescript-config": "workspace:*", "@n8n/vitest-config": "workspace:*", "@types/lodash": "catalog:", "@vitest/coverage-v8": "catalog:", - "eslint": "catalog:", + "oxlint": "catalog:", + "oxlint-tsgolint": "catalog:", "typescript": "catalog:typescript", "vite": "catalog:", "vitest": "catalog:", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 46ee28b081e..bee65eedffd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1771,6 +1771,9 @@ importers: specifier: 3.25.76 version: 3.25.76 devDependencies: + '@n8n/oxlint-config': + specifier: workspace:* + version: link:../oxlint-config '@n8n/typescript-config': specifier: workspace:* version: link:../typescript-config @@ -1789,6 +1792,12 @@ importers: nock: specifier: 'catalog:' version: 14.0.14 + oxlint: + specifier: 'catalog:' + version: 1.78.0(oxlint-tsgolint@0.21.1) + oxlint-tsgolint: + specifier: 'catalog:' + version: 0.21.1 typescript: specifier: catalog:typescript version: 7.0.2 @@ -2012,9 +2021,9 @@ importers: specifier: 3.25.76 version: 3.25.76 devDependencies: - '@n8n/eslint-config': + '@n8n/oxlint-config': specifier: workspace:* - version: link:../eslint-config + version: link:../oxlint-config '@n8n/typescript-config': specifier: workspace:* version: link:../typescript-config @@ -2027,9 +2036,12 @@ importers: '@vitest/coverage-v8': specifier: 'catalog:' version: 5.0.1(@vitest/browser@5.0.1)(vitest@5.0.1) - eslint: + oxlint: specifier: 'catalog:' - version: 9.29.0(jiti@2.6.1)(supports-color@8.1.1) + version: 1.78.0(oxlint-tsgolint@0.21.1) + oxlint-tsgolint: + specifier: 'catalog:' + version: 0.21.1 typescript: specifier: catalog:typescript version: 7.0.2 diff --git a/scripts/lint-parity/OXLINT_MIGRATION_BLOCKERS.md b/scripts/lint-parity/OXLINT_MIGRATION_BLOCKERS.md index ae08d4f7d33..8ce47b9c6c0 100644 --- a/scripts/lint-parity/OXLINT_MIGRATION_BLOCKERS.md +++ b/scripts/lint-parity/OXLINT_MIGRATION_BLOCKERS.md @@ -54,6 +54,11 @@ Phase 3 decisions: - `n8n-containers`: retire the Docker label exemption. Object literal keys are data, not identifier contracts. - `n8n-playwright`: retire the broad style selectors. Workflow names, fixture keys, and spec paths are data, while identifier casing has no runtime contract. +### Backend storage decisions + +- `@n8n/backend-network`: retire the package naming selectors. They enforce style only and exempt protocol-defined header and charset names. +- `@n8n/blob-storage`: retire the package naming selectors. They enforce style only and exempt AWS and HTTP field names. + ## Retirement exceptions ### `n8n-node-dev` diff --git a/turbo.json b/turbo.json index 2af67666674..0efee6d7190 100644 --- a/turbo.json +++ b/turbo.json @@ -74,12 +74,18 @@ "@n8n/backend-common#lint": { "dependsOn": ["^build", "@n8n/oxlint-config#build"] }, + "@n8n/backend-network#lint": { + "dependsOn": ["^build", "@n8n/oxlint-config#build"] + }, "@n8n/backend-services#lint": { "dependsOn": ["^build", "@n8n/oxlint-config#build"] }, "@n8n/backend-test-utils#lint": { "dependsOn": ["^build", "@n8n/oxlint-config#build"] }, + "@n8n/blob-storage#lint": { + "dependsOn": ["^build", "@n8n/oxlint-config#build"] + }, "@n8n/cli#lint": { "dependsOn": ["^build", "@n8n/oxlint-config#build"] },