mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 12:44:07 -08:00
d1b2affd2c
Follow-up to: https://github.com/n8n-io/n8n/pull/8086 `tsc-alias` as of 1.8.7 is unable to resolve template strings in dynamic imports. Since the module name mapper in Jest is able to, this issue is hard to detect, hence the new lint rule `no-dynamic-import-template`. This is for now specific to `@/` in the `cli` package - we can generalize later if needed. Ideally we should contribute a fix upstream when we have more time. <img width="940" alt="Capture 2023-12-19 at 12 39 55@2x" src="https://github.com/n8n-io/n8n/assets/44588767/78d4a277-ccff-455c-8610-d1bba39d93f2">
38 lines
1,007 B
JavaScript
38 lines
1,007 B
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: {
|
|
'n8n-local-rules/no-dynamic-import-template': 'error',
|
|
|
|
// TODO: Remove this
|
|
'import/no-cycle': 'warn',
|
|
'import/order': 'off',
|
|
'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',
|
|
},
|
|
};
|