Bug 39188

Summary: ESLint doesn't work due bug in old "globals" node package
Product: Koha Reporter: Victor Grousset/tuxayo <victor>
Component: Architecture, internals, and plumbingAssignee: Victor Grousset/tuxayo <victor>
Status: Pushed to main --- QA Contact: Matt Blenkinsop <matt.blenkinsop>
Severity: normal    
Priority: P5 - low CC: jonathan.druart, matt.blenkinsop
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:
Bug Depends on: 38664    
Bug Blocks:    
Attachments: Bug 39188: Fix ESLint by Updating "globals" node package
Bug 39188: [DO NOT PUSH] yarn.lock [DON'T APPLY IF IT CONFLICTS]
Bug 39188: Fix ESLint by Updating "globals" node package
Bug 39188: [DO NOT PUSH] yarn.lock [DON'T APPLY IF IT CONFLICTS]
Bug 39188: Fix ESLint by Updating "globals" node package
Bug 39188: [DO NOT PUSH] yarn.lock [DON'T APPLY IF IT CONFLICTS]

Description Victor Grousset/tuxayo 2025-02-24 04:41:07 UTC
1. eslint ./koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormAdd.vue
2. TypeError: Key "languageOptions": Key "globals": Global "AudioWorkletGlobalScope " has leading or trailing whitespace

globals was introduced in these commits:
Bug 38664: Add @babel/core back to package.json
Bug 38664: Update yarn.lock

And somehow it pulls the version from Apr 2019. Which had a trailing space in a value.
Comment 1 Victor Grousset/tuxayo 2025-02-24 04:50:56 UTC Comment hidden (obsolete)
Comment 2 Victor Grousset/tuxayo 2025-02-24 04:50:58 UTC Comment hidden (obsolete)
Comment 3 Magnus Enger 2025-03-14 07:45:46 UTC
Created attachment 179302 [details] [review]
Bug 39188: Fix ESLint by Updating "globals" node package

According to the main dev of ESLint, we should add it to devDependencies
because we are the ones calling globals from eslint.config.mjs:
https://github.com/eslint/eslint/issues/19209#issuecomment-2518452107

Test plan:
1. run: eslint ./koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormAdd.vue
2. TypeError: Key "languageOptions": Key "globals": Global "AudioWorkletGlobalScope " has leading or trailing whitespace
3. :(
4. Apply patch
5. sudo yarn install --modules-folder /kohadevbox/node_modules
6. run: eslint ./koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormAdd.vue
7. eslint output a report about the issues found in the file
8. signoff :D

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Comment 4 Magnus Enger 2025-03-14 07:45:49 UTC
Created attachment 179303 [details] [review]
Bug 39188: [DO NOT PUSH] yarn.lock [DON'T APPLY IF IT CONFLICTS]

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Comment 5 Matt Blenkinsop 2025-04-03 08:11:47 UTC
Created attachment 180436 [details] [review]
Bug 39188: Fix ESLint by Updating "globals" node package

According to the main dev of ESLint, we should add it to devDependencies
because we are the ones calling globals from eslint.config.mjs:
https://github.com/eslint/eslint/issues/19209#issuecomment-2518452107

Test plan:
1. run: eslint ./koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormAdd.vue
2. TypeError: Key "languageOptions": Key "globals": Global "AudioWorkletGlobalScope " has leading or trailing whitespace
3. :(
4. Apply patch
5. sudo yarn install --modules-folder /kohadevbox/node_modules
6. run: eslint ./koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormAdd.vue
7. eslint output a report about the issues found in the file
8. signoff :D

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Comment 6 Matt Blenkinsop 2025-04-03 08:11:50 UTC
Created attachment 180437 [details] [review]
Bug 39188: [DO NOT PUSH] yarn.lock [DON'T APPLY IF IT CONFLICTS]

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Comment 7 Katrin Fischer 2025-04-11 07:55:54 UTC
Pushed for 25.05!

Well done everyone, thank you!