build: Update ESLint to v9 (#16639)

This commit is contained in:
Elias Meire
2025-06-27 10:42:47 +02:00
committed by GitHub
parent a99ccfffe1
commit 0775fd859e
176 changed files with 5417 additions and 4111 deletions

View File

@@ -1,40 +0,0 @@
const sharedOptions = require('@n8n/eslint-config/shared');
/**
* @type {import('@types/eslint').ESLint.ConfigData}
*/
module.exports = {
extends: ['@n8n/eslint-config/base', 'plugin:cypress/recommended'],
...sharedOptions(__dirname),
plugins: ['cypress'],
env: {
'cypress/globals': true,
},
rules: {
// TODO: remove these rules
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/promise-function-async': 'off',
'n8n-local-rules/no-uncaught-json-parse': 'off',
'cypress/no-assigning-return-values': 'warn',
'cypress/no-unnecessary-waiting': 'warn',
'cypress/unsafe-to-chain-command': 'warn',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: ['**/cypress/**'],
optionalDependencies: false,
},
],
},
};

View File

@@ -1,4 +1,4 @@
declare module 'cypress-otp' {
// eslint-disable-next-line import/no-default-export
// eslint-disable-next-line import-x/no-default-export
export default function generateOTPToken(secret: string): string;
}

39
cypress/eslint.config.mjs Normal file
View File

@@ -0,0 +1,39 @@
import { defineConfig, globalIgnores } from 'eslint/config';
import { baseConfig } from '@n8n/eslint-config/base';
import cypressPlugin from 'eslint-plugin-cypress/flat';
export default defineConfig(
globalIgnores(['scripts/**/*.js']),
baseConfig,
cypressPlugin.configs.recommended,
{
rules: {
// TODO: Remove this
'no-useless-escape': 'warn',
'import-x/order': 'warn',
'import-x/no-extraneous-dependencies': [
'error',
{
devDependencies: ['**/cypress/**'],
optionalDependencies: false,
},
],
'@typescript-eslint/naming-convention': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/no-unused-expressions': 'warn',
'@typescript-eslint/no-use-before-define': 'warn',
'@typescript-eslint/promise-function-async': 'warn',
'@typescript-eslint/prefer-nullish-coalescing': 'warn',
'@typescript-eslint/unbound-method': 'warn',
'cypress/no-assigning-return-values': 'warn',
'cypress/no-unnecessary-waiting': 'warn',
'cypress/unsafe-to-chain-command': 'warn',
'n8n-local-rules/no-uncaught-json-parse': 'warn',
},
},
);

View File

@@ -19,7 +19,7 @@
"@cypress/grep": "^4.1.0",
"@n8n/api-types": "workspace:*",
"@types/lodash": "catalog:",
"eslint-plugin-cypress": "^3.5.0",
"eslint-plugin-cypress": "^4.3.0",
"n8n-workflow": "workspace:*"
},
"dependencies": {