2023-07-19 00:35:10 -07:00
|
|
|
const sharedOptions = require('@n8n_io/eslint-config/shared');
|
2022-12-22 00:55:39 -08:00
|
|
|
|
2022-09-12 02:41:50 -07:00
|
|
|
/**
|
|
|
|
* @type {import('@types/eslint').ESLint.ConfigData}
|
|
|
|
*/
|
|
|
|
module.exports = {
|
|
|
|
extends: ['@n8n_io/eslint-config/node'],
|
2022-11-09 06:25:00 -08:00
|
|
|
|
2022-12-22 00:55:39 -08:00
|
|
|
...sharedOptions(__dirname),
|
2022-11-09 06:25:00 -08:00
|
|
|
|
2023-11-27 00:11:52 -08:00
|
|
|
parserOptions: {
|
|
|
|
project: './tsconfig.json',
|
|
|
|
},
|
|
|
|
|
2022-09-12 02:41:50 -07:00
|
|
|
ignorePatterns: [
|
|
|
|
'jest.config.js',
|
|
|
|
// TODO: Remove these
|
|
|
|
'src/databases/ormconfig.ts',
|
|
|
|
],
|
2022-12-22 00:55:39 -08:00
|
|
|
|
2022-09-12 02:41:50 -07:00
|
|
|
rules: {
|
2024-08-28 08:57:46 -07:00
|
|
|
'unicorn/filename-case': ['error', { case: 'kebabCase' }],
|
|
|
|
|
2023-12-21 05:15:37 -08:00
|
|
|
'n8n-local-rules/no-dynamic-import-template': 'error',
|
2024-06-24 01:24:05 -07:00
|
|
|
'n8n-local-rules/misplaced-n8n-typeorm-import': 'error',
|
2024-08-02 03:01:42 -07:00
|
|
|
'n8n-local-rules/no-type-unsafe-event-emitter': 'error',
|
2024-04-10 05:02:02 -07:00
|
|
|
complexity: 'error',
|
2023-12-21 05:15:37 -08:00
|
|
|
|
2022-09-12 02:41:50 -07:00
|
|
|
// TODO: Remove this
|
2022-12-22 00:55:39 -08:00
|
|
|
'import/no-cycle': 'warn',
|
2022-09-12 02:41:50 -07:00
|
|
|
'import/order': 'off',
|
2023-07-28 09:28:17 -07:00
|
|
|
'import/extensions': 'warn',
|
2022-10-31 04:45:34 -07:00
|
|
|
'@typescript-eslint/ban-ts-comment': ['warn', { 'ts-ignore': true }],
|
2023-07-28 09:28:17 -07:00
|
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
|
|
'@typescript-eslint/no-base-to-string': 'warn',
|
|
|
|
'@typescript-eslint/prefer-nullish-coalescing': 'warn',
|
|
|
|
'@typescript-eslint/no-redundant-type-constituents': 'warn',
|
|
|
|
'@typescript-eslint/ban-types': 'warn',
|
|
|
|
'@typescript-eslint/no-unsafe-enum-comparison': 'warn',
|
|
|
|
'@typescript-eslint/no-unsafe-declaration-merging': 'warn',
|
2022-09-12 02:41:50 -07:00
|
|
|
},
|
2024-05-17 01:53:15 -07:00
|
|
|
|
|
|
|
overrides: [
|
2024-08-28 08:57:46 -07:00
|
|
|
{
|
|
|
|
files: ['./src/databases/migrations/**/*.ts'],
|
|
|
|
rules: {
|
|
|
|
'unicorn/filename-case': 'off',
|
|
|
|
},
|
|
|
|
},
|
2024-06-24 01:24:05 -07:00
|
|
|
{
|
2024-08-05 02:12:25 -07:00
|
|
|
files: ['./src/databases/**/*.ts', './test/**/*.ts', './src/**/__tests__/**/*.ts'],
|
2024-06-24 01:24:05 -07:00
|
|
|
rules: {
|
|
|
|
'n8n-local-rules/misplaced-n8n-typeorm-import': 'off',
|
|
|
|
},
|
|
|
|
},
|
2024-08-02 03:01:42 -07:00
|
|
|
{
|
2024-08-05 02:12:25 -07:00
|
|
|
files: ['./test/**/*.ts', './src/**/__tests__/**/*.ts'],
|
2024-08-02 03:01:42 -07:00
|
|
|
rules: {
|
|
|
|
'n8n-local-rules/no-type-unsafe-event-emitter': 'off',
|
|
|
|
},
|
|
|
|
},
|
2024-05-17 01:53:15 -07:00
|
|
|
{
|
|
|
|
files: ['./src/decorators/**/*.ts'],
|
|
|
|
rules: {
|
|
|
|
'@typescript-eslint/ban-types': [
|
|
|
|
'warn',
|
|
|
|
{
|
|
|
|
types: {
|
|
|
|
Function: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2022-10-31 04:45:34 -07:00
|
|
|
};
|