mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-11 22:50:06 +00:00
chore: Migrate backend storage lint to Oxlint (no-changelog) (#39991)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import { backendConfig } from '@n8n/oxlint-config/backend';
|
||||
import { defineConfig } from 'oxlint';
|
||||
|
||||
export default defineConfig({
|
||||
extends: [backendConfig],
|
||||
options: { typeAware: true },
|
||||
});
|
||||
@@ -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:"
|
||||
|
||||
@@ -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 },
|
||||
],
|
||||
},
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import { backendConfig } from '@n8n/oxlint-config/backend';
|
||||
import { defineConfig } from 'oxlint';
|
||||
|
||||
export default defineConfig({
|
||||
extends: [backendConfig],
|
||||
options: { typeAware: true },
|
||||
});
|
||||
@@ -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:",
|
||||
|
||||
Generated
+16
-4
@@ -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([email protected])
|
||||
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/[email protected])([email protected])
|
||||
eslint:
|
||||
oxlint:
|
||||
specifier: 'catalog:'
|
||||
version: 9.29.0([email protected])(supports-color@8.1.1)
|
||||
version: 1.78.0([email protected]1.1)
|
||||
oxlint-tsgolint:
|
||||
specifier: 'catalog:'
|
||||
version: 0.21.1
|
||||
typescript:
|
||||
specifier: catalog:typescript
|
||||
version: 7.0.2
|
||||
|
||||
@@ -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`
|
||||
|
||||
@@ -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"]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user