From 5fc789dba4a185c7635c007d1d3dcd39b77f7ef2 Mon Sep 17 00:00:00 2001 From: ZJ van de Weg Date: Tue, 24 Jun 2025 10:04:34 +0200 Subject: [PATCH 1/2] misc: Remove CJS deprecation warning When building docs, there was a deprecation warning, that was fixed following: https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index c20a94cf4..ad0f014c7 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "url": "https://github.com/FlowFuse/node-red-dashboard.git" }, "license": "Apache-2.0", + "type": "module", "author": { "name": "Joe Pavitt", "url": "https://github.com/joepavitt" From ad166ef78e154475b47074f829824dba67752f3f Mon Sep 17 00:00:00 2001 From: ZJ van de Weg Date: Wed, 2 Jul 2025 11:57:36 +0200 Subject: [PATCH 2/2] fix: Add CommonJS globals to ESLint config for nodes directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After converting to ES modules, the nodes directory still uses CommonJS but ESLint was no longer recognizing require, module, __dirname globals. Added these globals to the nodes ESLint override configuration. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .eslintrc.json | 9 ++++++++- package.json | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 897564c50..c3a6fda90 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -65,7 +65,14 @@ "extends": ["plugin:n/recommended"], "env": { "commonjs": true, - "browser": false + "browser": false, + "node": true + }, + "globals": { + "require": "readonly", + "module": "readonly", + "__dirname": "readonly", + "__filename": "readonly" }, "rules": { // plugin:n diff --git a/package.json b/package.json index ad0f014c7..af83166fa 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,6 @@ "url": "https://github.com/FlowFuse/node-red-dashboard.git" }, "license": "Apache-2.0", - "type": "module", "author": { "name": "Joe Pavitt", "url": "https://github.com/joepavitt" @@ -30,6 +29,7 @@ "url": "https://flowfuse.com" } ], + "type": "module", "files": [ "dist/*", "nodes/*"