From be78e029892f1fc5ecdc947c9158c7fc82278722 Mon Sep 17 00:00:00 2001 From: Ronny Date: Sun, 24 Nov 2024 15:35:24 +0100 Subject: [PATCH] check for forbidden properties --- web/eslint.config.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/web/eslint.config.js b/web/eslint.config.js index eed844dbcf..1378147a7e 100644 --- a/web/eslint.config.js +++ b/web/eslint.config.js @@ -35,6 +35,16 @@ export default tseslint.config({ 'no-multi-spaces': 'error', 'no-throw-literal': 'error', 'tsdoc/syntax': 'warn', + /** + * Use restricted properties as workaround to address a flaw in the typescript system of global declarations. + * Globally declared modules (such as @types/node::Buffer) should be declared for e.g., tests but must not be declared for the web-application (browsers do not have `Buffer`). + * Unfortunately, once included these are available everywhere in the workspace without exception. + * See also: https://github.com/microsoft/TypeScript/issues/50424 + */ + 'no-restricted-properties': [ 'error', { + "object": "Buffer", + "property": "from" + } ], '@typescript-eslint/naming-convention': [ 'error', // See: https://typescript-eslint.io/rules/naming-convention/#options /* {