mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-17 05:29:44 +02:00
chore: Migrate AI tooling lint to Oxlint (no-changelog) (#39834)
This commit is contained in:
parent
1882cff76b
commit
62cadddf28
|
|
@ -5,14 +5,58 @@ export default defineConfig(
|
|||
backendConfig,
|
||||
globalIgnores(['scripts/**']),
|
||||
{
|
||||
files: ['src/utils/n8n-binary-loader.ts'],
|
||||
rules: { 'no-case-declarations': 'warn' },
|
||||
},
|
||||
{
|
||||
files: [
|
||||
'src/__tests__/adapters/langchain-chat-model.test.ts',
|
||||
'src/__tests__/suppliers/supplyModel.test.ts',
|
||||
'src/__tests__/utils/failed-attempt-handler/n8nLlmFailedAttemptHandler.test.ts',
|
||||
'src/__tests__/utils/n8n-llm-tracing.test.ts',
|
||||
'src/adapters/langchain-chat-model.ts',
|
||||
'src/types/message.ts',
|
||||
'src/types/tool.ts',
|
||||
'src/utils/failed-attempt-handler/n8nLlmFailedAttemptHandler.ts',
|
||||
'src/utils/log-wrapper.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/__tests__/*.test.ts',
|
||||
],
|
||||
rules: {
|
||||
'@typescript-eslint/no-explicit-any': 'warn',
|
||||
'no-case-declarations': 'warn',
|
||||
},
|
||||
},
|
||||
{
|
||||
// Debt: the base layer enforces kebab-case filenames and this package has
|
||||
// 31 files that predate it. Rename them, then delete this block.
|
||||
files: [
|
||||
'src/__tests__/suppliers/supplyModel.test.ts',
|
||||
'src/__tests__/utils/failed-attempt-handler/n8nDefaultFailedAttemptHandler.test.ts',
|
||||
'src/__tests__/utils/failed-attempt-handler/n8nLlmFailedAttemptHandler.test.ts',
|
||||
'src/suppliers/supplyMemory.ts',
|
||||
'src/suppliers/supplyModel.ts',
|
||||
'src/utils/failed-attempt-handler/n8nDefaultFailedAttemptHandler.ts',
|
||||
'src/utils/failed-attempt-handler/n8nLlmFailedAttemptHandler.ts',
|
||||
'src/utils/vector-store/MemoryManager/MemoryCalculator.ts',
|
||||
'src/utils/vector-store/MemoryManager/MemoryVectorStoreManager.ts',
|
||||
'src/utils/vector-store/MemoryManager/StoreCleanupService.ts',
|
||||
'src/utils/vector-store/MemoryManager/test/MemoryCalculator.test.ts',
|
||||
'src/utils/vector-store/MemoryManager/test/MemoryVectorStoreManager.test.ts',
|
||||
'src/utils/vector-store/MemoryManager/test/StoreCleanupService.test.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/createVectorStoreNode.test.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/createVectorStoreNode.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/__tests__/insertOperation.test.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/__tests__/loadOperation.test.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/__tests__/operationHandlers.test.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/__tests__/retrieveAsToolExecuteOperation.test.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/__tests__/retrieveAsToolOperation.test.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/__tests__/retrieveOperation.test.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/__tests__/updateOperation.test.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/insertOperation.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/loadOperation.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/retrieveAsToolExecuteOperation.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/retrieveAsToolOperation.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/retrieveOperation.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/updateOperation.ts',
|
||||
'src/utils/vector-store/processDocuments.ts',
|
||||
],
|
||||
rules: {
|
||||
'unicorn/filename-case': 'off',
|
||||
},
|
||||
|
|
|
|||
63
packages/@n8n/ai-utilities/oxlint.config.mts
Normal file
63
packages/@n8n/ai-utilities/oxlint.config.mts
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
import { backendConfig } from '@n8n/oxlint-config/backend';
|
||||
import { defineConfig } from 'oxlint';
|
||||
|
||||
export default defineConfig({
|
||||
extends: [backendConfig],
|
||||
options: { typeAware: true },
|
||||
ignorePatterns: ['scripts/**'],
|
||||
overrides: [
|
||||
{
|
||||
files: ['src/utils/n8n-binary-loader.ts'],
|
||||
rules: { 'no-case-declarations': 'warn' },
|
||||
},
|
||||
{
|
||||
files: [
|
||||
'src/__tests__/adapters/langchain-chat-model.test.ts',
|
||||
'src/__tests__/suppliers/supplyModel.test.ts',
|
||||
'src/__tests__/utils/failed-attempt-handler/n8nLlmFailedAttemptHandler.test.ts',
|
||||
'src/__tests__/utils/n8n-llm-tracing.test.ts',
|
||||
'src/adapters/langchain-chat-model.ts',
|
||||
'src/types/message.ts',
|
||||
'src/types/tool.ts',
|
||||
'src/utils/failed-attempt-handler/n8nLlmFailedAttemptHandler.ts',
|
||||
'src/utils/log-wrapper.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/__tests__/*.test.ts',
|
||||
],
|
||||
rules: { 'typescript/no-explicit-any': 'warn' },
|
||||
},
|
||||
{
|
||||
files: [
|
||||
'src/__tests__/suppliers/supplyModel.test.ts',
|
||||
'src/__tests__/utils/failed-attempt-handler/n8nDefaultFailedAttemptHandler.test.ts',
|
||||
'src/__tests__/utils/failed-attempt-handler/n8nLlmFailedAttemptHandler.test.ts',
|
||||
'src/suppliers/supplyMemory.ts',
|
||||
'src/suppliers/supplyModel.ts',
|
||||
'src/utils/failed-attempt-handler/n8nDefaultFailedAttemptHandler.ts',
|
||||
'src/utils/failed-attempt-handler/n8nLlmFailedAttemptHandler.ts',
|
||||
'src/utils/vector-store/MemoryManager/MemoryCalculator.ts',
|
||||
'src/utils/vector-store/MemoryManager/MemoryVectorStoreManager.ts',
|
||||
'src/utils/vector-store/MemoryManager/StoreCleanupService.ts',
|
||||
'src/utils/vector-store/MemoryManager/test/MemoryCalculator.test.ts',
|
||||
'src/utils/vector-store/MemoryManager/test/MemoryVectorStoreManager.test.ts',
|
||||
'src/utils/vector-store/MemoryManager/test/StoreCleanupService.test.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/createVectorStoreNode.test.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/createVectorStoreNode.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/__tests__/insertOperation.test.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/__tests__/loadOperation.test.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/__tests__/operationHandlers.test.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/__tests__/retrieveAsToolExecuteOperation.test.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/__tests__/retrieveAsToolOperation.test.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/__tests__/retrieveOperation.test.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/__tests__/updateOperation.test.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/insertOperation.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/loadOperation.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/retrieveAsToolExecuteOperation.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/retrieveAsToolOperation.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/retrieveOperation.ts',
|
||||
'src/utils/vector-store/createVectorStoreNode/operations/updateOperation.ts',
|
||||
'src/utils/vector-store/processDocuments.ts',
|
||||
],
|
||||
rules: { 'unicorn/filename-case': 'off' },
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
@ -122,8 +122,8 @@
|
|||
"build:unchecked": "tsc --build tsconfig.build.esm.json tsconfig.build.cjs.json --noCheck && tsc-alias -p tsconfig.build.esm.json && tsc-alias -p tsconfig.build.cjs.json && pnpm copy-tokenizer-json dist/cjs && pnpm copy-tokenizer-json dist/esm",
|
||||
"format": "biome format --write .",
|
||||
"format:check": "biome ci .",
|
||||
"lint": "eslint . --quiet",
|
||||
"lint:fix": "eslint . --fix",
|
||||
"lint": "oxlint --quiet",
|
||||
"lint:fix": "oxlint --fix",
|
||||
"watch": "tsc --build tsconfig.build.esm.json tsconfig.build.cjs.json --watch",
|
||||
"test": "vitest run",
|
||||
"test:unit": "vitest run",
|
||||
|
|
@ -133,6 +133,7 @@
|
|||
"dist"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@n8n/oxlint-config": "workspace:*",
|
||||
"@types/json-schema": "catalog:",
|
||||
"@n8n/vitest-config": "workspace:*",
|
||||
"@vitest/coverage-v8": "catalog:",
|
||||
|
|
@ -145,7 +146,9 @@
|
|||
"tsx": "catalog:",
|
||||
"typescript": "catalog:typescript",
|
||||
"axios": "catalog:",
|
||||
"nock": "catalog:"
|
||||
"nock": "catalog:",
|
||||
"oxlint": "catalog:",
|
||||
"oxlint-tsgolint": "catalog:"
|
||||
},
|
||||
"dependencies": {
|
||||
"zod": "catalog:",
|
||||
|
|
|
|||
26
packages/@n8n/ai-workflow-builder.ee/oxlint.config.mts
Normal file
26
packages/@n8n/ai-workflow-builder.ee/oxlint.config.mts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { backendConfig } from '@n8n/oxlint-config/backend';
|
||||
import { defineConfig } from 'oxlint';
|
||||
|
||||
export default defineConfig({
|
||||
extends: [backendConfig],
|
||||
options: { typeAware: true },
|
||||
ignorePatterns: ['coverage/**', 'vitest.config.*.ts', 'evaluations/programmatic/python/.venv/**'],
|
||||
rules: {
|
||||
complexity: 'error',
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ['./src/test/**/*.ts', './**/*.test.ts'],
|
||||
rules: {
|
||||
'typescript/no-unsafe-assignment': 'warn',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['./evaluations/**/*.ts'],
|
||||
jsPlugins: ['@n8n/oxlint-config/import-x-alias'],
|
||||
rules: {
|
||||
'import-x-alias/no-extraneous-dependencies': ['error', { devDependencies: true }],
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
@ -21,8 +21,8 @@
|
|||
"test:eval:coverage": "vitest run evaluations --coverage",
|
||||
"test:no-eval": "vitest run --exclude '**/evaluations/**'",
|
||||
"test:no-eval:coverage": "vitest run --exclude '**/evaluations/**' --coverage",
|
||||
"lint": "eslint . --quiet",
|
||||
"lint:fix": "eslint . --fix",
|
||||
"lint": "oxlint --quiet",
|
||||
"lint:fix": "oxlint --fix",
|
||||
"watch": "tsc-watch -p tsconfig.build.json --onCompilationComplete \"tsc-alias -p tsconfig.build.json\"",
|
||||
"deps:graph": "madge src/index.ts --image deps-graph.svg",
|
||||
"deps:graph:service": "madge src/ai-workflow-builder-agent.service.ts --image deps-service.svg",
|
||||
|
|
@ -85,6 +85,7 @@
|
|||
"zod": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@n8n/oxlint-config": "workspace:*",
|
||||
"@n8n/typescript-config": "workspace:*",
|
||||
"@n8n/vitest-config": "workspace:*",
|
||||
"@types/jsdom": "catalog:",
|
||||
|
|
@ -92,6 +93,8 @@
|
|||
"@types/turndown": "catalog:",
|
||||
"@vitest/coverage-v8": "catalog:",
|
||||
"madge": "^8.0.0",
|
||||
"oxlint": "catalog:",
|
||||
"oxlint-tsgolint": "catalog:",
|
||||
"tsx": "catalog:",
|
||||
"typescript": "catalog:typescript",
|
||||
"vite": "catalog:",
|
||||
|
|
|
|||
|
|
@ -14,11 +14,4 @@ export default defineConfig(
|
|||
files: ['src/commands/**/*.ts', 'src/modules.d.ts', 'src/configs/eslint.ts'],
|
||||
rules: { 'import-x/no-default-export': 'off', '@typescript-eslint/naming-convention': 'off' },
|
||||
},
|
||||
{
|
||||
// Debt: the base layer enforces kebab-case filenames and this package has
|
||||
// 22 files that predate it. Rename them, then delete this block.
|
||||
rules: {
|
||||
'unicorn/filename-case': 'off',
|
||||
},
|
||||
},
|
||||
);
|
||||
|
|
|
|||
17
packages/@n8n/node-cli/oxlint.config.mts
Normal file
17
packages/@n8n/node-cli/oxlint.config.mts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { backendConfig } from '@n8n/oxlint-config/backend';
|
||||
import { defineConfig } from 'oxlint';
|
||||
|
||||
export default defineConfig({
|
||||
extends: [backendConfig],
|
||||
options: { typeAware: true },
|
||||
ignorePatterns: ['src/template/templates/**/template', 'src/template/templates/shared'],
|
||||
overrides: [
|
||||
{
|
||||
files: ['**/*.test.ts', 'src/test-utils/**/*'],
|
||||
jsPlugins: ['@n8n/oxlint-config/import-x-alias'],
|
||||
rules: {
|
||||
'import-x-alias/no-extraneous-dependencies': ['error', { devDependencies: true }],
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
@ -22,8 +22,8 @@
|
|||
"dev": "tsc-watch -p tsconfig.build.json -w --onCompilationComplete \"pnpm copy-templates\"",
|
||||
"format": "biome format --write src",
|
||||
"format:check": "biome ci src",
|
||||
"lint": "eslint src --quiet",
|
||||
"lintfix": "eslint src --fix",
|
||||
"lint": "oxlint src --quiet",
|
||||
"lintfix": "oxlint src --fix",
|
||||
"build": "tsc -p tsconfig.build.json && pnpm copy-templates",
|
||||
"build:unchecked": "tsc -p tsconfig.build.json --noCheck && pnpm copy-templates",
|
||||
"publish:dry": "pnpm run build && pnpm pub --dry-run",
|
||||
|
|
@ -65,9 +65,12 @@
|
|||
"typescript-eslint": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@n8n/oxlint-config": "workspace:*",
|
||||
"@n8n/typescript-config": "workspace:*",
|
||||
"@n8n/vitest-config": "workspace:*",
|
||||
"@typescript/native": "catalog:typescript-tooling",
|
||||
"oxlint": "catalog:",
|
||||
"oxlint-tsgolint": "catalog:",
|
||||
"typescript": "catalog:typescript-tooling",
|
||||
"vite": "catalog:",
|
||||
"vitest": "catalog:",
|
||||
|
|
|
|||
|
|
@ -1404,6 +1404,9 @@ importers:
|
|||
specifier: 'catalog:'
|
||||
version: 3.23.3(zod@3.25.76)
|
||||
devDependencies:
|
||||
'@n8n/oxlint-config':
|
||||
specifier: workspace:*
|
||||
version: link:../oxlint-config
|
||||
'@n8n/vitest-config':
|
||||
specifier: workspace:*
|
||||
version: link:../vitest-config
|
||||
|
|
@ -1428,6 +1431,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
|
||||
tsx:
|
||||
specifier: 'catalog:'
|
||||
version: 4.19.3
|
||||
|
|
@ -1528,6 +1537,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
|
||||
|
|
@ -1549,6 +1561,12 @@ importers:
|
|||
madge:
|
||||
specifier: ^8.0.0
|
||||
version: 8.0.0(supports-color@8.1.1)(typescript@7.0.2)
|
||||
oxlint:
|
||||
specifier: 'catalog:'
|
||||
version: 1.78.0(oxlint-tsgolint@0.21.1)
|
||||
oxlint-tsgolint:
|
||||
specifier: 'catalog:'
|
||||
version: 0.21.1
|
||||
tsx:
|
||||
specifier: 'catalog:'
|
||||
version: 4.19.3
|
||||
|
|
@ -3459,6 +3477,9 @@ importers:
|
|||
specifier: 'catalog:'
|
||||
version: 8.70.0(@typescript/typescript6@6.0.2)(eslint@9.29.0(jiti@2.6.1)(supports-color@8.1.1))(supports-color@8.1.1)
|
||||
devDependencies:
|
||||
'@n8n/oxlint-config':
|
||||
specifier: workspace:*
|
||||
version: link:../oxlint-config
|
||||
'@n8n/typescript-config':
|
||||
specifier: workspace:*
|
||||
version: link:../typescript-config
|
||||
|
|
@ -3468,6 +3489,12 @@ importers:
|
|||
'@typescript/native':
|
||||
specifier: catalog:typescript-tooling
|
||||
version: typescript@7.0.2
|
||||
oxlint:
|
||||
specifier: 'catalog:'
|
||||
version: 1.78.0(oxlint-tsgolint@0.21.1)
|
||||
oxlint-tsgolint:
|
||||
specifier: 'catalog:'
|
||||
version: 0.21.1
|
||||
typescript:
|
||||
specifier: catalog:typescript-tooling
|
||||
version: '@typescript/typescript6@6.0.2'
|
||||
|
|
|
|||
|
|
@ -62,6 +62,12 @@
|
|||
"@n8n/ai-node-sdk#lint": {
|
||||
"dependsOn": ["^build", "@n8n/oxlint-config#build"]
|
||||
},
|
||||
"@n8n/ai-utilities#lint": {
|
||||
"dependsOn": ["^build", "@n8n/oxlint-config#build"]
|
||||
},
|
||||
"@n8n/ai-workflow-builder#lint": {
|
||||
"dependsOn": ["^build", "@n8n/oxlint-config#build"]
|
||||
},
|
||||
"@n8n/backend-common#lint": {
|
||||
"dependsOn": ["^build", "@n8n/oxlint-config#build"]
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user