mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 02:51:14 +00:00
ci: Introduce lint rule no-untyped-config-class-field (no-changelog) (#10436)
This commit is contained in:
@@ -7,4 +7,13 @@ module.exports = {
|
|||||||
extends: ['@n8n_io/eslint-config/node'],
|
extends: ['@n8n_io/eslint-config/node'],
|
||||||
|
|
||||||
...sharedOptions(__dirname),
|
...sharedOptions(__dirname),
|
||||||
|
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['**/*.config.ts'],
|
||||||
|
rules: {
|
||||||
|
'n8n-local-rules/no-untyped-config-class-field': 'error',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -492,6 +492,29 @@ module.exports = {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'no-untyped-config-class-field': {
|
||||||
|
meta: {
|
||||||
|
type: 'problem',
|
||||||
|
docs: {
|
||||||
|
description: 'Enforce explicit typing of config class fields',
|
||||||
|
recommended: 'error',
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
noUntypedConfigClassField:
|
||||||
|
'Class field must have an explicit type annotation, e.g. `field: type = value`. See: https://github.com/n8n-io/n8n/pull/10433',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
create(context) {
|
||||||
|
return {
|
||||||
|
PropertyDefinition(node) {
|
||||||
|
if (!node.typeAnnotation) {
|
||||||
|
context.report({ node: node.key, messageId: 'noUntypedConfigClassField' });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const isJsonParseCall = (node) =>
|
const isJsonParseCall = (node) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user