From 70fbe5dbbdb6a10c2d57005440e2da26c5cd506b Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Fri, 23 May 2025 23:23:08 +0200 Subject: [PATCH 1/2] [refactor] Replace deprecated constants --- CHANGELOG.md | 5 +++-- js/app.js | 8 ++++---- js/check_config.js | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c49c1a695..1da794c9c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,17 +30,18 @@ planned for 2025-07-01 - Replace `eslint-plugin-import` with `eslint-plugin-import-x` - Switch Stylelint config to flat format and simplify Stylelint scripts - [workflow] Replace Node.js version v23 with v24 (#3770) +- [refactor] Replace deprecated constants ### Fixed - [fix] Handle spellcheck issues (#3783) - [calendar] fix fullday event rrule until with timezone offset (#3781) - [feat] Add rule `no-undef` in config file validation to fix #3785 (#3786) -- [fonts] Fix `roboto.css` to avoid error message `Unknown descriptor 'var(' in @font-face rule.` in firefox console +- [fonts] Fix `roboto.css` to avoid error message `Unknown descriptor 'var(' in @font-face rule.` in firefox console (#3787) ### Updated -- [core] Update dependencies incl. electron to v36 (#3774) +- [core] Update dependencies incl. electron to v36 (#3774, #3788) ## [2.31.0] - 2025-04-01 diff --git a/js/app.js b/js/app.js index 20bc856cf3..00d714de0b 100644 --- a/js/app.js +++ b/js/app.js @@ -77,7 +77,7 @@ function App () { // check if templateFile exists try { - fs.accessSync(templateFile, fs.F_OK); + fs.accessSync(templateFile, fs.constants.F_OK); } catch (err) { templateFile = null; Log.log("config template file not exists, no envsubst"); @@ -126,7 +126,7 @@ function App () { require(`${global.root_path}/js/check_config.js`); try { - fs.accessSync(configFilename, fs.F_OK); + fs.accessSync(configFilename, fs.constants.F_OK); const c = require(configFilename); if (Object.keys(c).length === 0) { Log.error("WARNING! Config file appears empty, maybe missing module.exports last line?"); @@ -198,7 +198,7 @@ function App () { const moduleFile = `${moduleFolder}/${moduleName}.js`; try { - fs.accessSync(moduleFile, fs.R_OK); + fs.accessSync(moduleFile, fs.constants.R_OK); } catch (e) { Log.warn(`No ${moduleFile} found for module: ${moduleName}.`); } @@ -207,7 +207,7 @@ function App () { let loadHelper = true; try { - fs.accessSync(helperPath, fs.R_OK); + fs.accessSync(helperPath, fs.constants.R_OK); } catch (e) { loadHelper = false; Log.log(`No helper found for module: ${moduleName}.`); diff --git a/js/check_config.js b/js/check_config.js index b7912ced1e..109deb9384 100644 --- a/js/check_config.js +++ b/js/check_config.js @@ -35,7 +35,7 @@ function checkConfigFile () { // Check permission try { - fs.accessSync(configFileName, fs.F_OK); + fs.accessSync(configFileName, fs.constants.F_OK); } catch (error) { throw new Error(`${error}\nNo permission to access config file!`); } From 801852b64bea4f142382b68100c6ba8c4ae6bea9 Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Fri, 23 May 2025 23:42:00 +0200 Subject: [PATCH 2/2] Add PR ID --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1da794c9c3..637f220143 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,7 +30,7 @@ planned for 2025-07-01 - Replace `eslint-plugin-import` with `eslint-plugin-import-x` - Switch Stylelint config to flat format and simplify Stylelint scripts - [workflow] Replace Node.js version v23 with v24 (#3770) -- [refactor] Replace deprecated constants +- [refactor] Replace deprecated constants `fs.F_OK` and `fs.R_OK` (#3789) ### Fixed