mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
5156313074
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
Benchmark Docker Image CI / build (push) Waiting to run
87 lines
2 KiB
JavaScript
87 lines
2 KiB
JavaScript
const sharedOptions = require('@n8n_io/eslint-config/shared');
|
|
|
|
/**
|
|
* @type {import('@types/eslint').ESLint.ConfigData}
|
|
*/
|
|
module.exports = {
|
|
extends: ['@n8n_io/eslint-config/node'],
|
|
|
|
...sharedOptions(__dirname),
|
|
|
|
parserOptions: {
|
|
project: './tsconfig.json',
|
|
},
|
|
|
|
ignorePatterns: [
|
|
'jest.config.js',
|
|
// TODO: Remove these
|
|
'src/databases/ormconfig.ts',
|
|
],
|
|
|
|
rules: {
|
|
'unicorn/filename-case': ['error', { case: 'kebabCase' }],
|
|
|
|
'n8n-local-rules/no-dynamic-import-template': 'error',
|
|
'n8n-local-rules/misplaced-n8n-typeorm-import': 'error',
|
|
'n8n-local-rules/no-type-unsafe-event-emitter': 'error',
|
|
complexity: 'error',
|
|
|
|
// TODO: Remove this
|
|
'import/no-cycle': 'warn',
|
|
'import/order': [
|
|
'error',
|
|
{
|
|
alphabetize: {
|
|
order: 'asc',
|
|
caseInsensitive: true,
|
|
},
|
|
groups: [['builtin', 'external'], 'internal', ['parent', 'index', 'sibling'], 'object'],
|
|
'newlines-between': 'always',
|
|
},
|
|
],
|
|
'import/extensions': 'warn',
|
|
'@typescript-eslint/ban-ts-comment': ['warn', { 'ts-ignore': true }],
|
|
'@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',
|
|
},
|
|
|
|
overrides: [
|
|
{
|
|
files: ['./src/databases/migrations/**/*.ts'],
|
|
rules: {
|
|
'unicorn/filename-case': 'off',
|
|
},
|
|
},
|
|
{
|
|
files: ['./src/databases/**/*.ts', './test/**/*.ts', './src/**/__tests__/**/*.ts'],
|
|
rules: {
|
|
'n8n-local-rules/misplaced-n8n-typeorm-import': 'off',
|
|
},
|
|
},
|
|
{
|
|
files: ['./test/**/*.ts', './src/**/__tests__/**/*.ts'],
|
|
rules: {
|
|
'n8n-local-rules/no-type-unsafe-event-emitter': 'off',
|
|
},
|
|
},
|
|
{
|
|
files: ['./src/decorators/**/*.ts'],
|
|
rules: {
|
|
'@typescript-eslint/ban-types': [
|
|
'warn',
|
|
{
|
|
types: {
|
|
Function: false,
|
|
},
|
|
},
|
|
],
|
|
},
|
|
},
|
|
],
|
|
};
|